refactor: using camera that was given in params.

This commit is contained in:
Demexis 2025-02-26 03:52:53 +02:00
parent 4bf61527a5
commit 37aab9ca44

View File

@ -61,7 +61,7 @@ namespace DCFApixels {
} }
/// <summary> /// <summary>
/// Should be called once after the app domain is cleared. /// Texture should be set once after the app domain is cleared.
/// </summary> /// </summary>
private void CheckTextureInstance() { private void CheckTextureInstance() {
if (_backgroundTexture != null) { if (_backgroundTexture != null) {
@ -141,9 +141,8 @@ namespace DCFApixels {
float GetCameraZoom() { float GetCameraZoom() {
const float DEFAULT_ZOOM = 1f; const float DEFAULT_ZOOM = 1f;
var localCamera = GetCurrentCamera(); if (camera != null) {
if (localCamera != null) { return camera.orthographicSize;
return localCamera.orthographicSize;
} }
var currentDrawingSceneView = SceneView.currentDrawingSceneView; var currentDrawingSceneView = SceneView.currentDrawingSceneView;
@ -152,7 +151,7 @@ namespace DCFApixels {
return DEFAULT_ZOOM; return DEFAULT_ZOOM;
} }
localCamera = currentDrawingSceneView.camera; var localCamera = currentDrawingSceneView.camera;
if (localCamera != null) { if (localCamera != null) {
return localCamera.orthographicSize; return localCamera.orthographicSize;