From 37aab9ca44f73f60739d72bd9e88550c4b464768 Mon Sep 17 00:00:00 2001 From: Demexis Date: Wed, 26 Feb 2025 03:52:53 +0200 Subject: [PATCH] refactor: using camera that was given in params. --- Runtime/Gizmos/DebugX.text.cs | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/Runtime/Gizmos/DebugX.text.cs b/Runtime/Gizmos/DebugX.text.cs index 34fcf32..1e8427b 100644 --- a/Runtime/Gizmos/DebugX.text.cs +++ b/Runtime/Gizmos/DebugX.text.cs @@ -61,7 +61,7 @@ namespace DCFApixels { } /// - /// Should be called once after the app domain is cleared. + /// Texture should be set once after the app domain is cleared. /// private void CheckTextureInstance() { if (_backgroundTexture != null) { @@ -141,9 +141,8 @@ namespace DCFApixels { float GetCameraZoom() { const float DEFAULT_ZOOM = 1f; - var localCamera = GetCurrentCamera(); - if (localCamera != null) { - return localCamera.orthographicSize; + if (camera != null) { + return camera.orthographicSize; } var currentDrawingSceneView = SceneView.currentDrawingSceneView; @@ -152,7 +151,7 @@ namespace DCFApixels { return DEFAULT_ZOOM; } - localCamera = currentDrawingSceneView.camera; + var localCamera = currentDrawingSceneView.camera; if (localCamera != null) { return localCamera.orthographicSize;