- Home /
Question by
Lidex3 · Aug 01, 2017 at 11:59 AM ·
custom-inspectoronscenegui
Display OnSceneGUI without selecting the object
I've tried a little bit with custom Inspectors and got it work to display the Inspector for another Object inside my custom Inspector. Now I want to Display a Collider in the Inspector. It works fine until I press "Edit Collider". Nothing will change. I'm not able to edit the collider in the scene view.
What I do:
I save the Editor for the collider as a variable:
Editor colliderEditor;
Then I create the Collider editor for my Object. In this case, the collider is attached to a GameObject called "node".
colliderEditor = Editor.CreateEditor(node.GetComponent<BoxCollider>());
Finally inside OnInspectorGUI() I call:
colliderEditor.OnInspectorGUI();
Now it will display the Inspector for my Collider. However, it will not display the handles to change the collider in the scene view. (It does show the collider but probably only because node is a child of the selected Object)
Comment