- Home /
Add an icon or text to the inspector on custom scripts?
I have made a few hundred different scripts that is being used in a designer tool I am making to extend unity with
The scripts are roughly divided into three categories:
- Entity
- Event
- Condition
Some of the Entities have very similar names to the Events and Conditions, and the designer who is testing the tool for me complained that it is hard to differentiate between the scripts on the GameObject in the inspector so I suggested I'd add an icon or some text to the inspector, but as far as I can tell it is not possible to do so easily.
I do not want to create 100's of Icon files in the Gizmos folder as suggested here: http://answers.unity3d.com/questions/469/changing-the-inspector-titlebar-icon-and-text
And since creating a custom inspector for my base classes would not work as stated here: http://answers.unity3d.com/questions/45576/do-custom-inspectors-support-inheritance I do not want to create 100's of new custom inspectors either, that would be even worse than having 100's of icons.
Then I am at a loss of what to do. Any ideas or suggestions would be greatly appreciated :)
Unless I am misunderstanding you completely, then that is more specific as to how to load an icon, which I already knew. But seeing as I have 100's of scripts I do not want to make 1 new custom inspector per script. (as I mentioned at the bottom of my question).
Would love to see an answer to this. Did you find a way in these months?
Answer by Statement · Mar 29, 2011 at 08:16 PM
Use either:
- Default References (Inspector on script).
- AssetDatabase.LoadAssetAtPath or AssetDatabase.LoadAllAssetsAtPath.
So your first suggestion is to have an icon variable in the script, and that would show up in the inspector? Also,why would loading asset at a path help me putting an icon or text on the inspector of hundreds of scripts. I thought they only gave you the assets in code?
Your answer

Follow this Question
Related Questions
Drawing Editor Inspector GUI based on selected/current prefab (CustomPropertyDrawer) 2 Answers
Cloning GameObjects with custom inspector script attached 0 Answers
Select a readonly value from dropdown using PropertyDrawers 0 Answers
Update editorscript if gameobject is manipulated. 1 Answer
Questions Regarding Images in Custom Inspector/Editor 1 Answer