Skip to content

Instantly share code, notes, and snippets.

@SilverKnightVGM
SilverKnightVGM / Unity-ViewOrthographicCameraBounds
Created March 25, 2016 04:24 — forked from elebetsamer/Unity-ViewOrthographicCameraBounds
View the bounds of an orthographic camera in Unity even if it isn't selected.
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));
}