- Home /
GameObject size in Inspector
I can't seem to find an easy way to view a GameObject's size in the Inspector..
Am I missing some data somewhere or am I going to have to extend the editor?
If I need to add editor code, I would prefer to have the size data added to the Transform box right under the scale.. but I can't seem to get my editor code to work (it doesn't even show in inspector):
@CustomEditor (size)
class size extends EditorWindow {
function OnInspectorGUI () {
var bounds : Bounds = GameObject.mesh.bounds;
EditorGUILayout.Vector3Field ("Size", Vector3(bounds.size.x,bounds.size.y,bounds.size.z));
if (GUI.changed) {
var bounds2 : Bounds = GameObject.mesh.bounds;
EditorGUILayout.Vector3Field ("Size", Vector3(bounds2.size.x,bounds2.size.y,bounds2.size.z));
}
}
}
Comment
Your answer
Follow this Question
Related Questions
Draw inspector for SerializedObject within EditorWindow? 1 Answer
Inspector turns black on refresh 4 Answers
How to record hideFlags for Undo/Redo 0 Answers
Exposing Enums in Custom Inspector 1 Answer