- Home /
Where can I find advanced controls for custom editor?
Hi Everyone, I am building some custom editors for my scripts, and I started to use custom components. But I saw that the GUILayout controls are a litle limited, for instance, I can't find any component that I can associate with a GameObject public field, where I can select any gameobject to get the reference for my script to work. These kind of things. Does anyone know if there is some advanced controls to create more complex custom inspectors?
Thanks all!
Answer by Nanobrain · Mar 05, 2014 at 03:15 PM
Use the EditorGUILayout.ObjectField() method.
GameObject myGameObject = (GameObject)EditorGUILayout.ObjectField("A Game Object", null, GameObject, true, null);
Where the third argument is where you specify what type of object this field will accept.
Thank you nanobrain! It looks exactly what I need! Have a nice day pal! =]
Glad I could help :) Could you please mark this answer as the accepted answer?