@@ -40,8 +40,8 @@ public class HierarchyFolderIcon
4040 private static MethodInfo meth_isExpanded ;
4141 private static MethodInfo meth_getAllSceneHierarchyWindows ;
4242
43- private static ( Texture2D , Texture2D ) [ ] _coloredFolderIcons ;
44- public static ( Texture2D , Texture2D ) [ ] coloredFolderIcons => _coloredFolderIcons ;
43+ private static ( Texture2D open , Texture2D closed ) [ ] _coloredFolderIcons ;
44+ public static ( Texture2D open , Texture2D closed ) ColoredFolderIcons ( int i ) => _coloredFolderIcons [ i ] ;
4545
4646 public static int IconColumnCount => IconColors . GetLength ( 0 ) ;
4747 public static int IconRowCount => IconColors . GetLength ( 1 ) ;
@@ -202,13 +202,10 @@ private static void RefreshFolderIcons(int instanceid, Rect selectionrect)
202202 var itemObject = ( Object ) prop_objectPPTR . GetValue ( item ) ;
203203 if ( ! Folder . TryGetIconIndex ( itemObject , out int colorIndex ) ) { continue ; }
204204
205-
206205 var isExpanded = ( bool ) meth_isExpanded . Invoke ( data , new object [ ] { item } ) ;
207206
208- Texture2D open , closed ;
209- var count = _coloredFolderIcons . Length ;
210- ( open , closed ) = coloredFolderIcons [ Mathf . Clamp ( colorIndex , 0 , count ) % count ] ;
211- item . icon = isExpanded ? open : closed ;
207+ var icons = ColoredFolderIcons ( Mathf . Clamp ( colorIndex , 0 , _coloredFolderIcons . Length - 1 ) ) ;
208+ item . icon = isExpanded ? icons . open : icons . closed ;
212209
213210 prop_selectedIcon . SetValue ( item , isExpanded ? openFolderSelectedTexture : closedFolderSelectedTexture ) ;
214211 }
0 commit comments