@@ -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 #if UNITY_2018_1_OR_NEWER
@@ -33,6 +26,17 @@ static HierarchyListener()
3326 PrefabUtility . prefabInstanceUpdated += PrefabInstanceUpdated ;
3427 }
3528
29+ static void OnAfterAssemblyReload ( )
30+ {
31+ // The inspector icon for ProBuilderMesh is set in the component metadata. However, this also serves as the
32+ // scene view gizmo icon, which we do not want. To avoid drawing an icon for every mesh in the Scene View,
33+ // we simply tell the AnnotationManager to not render the icon. This _does_ put ProBuilderMesh in the
34+ // "Recently Changed" list, but only when it is modified the first time.
35+ // The alternative method of setting an icon is to place it in a folder named "Editor Default Resources/Icons",
36+ // however that requires that the resources directory be in "Assets", which we do not want to do.
37+ EditorApplication . delayCall += ( ) => EditorUtility . SetGizmoIconEnabled ( typeof ( ProBuilderMesh ) , false ) ;
38+ }
39+
3640 static void PrefabInstanceUpdated ( GameObject go )
3741 {
3842 if ( EditorApplication . isPlayingOrWillChangePlaymode )
0 commit comments