@@ -14,13 +14,7 @@ namespace Lachee.Utilities.Editor
14
14
public class RandomListDrawerStyle
15
15
{
16
16
/// <summary>Dictionary lookup for custom drawers for the slider labels</summary>
17
- public Dictionary < Type , IRistBoxLabelDrawer > Drawers = new Dictionary < Type , IRistBoxLabelDrawer > ( )
18
- {
19
- { typeof ( void ) , new BasicRistDrawer ( ) } ,
20
- { typeof ( Color ) , new ColorRistDrawer ( ) } ,
21
- { typeof ( AnimationCurve ) , new AnimationCurveRistDrawer ( ) } ,
22
- { typeof ( Sprite ) , new SpriteRistDrawer ( ) } ,
23
- } ;
17
+ public Dictionary < Type , IRistBoxLabelDrawer > Drawers ;
24
18
25
19
public readonly Color [ ] Colors =
26
20
{
@@ -43,6 +37,23 @@ public class RandomListDrawerStyle
43
37
public readonly GUIStyle listPreButton = "RL FooterButton" ;
44
38
public readonly GUIContent listIconToolbarMinus = EditorGUIUtility . TrIconContent ( "Toolbar Minus" , "Remove selection from the list" ) ;
45
39
public readonly GUIContent listIconToolbarPlus = EditorGUIUtility . TrIconContent ( "Toolbar Plus" , "Add to the list" ) ;
40
+
41
+ public RandomListDrawerStyle ( )
42
+ {
43
+ SpriteRistDrawer spriteRistDrawer = new SpriteRistDrawer ( ) ;
44
+
45
+ Drawers = new Dictionary < Type , IRistBoxLabelDrawer > ( )
46
+ {
47
+ { typeof ( void ) , new BasicRistDrawer ( ) } ,
48
+ { typeof ( Color ) , new ColorRistDrawer ( ) } ,
49
+ { typeof ( AnimationCurve ) , new AnimationCurveRistDrawer ( ) } ,
50
+
51
+ // They all reference the same object for efficiency
52
+ { typeof ( Sprite ) , spriteRistDrawer } ,
53
+ { typeof ( Texture ) , spriteRistDrawer } ,
54
+ { typeof ( Texture2D ) , spriteRistDrawer } ,
55
+ } ;
56
+ }
46
57
}
47
58
48
59
/// <summary>Interface used to draw labels on weight sliders</summary>
0 commit comments