- Home /
Custom Inspector - Select Other Game Object
I have created a custom inspector for a component. In the inspector there is a button which says "Select Target". Upon clicking the button, I want my next selection of a GameObject with a Node component to be ignored, instead passing back the clicked object to be stored in a variable.
Worth noting, all nodes are displayed by gizmos.
Anyone done this before? Thanks
$$anonymous$$y first thought would be to attach something to EditorApplication.update which checks for Selectoin.activeObject to change and then knows how to switch back the selection.
Answer by Randomman159 · Mar 27, 2014 at 09:19 AM
Thanks to whydoidoit, I was massively over complicating it. Simply had a variable which contained the currently modifying node, and upon selection of another node, checked if that variable was not null. If it wasn't null, it set itself as the connected node, and made the previous node selected again.
Your answer
![](https://koobas.hobune.stream/wayback/20220613141306im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Initialising List array for use in a custom Editor 1 Answer
Editor Windows : Help required 1 Answer
Gizmos icons 0 Answers
How to Draw Gizmos without using a MonoBehaviour? 2 Answers
Multiple Cars not working 1 Answer