mirror of
https://github.com/DCFApixels/Unity-DebugX.git
synced 2025-09-18 18:14:36 +08:00
refactor: using camera that was given in params.
This commit is contained in:
parent
4bf61527a5
commit
37aab9ca44
@ -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;
|
||||||
|
Loading…
Reference in New Issue
Block a user