- Home /
Set icon of EditorWindow
I need to set the icon of an EditorWindow (meaning the icon that is next to the title of an editor panel), but can't find a way to do it. Anyone knows how it can be done?
Thanks.
Answer by Demigiant · Nov 02, 2012 at 05:37 PM
Found a way, using Reflection and accessing a hidden getter in the EditorWindow class.
I added it as a simple method in my HOUnityLibs open-source library, inside the HOEditorUtils.HOPanelUtils static class. You can simply call:
HOPanelUtils.SetWindowTitle(EditorWindow editorWindow, Texture icon, string title);
If you're curious about the code to do it, it's here.
EDIT: @numberkruncher has also an alternate solution, on Unity Forums
Answer by Landern · Nov 02, 2012 at 01:30 PM
Pretty sure this isn't exposed, sorry.
Others want this ability too -> from the forum
I might actually have found a way, using some ILSpy and some Reflection. Testing it now, and will let you know if I manage :)
Your answer
![](https://koobas.hobune.stream/wayback/20220613083239im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
How do you get the height dimension of the asset label box in the game inspector 0 Answers
Make a custom inspector that shows a group of variables in form of list 2 Answers
Serialize Custom Abstract Class (No-MonoBehaviour / No-ScriptableObject) 1 Answer
Outsource EditorWindow code 1 Answer
Changed data through EditorWindow isn't persistent. 1 Answer