void DrawAspect(Camera cam, float h, float v, Color color, bool push = false) { Gizmos.color = color; float ratiowidth = (cam.pixelHeight / v * h); float x = (cam.pixelWidth / 2f) - (ratiowidth / 2f); Vector3 point1 = cam.ScreenToWorldPoint(new Vector3(x, 0, 0)); Vector3 point2 = cam.ScreenToWorldPoint(new Vector3(x, cam.pixelHeight, 0)); Vector3 point3 = cam.ScreenToWorldPoint(new Vector3(x + ratiowidth, cam.pixelHeight, 0)); Vector3 point4 = cam.ScreenToWorldPoint(new Vector3(x + ratiowidth, 0, 0)); GizmosExtension.DrawPoly(point1, point2, point3, point4); #if UNITY_EDITOR GUIStyle style = new GUIStyle(); style.normal.textColor = color; UnityEditor.Handles.Label(point4, (push?"\n":"") + h + ":" + v, style); #endif }