Last active
May 5, 2021 19:27
-
-
Save elebetsamer/9206403 to your computer and use it in GitHub Desktop.
View the bounds of an orthographic camera in Unity even if it isn't selected.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void OnDrawGizmos() | |
{ | |
float verticalHeightSeen = Camera.main.orthographicSize * 2.0f; | |
float verticalWidthSeen = verticalHeightSeen * Camera.main.aspect; | |
Gizmos.color = Color.cyan; | |
Gizmos.DrawWireCube(transform.position, new Vector3(verticalWidthSeen, verticalHeightSeen, 0)); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment