- Home /
How to make CustomEditor as in Terrain script ?
Is is possible to make a CustomEditor script that has the appearence of the Terrain script ? I am especially interessed in the field which shows the tree object thumbnails and seems to work like a list of GameObjects.
Thanks in advance for any reply.
Thank you very much for this response and the links.
Nevertheless, it seems as if I didn't was able to make my question clear. I am especially asking for a field in the editor which looks like the one in the terrain script (see below). This field seems to show an array of variable size with nice thumbnails including the possibility to add and remove gameobjects. This representation of gameobjects in the editor seems to be unique and I have not found any possibility to use it in my own editor script. Even though there are possible alternatives as nicely shown in: http://catlikecoding.com/unity/tutorials/editor/custom-list/ I would be very interessed if it is possible to make something comparable to the representation in the terrain script.
Thank you in advance !
well you could have an array of gameobjects set, and then use something like this http://docs.unity3d.com/ScriptReference/EditorGUI.DrawPreviewTexture.html to display the images (a button in the editor is just GUILayout.Button)
Answer by everett24 · Aug 30, 2014 at 08:47 PM
this tutorial will help you start it http://unity3d.com/learn/tutorials/modules/intermediate/editor/building-custom-inspector
now you have to realize that a lot of work goes into a custom inspector as complicated as that. This is the API for the EditorGUILayout(its what i use) http://docs.unity3d.com/ScriptReference/EditorGUILayout.html
just plan out before you start, saves time later
Your answer
Follow this Question
Related Questions
Tree color variation 0 Answers
How would you go about 'painting' images onto terrain 0 Answers
Make a simple tree 1 Answer
DrawDefaultInspector crash 1 Answer
Access serialized field in custom editor 2 Answers