File tree Expand file tree Collapse file tree 1 file changed +30
-0
lines changed Expand file tree Collapse file tree 1 file changed +30
-0
lines changed Original file line number Diff line number Diff line change @@ -5,6 +5,7 @@ namespace TNRD
55{
66 internal static class IconUtility
77 {
8+ #if UNITY_2021_1_OR_NEWER
89 private static Texture2D folderIcon ;
910
1011 public static Texture2D FolderIcon
@@ -54,5 +55,34 @@ public static Texture2D GetIconForObject(Object obj)
5455 {
5556 return EditorGUIUtility . GetIconForObject ( obj ) ;
5657 }
58+ #else
59+ // "Fix" for 2020 as the icons are 256x256 in size and the AdvancedDropDown fills the space as much as it can
60+ public static Texture2D FolderIcon => null ;
61+
62+ private static Texture2D scriptIcon ;
63+
64+ public static Texture2D ScriptIcon
65+ {
66+ get
67+ {
68+ if ( scriptIcon == null )
69+ scriptIcon = ( Texture2D ) EditorGUIUtility . IconContent ( "cs Script Icon" ) . image ;
70+
71+ return scriptIcon ;
72+ }
73+ }
74+
75+ public static Texture2D GameObjectIcon => null ;
76+
77+ public static Texture2D GetIconForObject ( string path )
78+ {
79+ return null ;
80+ }
81+
82+ public static Texture2D GetIconForObject ( Object obj )
83+ {
84+ return null ;
85+ }
86+ #endif
5787 }
5888}
You can’t perform that action at this time.
0 commit comments