File tree Expand file tree Collapse file tree 1 file changed +5
-10
lines changed Expand file tree Collapse file tree 1 file changed +5
-10
lines changed Original file line number Diff line number Diff line change @@ -31,18 +31,13 @@ public AdvancedDropdownItem Build()
3131 AdvancedDropdownItem root = new AdvancedDropdownItem ( "Assets" ) ;
3232 splitToItem . Add ( "Assets/" , root ) ; // Needs the trailing slash to be recognized later on
3333
34- TypeCache . TypeCollection types = TypeCache . GetTypesDerivedFrom ( interfaceType ) ;
35- foreach ( Type type in types )
34+ string [ ] allAssetPaths = AssetDatabase . GetAllAssetPaths ( ) ;
35+ foreach ( string assetPath in allAssetPaths )
3636 {
37- if ( type . IsAbstract || type . IsInterface ) continue ;
38- if ( ! type . IsSubclassOf ( typeof ( Object ) ) ) continue ;
39-
40- IEnumerable < string > paths = AssetDatabase . FindAssets ( $ "t:{ type . Name } ")
41- . Select ( AssetDatabase . GUIDToAssetPath ) ;
42-
43- foreach ( string path in paths )
37+ Type assetType = AssetDatabase . GetMainAssetTypeAtPath ( assetPath ) ;
38+ if ( interfaceType . IsAssignableFrom ( assetType ) )
4439 {
45- CreateItemForPath ( root , path ) ;
40+ CreateItemForPath ( root , assetPath ) ;
4641 }
4742 }
4843
You can’t perform that action at this time.
0 commit comments