@@ -27,7 +27,7 @@ public class AssetFilterEditor : EditorWindow
27
27
[ MenuItem ( "Tools/Assets Management/Asset Filter" ) ]
28
28
private static void OpenWindow ( )
29
29
{
30
- GetWindow < AssetFilterEditor > ( true , "Asset Filter Editor" , true ) . ShowModalUtility ( ) ;
30
+ GetWindow < AssetFilterEditor > ( true , "Asset Filter Editor" , true ) ;
31
31
}
32
32
33
33
public static List < string > GetAssetFilters ( )
@@ -47,6 +47,8 @@ public static List<string> GetAssetFilters()
47
47
}
48
48
else
49
49
{
50
+ AutomaticRefresh ( ) ;
51
+
50
52
_config = new JsonData ( ) ;
51
53
_config . SetJsonType ( JsonType . Array ) ;
52
54
}
@@ -84,16 +86,42 @@ private void SetReorderableList()
84
86
_showAddItemWindow = true ;
85
87
86
88
} ;
87
-
88
89
//_labelReorderableList.drawElementBackgroundCallback = (rect, index, isActive, isFocused) => { };
89
90
//_labelReorderableList.elementHeightCallback = (index) => { return 80.0f; };
90
91
}
91
92
93
+ private static void AutomaticRefresh ( )
94
+ {
95
+ var assemblies = System . AppDomain . CurrentDomain . GetAssemblies ( ) ;
96
+ foreach ( var item in assemblies )
97
+ {
98
+ foreach ( var itemType in item . GetTypes ( ) )
99
+ {
100
+ if ( ! string . IsNullOrEmpty ( itemType . Namespace ) )
101
+ {
102
+ if ( itemType . Namespace . Contains ( "UnityEditor" ) )
103
+ {
104
+ continue ;
105
+ }
106
+ }
107
+ if ( itemType . BaseType == typeof ( ScriptableObject ) )
108
+ {
109
+ string labelName = itemType . Name ;
110
+ if ( ! _listLabels . Contains ( labelName ) )
111
+ _listLabels . Add ( labelName ) ;
112
+ }
113
+ }
114
+ }
115
+ }
92
116
93
117
private void OnGUI ( )
94
118
{
95
119
if ( _config == null )
96
120
return ;
121
+ if ( GUILayout . Button ( "Automatic refresh of system type" ) )
122
+ {
123
+ AutomaticRefresh ( ) ;
124
+ }
97
125
_scrollView = EditorGUILayout . BeginScrollView ( _scrollView ) ;
98
126
//GUILayout.BeginVertical("HelpBox");
99
127
_labelReorderableList ? . DoLayoutList ( ) ;
@@ -137,7 +165,7 @@ private void OnGUI()
137
165
138
166
}
139
167
}
140
-
168
+
141
169
//GUILayout.EndVertical();
142
170
EditorGUILayout . EndScrollView ( ) ;
143
171
}
0 commit comments