@@ -12,14 +12,7 @@ static class HierarchyListener
1212 {
1313 static HierarchyListener ( )
1414 {
15- // The inspector icon for ProBuilderMesh is set in the component metadata. However, this also serves as the
16- // scene view gizmo icon, which we do not want. To avoid drawing an icon for every mesh in the Scene View,
17- // we simply tell the AnnotationManager to not render the icon. This _does_ put ProBuilderMesh in the
18- // "Recently Changed" list, but only when it is modified the first time.
19- // The alternative method of setting an icon is to place it in a folder named "Editor Default Resources/Icons",
20- // however that requires that the resources directory be in "Assets", which we do not want to do.
21- EditorUtility . SetGizmoIconEnabled ( typeof ( ProBuilderMesh ) , false ) ;
22-
15+ AssemblyReloadEvents . afterAssemblyReload += OnAfterAssemblyReload ;
2316 // When a prefab is updated, this is raised. For some reason it's
2417 // called twice?
2518 EditorApplication . hierarchyChanged += HierarchyWindowChanged ;
@@ -29,6 +22,17 @@ static HierarchyListener()
2922 PrefabUtility . prefabInstanceUpdated += PrefabInstanceUpdated ;
3023 }
3124
25+ static void OnAfterAssemblyReload ( )
26+ {
27+ // The inspector icon for ProBuilderMesh is set in the component metadata. However, this also serves as the
28+ // scene view gizmo icon, which we do not want. To avoid drawing an icon for every mesh in the Scene View,
29+ // we simply tell the AnnotationManager to not render the icon. This _does_ put ProBuilderMesh in the
30+ // "Recently Changed" list, but only when it is modified the first time.
31+ // The alternative method of setting an icon is to place it in a folder named "Editor Default Resources/Icons",
32+ // however that requires that the resources directory be in "Assets", which we do not want to do.
33+ EditorApplication . delayCall += ( ) => EditorUtility . SetGizmoIconEnabled ( typeof ( ProBuilderMesh ) , false ) ;
34+ }
35+
3236 static void PrefabInstanceUpdated ( GameObject go )
3337 {
3438 if ( EditorApplication . isPlayingOrWillChangePlaymode )
0 commit comments