From 4ede5c9576f89def48c13d921bc262090d0f3a79 Mon Sep 17 00:00:00 2001 From: playemgames Date: Fri, 29 Jul 2016 19:43:04 +0000 Subject: [PATCH] Added OnValidate and UpdateQuadImage(); to OnPopulateMesh(); to position the images correctly on text input. --HG-- branch : playemgames/added-onvalidate-and-updatequadimage-to--1469821382746 --- Scripts/Controls/TextPic.cs | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/Scripts/Controls/TextPic.cs b/Scripts/Controls/TextPic.cs index f43fbed..4988f23 100644 --- a/Scripts/Controls/TextPic.cs +++ b/Scripts/Controls/TextPic.cs @@ -39,6 +39,14 @@ namespace UnityEngine.UI.Extensions UpdateQuadImage(); } +#if UNITY_EDITOR + protected override void OnValidate() + { + base.OnValidate(); + UpdateQuadImage(); + } +#endif + /// /// After parsing the final text /// @@ -81,7 +89,7 @@ namespace UnityEngine.UI.Extensions { foreach (IconName icon in inspectorIconList) { - Debug.Log(icon.sprite.name); + // Debug.Log(icon.sprite.name); iconList.Add(icon.name, icon.sprite); } } @@ -229,6 +237,7 @@ namespace UnityEngine.UI.Extensions } hrefInfo.boxes.Add(new Rect(bounds.min, bounds.size)); } + UpdateQuadImage(); } ///