title: How to have custom script icons other than using "Assets/Gizmos" in Unity3D
body: <p>I know this was asked a lot of times probably .. but it is very often answered wrong.</p>
  
  <h1>What I want is:</h1>
  
  <p>Use a custom icon for specific components/scripts in the Inspector (e.g. Figure 2 and Figure 3) and the ProjectView (e.g. Figure 1)
  <a href="https://i.stack.imgur.com/JaTJ5.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/JaTJ5.jpg" alt="alt text"></a></p>
  
  <h1>What I do so far:</h1>
  
  <p>For each component/class that shall have the icon I have an accroding Icon file in the folder<br></p>
  
  <pre><code>Assets/Gizmos/&lt;Path&gt;/&lt;To&gt;/&lt;Namespace&gt;/&lt;ClassName&gt; icon
  </code></pre>
  
  <p>and in the <code>Import Settigns</code> set <code>TextureType</code> to <code>Editor GUI and Legacy GUI</code></p>
  
  <p>This is working fine .. and until now the only way how I could achieve that (having in mind the below section <strong>What I definitely do NOT want</strong>).</p>
  
  <hr>
  
  <h1>But</h1>
  
  <p>However, I wondered if there is really no better way having to have a unique Icon file for each script. This makes the project/UnityPackage unnecessarily huge. Also if I rename a class I always have to rename the according icon file as well ... This imply doesn't feel right!</p>
  
  <p>Most Unity build-in Behaviours and Components have a unique icon. But also external Packages coming from the new PackageManager have built-in icons and sometimes a <code>Gizmos</code> folder but it is not following the above naming rule ... so apparently the icon is configured somehow else for them.</p>
  
  <p>Therefore my questions:<br>
  <strong>Is there any better way to have those icons for scripts/components?</strong></p>
  
  <p>Preferably scripted and reusing ONE single icon file instead of having the same icon in multiple differently named files. </p>
  
  <p>And/or also <strong>Where/How are those icons defined for the scripts coming from the PackageManager?</strong></p>
  
  <hr>
  
  <h1>!NOTE!  What I definitely do NOT want:</h1>
  
  <p>Show the Icon also in the SceneView for all <code>GameObjects</code> having those components attached (e.g. Figure 4). This is caused by either selecting the icon for this script via the Inspector as in Figure 5 (as allways suggested e.g. in <a href="https://answers.unity.com/questions/32307/how-can-i-change-the-icon-of-a-script-within-the-p.html" rel="nofollow noreferrer">this post</a> or <a href="https://stackoverflow.com/questions/25343084/how-to-create-a-script-icon-in-unity3d">here</a> and even by <a href="https://docs.unity3d.com/Manual/AssigningIcons.html" rel="nofollow noreferrer">Unity - Assign Icons</a> ) or using <a href="https://docs.unity3d.com/ScriptReference/MonoBehaviour.OnDrawGizmos.html" rel="nofollow noreferrer">OnDrawGizmos</a> or <a href="https://docs.unity3d.com/ScriptReference/DrawGizmo-ctor.html" rel="nofollow noreferrer">DrawGizmo</a>. <strong>This is not happening using the approach I use currently with the <code>Gizmos</code> folder!</strong></p>
  
  <p><a href="https://i.stack.imgur.com/Uo8bH.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Uo8bH.jpg" alt="alt text"></a></p>
  
  <p><strong>Update</strong></p>
  
  <p>Because this was suggested in <a href="https://stackoverflow.com/a/55149774/7111561">this answer</a>: I also know that I could do that and turn them off via the <code>Gizmos</code> settings of the SceneView. <strong>But</strong> imagine I have like 25 different modules and various different icons each. I don't want to have to disable their Gizmos in the SceneView settings one by one on a per project basis! Even the provided script seems like a vast hackaround. Reflection would be the very last resort I would ever take. Also I'ld prefer to not even have those icons appear as possible Gizmos at all instead of disabling them all.</p>