We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent ddb602f commit 49bf5d2Copy full SHA for 49bf5d2
Assets/Scripts/Editor/Gizmos/RendererBoundsGizmo.cs
@@ -0,0 +1,24 @@
1
+// attach this to mesh, draws renderer bounds when gameobject is selected
2
+// original source: http://answers.unity.com/answers/137475/view.html
3
+
4
+using UnityEngine;
5
6
+namespace UnityLibrary
7
+{
8
+ public class RendererBoundsGizmo : MonoBehaviour
9
+ {
10
+ void OnDrawGizmos()
11
12
+ OnDrawGizmosSelected();
13
+ }
14
15
+ void OnDrawGizmosSelected()
16
17
+ Gizmos.color = Color.yellow;
18
+ //center sphere
19
+ //Gizmos.DrawSphere(transform.position, 0.1f);
20
+ var r = transform.GetComponent<Renderer>();
21
+ if (r != null) Gizmos.DrawWireCube(transform.position, r.bounds.size);
22
23
24
+}
0 commit comments