+12

Bolt Icon in the hierarchy

babywka 2 years ago updated by Antonio Rojas 4 weeks ago 11

Maybe someone will be useful. 

How to add a custom icon to the hierarchy window like this?


1. Download the script below to the project folder Assets/Editor 

(another path will occur an error during building project)
BoltHierarchyIcon.cs

2. Place icons with names 
ic_bolt_flow.png  
ic_bolt_state.png 
to the folder

Assets/Gizmos/Bolt/


Bolt Version:
Unity Version:
Platform(s):
Scripting Backend:
.NET Version (API Compatibility Level):
+4

Awesome! I'll try to get that built-in soon.

+1

I was looking for an option but couldn't find it. Is it already there or still on todo?

If this is in todo - can this topic become kind of sticky? Cause it is really useful! 

Really nice 👍👍👍

But i can't build with the script in my project.

Error 1: 
Assets/BoltHierarchyIcon.cs(27,2): error CS0246: The type or namespace name `InitializeOnLoad' could not be found. Are you missing an assembly reference?

Error 2:
Assets/BoltHierarchyIcon.cs(34,16): error CS0103: The name `AssetDatabase' does not exist in the current context

Error 3:
Assets/BoltHierarchyIcon.cs(41,9): error CS0103: The name `EditorApplication' does not exist in the current context

Error 4:
Assets/BoltHierarchyIcon.cs(52,33): error CS0103: The name `EditorUtility' does not exist in the current context

Error 5:
Assets/BoltHierarchyIcon.cs(64,13): error CS0103: The name `EditorGUIUtility' does not exist in the current context

Error 6:
Assets/BoltHierarchyIcon.cs(72,13): error CS0103: The name `EditorGUI' does not exist in the current context


+1

sorry, forgot that editor extension must be excluded from the final build

Download the script to the project folder Assets/Editor 

Cool idea. 

Is this supposed to work for when either a State Machine and/or Flow Machine is added to a gameobject, or just Flow Machine?

just updated post and script to work with both - state and flow machine

+1

So, the icons should go into Assets/Gizmos/Bolt... is that correct?

Thanks

Doesn't work! Both icon appeared in hierarchy

Are you sure that state and flow machines is not added to the gameobject?