diff --git a/Scripts/Controls/TextPic.cs b/Scripts/Controls/TextPic.cs index 8763f68..ec737ce 100644 --- a/Scripts/Controls/TextPic.cs +++ b/Scripts/Controls/TextPic.cs @@ -62,6 +62,13 @@ namespace UnityEngine.UI.Extensions { base.OnValidate(); UpdateQuadImage(); + for (int i = 0; i < inspectorIconList.Length; i++) + { + if (inspectorIconList[i].scale == Vector2.zero) + { + inspectorIconList[i].scale = Vector2.one; + } + } } #endif @@ -75,11 +82,12 @@ namespace UnityEngine.UI.Extensions { public string name; public Sprite sprite; + public Vector2 offset; + public Vector2 scale; } public IconName[] inspectorIconList; - private Dictionary iconList = new Dictionary(); - + [Tooltip("Global scaling factor for all images")] public float ImageScalingFactor = 1; // Write the name or hex value of the hyperlink color @@ -103,10 +111,7 @@ namespace UnityEngine.UI.Extensions private string previousText = ""; public bool isCreating_m_HrefInfos = true; - /** - * Unity Inspector cant display Dictionary vars, - * so we use this little hack to setup the iconList - */ + new void Start() { button = GetComponentInParent