diff --git a/Editor/Utilities/RandomListDrawer.cs b/Editor/Utilities/RandomListDrawer.cs index 5535034..0282b74 100644 --- a/Editor/Utilities/RandomListDrawer.cs +++ b/Editor/Utilities/RandomListDrawer.cs @@ -14,13 +14,7 @@ namespace Lachee.Utilities.Editor public class RandomListDrawerStyle { /// Dictionary lookup for custom drawers for the slider labels - public Dictionary Drawers = new Dictionary() - { - { typeof(void), new BasicRistDrawer() }, - { typeof(Color), new ColorRistDrawer() }, - { typeof(AnimationCurve), new AnimationCurveRistDrawer() }, - { typeof(Sprite), new SpriteRistDrawer() }, - }; + public Dictionary Drawers; public readonly Color[] Colors = { @@ -43,6 +37,23 @@ public class RandomListDrawerStyle public readonly GUIStyle listPreButton = "RL FooterButton"; public readonly GUIContent listIconToolbarMinus = EditorGUIUtility.TrIconContent("Toolbar Minus", "Remove selection from the list"); public readonly GUIContent listIconToolbarPlus = EditorGUIUtility.TrIconContent("Toolbar Plus", "Add to the list"); + + public RandomListDrawerStyle() + { + SpriteRistDrawer spriteRistDrawer = new SpriteRistDrawer(); + + Drawers = new Dictionary() + { + { typeof(void), new BasicRistDrawer() }, + { typeof(Color), new ColorRistDrawer() }, + { typeof(AnimationCurve), new AnimationCurveRistDrawer() }, + + // They all reference the same object for efficiency + { typeof(Sprite), spriteRistDrawer }, + { typeof(Texture), spriteRistDrawer }, + { typeof(Texture2D), spriteRistDrawer }, + }; + } } /// Interface used to draw labels on weight sliders diff --git a/package.json b/package.json index 26469ac..b772e0a 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "com.lachee.utilities", - "version": "1.3.5", + "version": "1.3.6", "displayName": "Lachee's Utilities", "description": "Bunch of utility functionality", "unity": "2019.1",