diff --git a/Scripts/Controls/TextPic.cs b/Scripts/Controls/TextPic.cs
index f03cf3f..641b8a0 100644
--- a/Scripts/Controls/TextPic.cs
+++ b/Scripts/Controls/TextPic.cs
@@ -10,421 +10,456 @@ using UnityEngine.EventSystems;
namespace UnityEngine.UI.Extensions
{
- // Image according to the label inside the name attribute to load, read from the Resources directory. The size of the image is controlled by the size property.
- // Use:
- [AddComponentMenu("UI/Extensions/TextPic")]
-
- [ExecuteInEditMode] // Needed for culling images that are not used //
- public class TextPic : Text, IPointerClickHandler, IPointerExitHandler, IPointerEnterHandler, ISelectHandler
- {
- ///
- /// Image Pool
- ///
- private readonly List m_ImagesPool = new List();
- private readonly List culled_ImagesPool = new List();
- private bool clearImages = false;
+ // Image according to the label inside the name attribute to load, read from the Resources directory. The size of the image is controlled by the size property.
+ // Use:
+ [AddComponentMenu("UI/Extensions/TextPic")]
- ///
- /// Vertex Index
- ///
- private readonly List m_ImagesVertexIndex = new List();
+ [ExecuteInEditMode] // Needed for culling images that are not used //
+ public class TextPic : Text, IPointerClickHandler, IPointerExitHandler, IPointerEnterHandler, ISelectHandler
+ {
+ ///
+ /// Image Pool
+ ///
+ private readonly List m_ImagesPool = new List();
+ private readonly List culled_ImagesPool = new List();
+ private bool clearImages = false;
- ///
- /// Regular expression to replace
- ///
- private static readonly Regex s_Regex =
- new Regex(@" ", RegexOptions.Singleline);
+ ///
+ /// Vertex Index
+ ///
+ private readonly List m_ImagesVertexIndex = new List();
- private string fixedString;
+ ///
+ /// Regular expression to replace
+ ///
+ private static readonly Regex s_Regex =
+ new Regex(@" ", RegexOptions.Singleline);
- public override void SetVerticesDirty()
- {
- base.SetVerticesDirty();
- UpdateQuadImage();
- }
+ private string fixedString;
-#if UNITY_EDITOR
- protected override void OnValidate()
- {
- base.OnValidate();
- UpdateQuadImage();
- }
-#endif
+ public override void SetVerticesDirty()
+ {
+ base.SetVerticesDirty();
+ UpdateQuadImage();
+ }
- ///
- /// After parsing the final text
- ///
- private string m_OutputText;
+ #if UNITY_EDITOR
+ protected override void OnValidate()
+ {
+ base.OnValidate();
+ UpdateQuadImage();
+ }
+ #endif
- [System.Serializable]
- public struct IconName
- {
- public string name;
- public Sprite sprite;
- }
- public IconName[] inspectorIconList;
+ ///
+ /// After parsing the final text
+ ///
+ private string m_OutputText;
- private Dictionary iconList = new Dictionary();
+ [System.Serializable]
+ public struct IconName
+ {
+ public string name;
+ public Sprite sprite;
+ }
+ public IconName[] inspectorIconList;
- public float ImageScalingFactor = 1;
+ private Dictionary iconList = new Dictionary();
- // Write the name or hex value of the hyperlink color
- public string hyperlinkColor = "blue";
+ public float ImageScalingFactor = 1;
- // Offset image by x, y
- [SerializeField]
- public Vector2 imageOffset = Vector2.zero;
+ // Write the name or hex value of the hyperlink color
+ public string hyperlinkColor = "blue";
- private Button button;
+ // Offset image by x, y
+ [SerializeField]
+ public Vector2 imageOffset = Vector2.zero;
- //Commented out as private and not used.. Yet?
- //private bool selected = false;
+ private Button button;
- private List positions = new List();
+ //Commented out as private and not used.. Yet?
+ //private bool selected = false;
- /**
+ private List positions = new List();
+
+ /**
* Unity Inspector cant display Dictionary vars,
* so we use this little hack to setup the iconList
*/
- new void Start()
- {
- button = GetComponent();
- if (inspectorIconList != null && inspectorIconList.Length > 0)
- {
- foreach (IconName icon in inspectorIconList)
- {
- // Debug.Log(icon.sprite.name);
- iconList.Add(icon.name, icon.sprite);
- }
- }
- }
+ new void Start()
+ {
+ button = GetComponent();
+ if (inspectorIconList != null && inspectorIconList.Length > 0)
+ {
+ foreach (IconName icon in inspectorIconList)
+ {
+ // Debug.Log(icon.sprite.name);
+ iconList.Add(icon.name, icon.sprite);
+ }
+ }
+ }
- protected void UpdateQuadImage()
- {
-#if UNITY_EDITOR
- if (UnityEditor.PrefabUtility.GetPrefabType(this) == UnityEditor.PrefabType.Prefab)
- {
- return;
- }
-#endif
- m_OutputText = GetOutputText();
- m_ImagesVertexIndex.Clear();
- foreach (Match match in s_Regex.Matches(m_OutputText))
- {
- var picIndex = match.Index;
- var endIndex = picIndex * 4 + 3;
- m_ImagesVertexIndex.Add(endIndex);
+ protected void UpdateQuadImage()
+ {
+ #if UNITY_EDITOR
+ if (UnityEditor.PrefabUtility.GetPrefabType(this) == UnityEditor.PrefabType.Prefab)
+ {
+ return;
+ }
+ #endif
+ m_OutputText = GetOutputText();
+ m_ImagesVertexIndex.Clear();
+ foreach (Match match in s_Regex.Matches(m_OutputText))
+ {
+ var picIndex = match.Index;
+ var endIndex = picIndex * 4 + 3;
+ m_ImagesVertexIndex.Add(endIndex);
- m_ImagesPool.RemoveAll(image => image == null);
- if (m_ImagesPool.Count == 0)
- {
- GetComponentsInChildren(m_ImagesPool);
- }
- if (m_ImagesVertexIndex.Count > m_ImagesPool.Count)
- {
- var resources = new DefaultControls.Resources();
- var go = DefaultControls.CreateImage(resources);
- go.layer = gameObject.layer;
- var rt = go.transform as RectTransform;
- if (rt)
- {
- rt.SetParent(rectTransform);
- rt.localPosition = Vector3.zero;
- rt.localRotation = Quaternion.identity;
- rt.localScale = Vector3.one;
- }
- m_ImagesPool.Add(go.GetComponent());
- }
+ m_ImagesPool.RemoveAll(image => image == null);
+ if (m_ImagesPool.Count == 0)
+ {
+ GetComponentsInChildren(m_ImagesPool);
+ }
+ if (m_ImagesVertexIndex.Count > m_ImagesPool.Count)
+ {
+ var resources = new DefaultControls.Resources();
+ var go = DefaultControls.CreateImage(resources);
+ go.layer = gameObject.layer;
+ var rt = go.transform as RectTransform;
+ if (rt)
+ {
+ rt.SetParent(rectTransform);
+ rt.localPosition = Vector3.zero;
+ rt.localRotation = Quaternion.identity;
+ rt.localScale = Vector3.one;
+ }
+ m_ImagesPool.Add(go.GetComponent());
+ }
- var spriteName = match.Groups[1].Value;
- //var size = float.Parse(match.Groups[2].Value);
- var img = m_ImagesPool[m_ImagesVertexIndex.Count - 1];
- if (img.sprite == null || img.sprite.name != spriteName)
- {
- // img.sprite = Resources.Load(spriteName);
- if (inspectorIconList != null && inspectorIconList.Length > 0)
- {
- foreach (IconName icon in inspectorIconList)
- {
- if (icon.name == spriteName)
- {
- img.sprite = icon.sprite;
- break;
- }
- }
- }
- }
- img.rectTransform.sizeDelta = new Vector2(fontSize * ImageScalingFactor, fontSize * ImageScalingFactor);
- img.enabled = true;
- if (positions.Count == m_ImagesPool.Count)
- {
- img.rectTransform.anchoredPosition = positions[m_ImagesVertexIndex.Count - 1];
- }
- }
+ var spriteName = match.Groups[1].Value;
+ //var size = float.Parse(match.Groups[2].Value);
+ var img = m_ImagesPool[m_ImagesVertexIndex.Count - 1];
+ if (img.sprite == null || img.sprite.name != spriteName)
+ {
+ // img.sprite = Resources.Load(spriteName);
+ if (inspectorIconList != null && inspectorIconList.Length > 0)
+ {
+ foreach (IconName icon in inspectorIconList)
+ {
+ if (icon.name == spriteName)
+ {
+ img.sprite = icon.sprite;
+ break;
+ }
+ }
+ }
+ }
+ img.rectTransform.sizeDelta = new Vector2(fontSize * ImageScalingFactor, fontSize * ImageScalingFactor);
+ img.enabled = true;
+ if (positions.Count == m_ImagesPool.Count)
+ {
+ img.rectTransform.anchoredPosition = positions[m_ImagesVertexIndex.Count - 1];
+ }
+ }
- for (var i = m_ImagesVertexIndex.Count; i < m_ImagesPool.Count; i++)
- {
- if (m_ImagesPool[i])
- {
- /* TEMPORARY FIX REMOVE IMAGES FROM POOL DELETE LATER SINCE CANNOT DESTROY */
- // m_ImagesPool[i].enabled = false;
- m_ImagesPool[i].gameObject.SetActive(false);
- m_ImagesPool[i].gameObject.hideFlags = HideFlags.HideAndDontSave;
- culled_ImagesPool.Add(m_ImagesPool[i].gameObject);
- m_ImagesPool.Remove(m_ImagesPool[i]);
- }
- }
- if (culled_ImagesPool.Count > 1) {
- clearImages = true;
- }
- }
+ for (var i = m_ImagesVertexIndex.Count; i < m_ImagesPool.Count; i++)
+ {
+ if (m_ImagesPool[i])
+ {
+ /* TEMPORARY FIX REMOVE IMAGES FROM POOL DELETE LATER SINCE CANNOT DESTROY */
+ // m_ImagesPool[i].enabled = false;
+ m_ImagesPool[i].gameObject.SetActive(false);
+ m_ImagesPool[i].gameObject.hideFlags = HideFlags.HideAndDontSave;
+ culled_ImagesPool.Add(m_ImagesPool[i].gameObject);
+ m_ImagesPool.Remove(m_ImagesPool[i]);
+ }
+ }
+ if (culled_ImagesPool.Count > 1) {
+ clearImages = true;
+ }
+ }
- protected override void OnPopulateMesh(VertexHelper toFill)
- {
- var orignText = m_Text;
- m_Text = m_OutputText;
- base.OnPopulateMesh(toFill);
- m_Text = orignText;
- positions.Clear();
+ protected override void OnPopulateMesh(VertexHelper toFill)
+ {
+ var orignText = m_Text;
+ m_Text = m_OutputText;
+ base.OnPopulateMesh(toFill);
+ m_Text = orignText;
+ positions.Clear();
- UIVertex vert = new UIVertex();
- for (var i = 0; i < m_ImagesVertexIndex.Count; i++)
- {
- var endIndex = m_ImagesVertexIndex[i];
- var rt = m_ImagesPool[i].rectTransform;
- var size = rt.sizeDelta;
- if (endIndex < toFill.currentVertCount)
- {
- toFill.PopulateUIVertex(ref vert, endIndex);
- positions.Add(new Vector2((vert.position.x + size.x / 2), (vert.position.y + size.y / 2)) + imageOffset);
+ UIVertex vert = new UIVertex();
+ for (var i = 0; i < m_ImagesVertexIndex.Count; i++)
+ {
+ var endIndex = m_ImagesVertexIndex[i];
+ var rt = m_ImagesPool[i].rectTransform;
+ var size = rt.sizeDelta;
+ if (endIndex < toFill.currentVertCount)
+ {
+ toFill.PopulateUIVertex(ref vert, endIndex);
+ positions.Add(new Vector2((vert.position.x + size.x / 2), (vert.position.y + size.y / 2)) + imageOffset);
- // Erase the lower left corner of the black specks
- toFill.PopulateUIVertex(ref vert, endIndex - 3);
- var pos = vert.position;
- for (int j = endIndex, m = endIndex - 3; j > m; j--)
- {
- toFill.PopulateUIVertex(ref vert, endIndex);
- vert.position = pos;
- toFill.SetUIVertex(vert, j);
- }
- }
- }
+ // Erase the lower left corner of the black specks
+ toFill.PopulateUIVertex(ref vert, endIndex - 3);
+ var pos = vert.position;
+ for (int j = endIndex, m = endIndex - 3; j > m; j--)
+ {
+ toFill.PopulateUIVertex(ref vert, endIndex);
+ vert.position = pos;
+ toFill.SetUIVertex(vert, j);
+ }
+ }
+ }
- if (m_ImagesVertexIndex.Count != 0)
- {
- m_ImagesVertexIndex.Clear();
- }
+ if (m_ImagesVertexIndex.Count != 0)
+ {
+ m_ImagesVertexIndex.Clear();
+ }
- // Hyperlinks surround processing box
- foreach (var hrefInfo in m_HrefInfos)
- {
- hrefInfo.boxes.Clear();
- if (hrefInfo.startIndex >= toFill.currentVertCount)
- {
- continue;
- }
+ // Hyperlinks surround processing box
+ foreach (var hrefInfo in m_HrefInfos)
+ {
+ hrefInfo.boxes.Clear();
+ if (hrefInfo.startIndex >= toFill.currentVertCount)
+ {
+ continue;
+ }
- // Hyperlink inside the text is added to surround the vertex index coordinate frame
- toFill.PopulateUIVertex(ref vert, hrefInfo.startIndex);
- var pos = vert.position;
- var bounds = new Bounds(pos, Vector3.zero);
- for (int i = hrefInfo.startIndex, m = hrefInfo.endIndex; i < m; i++)
- {
- if (i >= toFill.currentVertCount)
- {
- break;
- }
+ // Hyperlink inside the text is added to surround the vertex index coordinate frame
+ toFill.PopulateUIVertex(ref vert, hrefInfo.startIndex);
+ var pos = vert.position;
+ var bounds = new Bounds(pos, Vector3.zero);
+ for (int i = hrefInfo.startIndex, m = hrefInfo.endIndex; i < m; i++)
+ {
+ if (i >= toFill.currentVertCount)
+ {
+ break;
+ }
- toFill.PopulateUIVertex(ref vert, i);
- pos = vert.position;
- if (pos.x < bounds.min.x) // Wrap re-add surround frame
- {
- hrefInfo.boxes.Add(new Rect(bounds.min, bounds.size));
- bounds = new Bounds(pos, Vector3.zero);
- }
- else
- {
- bounds.Encapsulate(pos); // Extended enclosed box
- }
- }
- hrefInfo.boxes.Add(new Rect(bounds.min, bounds.size));
- }
- UpdateQuadImage();
- }
+ toFill.PopulateUIVertex(ref vert, i);
+ pos = vert.position;
+ if (pos.x < bounds.min.x) // Wrap re-add surround frame
+ {
+ hrefInfo.boxes.Add(new Rect(bounds.min, bounds.size));
+ bounds = new Bounds(pos, Vector3.zero);
+ }
+ else
+ {
+ bounds.Encapsulate(pos); // Extended enclosed box
+ }
+ }
+ hrefInfo.boxes.Add(new Rect(bounds.min, bounds.size));
- ///
- /// Hyperlink List
- ///
- private readonly List m_HrefInfos = new List();
+ }
- ///
- /// Text Builder
- ///
- private static readonly StringBuilder s_TextBuilder = new StringBuilder();
- ///
- /// Hyperlink Regular Expression
- ///
- private static readonly Regex s_HrefRegex =
- new Regex(@"\n\s]+)>(.*?)( )", RegexOptions.Singleline);
+ UpdateQuadImage();
- [Serializable]
- public class HrefClickEvent : UnityEvent { }
+ }
- [SerializeField]
- private HrefClickEvent m_OnHrefClick = new HrefClickEvent();
+ ///
+ /// Hyperlink List
+ ///
+ private readonly List m_HrefInfos = new List();
- ///
- /// Hyperlink Click Event
- ///
- public HrefClickEvent onHrefClick
- {
- get { return m_OnHrefClick; }
- set { m_OnHrefClick = value; }
- }
+ ///
+ /// Text Builder
+ ///
+ private static readonly StringBuilder s_TextBuilder = new StringBuilder();
- ///
- /// Finally, the output text hyperlinks get parsed
- ///
- ///
- protected string GetOutputText()
- {
- s_TextBuilder.Length = 0;
- m_HrefInfos.Clear();
- var indexText = 0;
- fixedString = this.text;
- if (inspectorIconList != null && inspectorIconList.Length > 0)
- {
- foreach (IconName icon in inspectorIconList)
- {
- if (icon.name != null && icon.name != "")
- {
- fixedString = fixedString.Replace(icon.name, " ");
- }
- }
- }
- foreach (Match match in s_HrefRegex.Matches(fixedString))
- {
- s_TextBuilder.Append(fixedString.Substring(indexText, match.Index - indexText));
- s_TextBuilder.Append(""); // Hyperlink color
+ ///
+ /// Hyperlink Regular Expression
+ ///
+ private static readonly Regex s_HrefRegex =
+ new Regex(@"\n\s]+)>(.*?)( )", RegexOptions.Singleline);
- var group = match.Groups[1];
- var hrefInfo = new HrefInfo
- {
- startIndex = s_TextBuilder.Length * 4, // Hyperlinks in text starting vertex indices
- endIndex = (s_TextBuilder.Length + match.Groups[2].Length - 1) * 4 + 3,
- name = group.Value
- };
- m_HrefInfos.Add(hrefInfo);
+ [Serializable]
+ public class HrefClickEvent : UnityEvent { }
- s_TextBuilder.Append(match.Groups[2].Value);
- s_TextBuilder.Append(" ");
- indexText = match.Index + match.Length;
- }
- s_TextBuilder.Append(fixedString.Substring(indexText, fixedString.Length - indexText));
+ [SerializeField]
+ private HrefClickEvent m_OnHrefClick = new HrefClickEvent();
- return s_TextBuilder.ToString();
- }
+ ///
+ /// Hyperlink Click Event
+ ///
+ public HrefClickEvent onHrefClick
+ {
+ get { return m_OnHrefClick; }
+ set { m_OnHrefClick = value; }
+ }
- ///
- /// Click event is detected whether to click a hyperlink text
- ///
- ///
- public void OnPointerClick(PointerEventData eventData)
- {
- Vector2 lp;
- RectTransformUtility.ScreenPointToLocalPointInRectangle(
- rectTransform, eventData.position, eventData.pressEventCamera, out lp);
+ ///
+ /// Finally, the output text hyperlinks get parsed
+ ///
+ ///
+ protected string GetOutputText()
+ {
+ s_TextBuilder.Length = 0;
+ // This also clears the list of boxes in m_HrefInfos created by OnPopulateMesh function, without boxes href wont work, so i commented this
+ //m_HrefInfos.Clear();
+ var indexText = 0;
+ fixedString = this.text;
+ if (inspectorIconList != null && inspectorIconList.Length > 0)
+ {
+ foreach (IconName icon in inspectorIconList)
+ {
+ if (icon.name != null && icon.name != "")
+ {
+ fixedString = fixedString.Replace(icon.name, " ");
+ }
+ }
+ }
+ foreach (Match match in s_HrefRegex.Matches(fixedString))
+ {
+ s_TextBuilder.Append(fixedString.Substring(indexText, match.Index - indexText));
+ s_TextBuilder.Append(""); // Hyperlink color
- foreach (var hrefInfo in m_HrefInfos)
- {
- var boxes = hrefInfo.boxes;
- for (var i = 0; i < boxes.Count; ++i)
- {
- if (boxes[i].Contains(lp))
- {
- m_OnHrefClick.Invoke(hrefInfo.name);
- return;
- }
- }
- }
- }
+ var group = match.Groups[1];
+ int foundAtIndex = -1;
- public void OnPointerEnter(PointerEventData eventData)
- {
- //do your stuff when highlighted
- //selected = true;
- if (m_ImagesPool.Count >= 1)
- {
- foreach (Image img in m_ImagesPool)
- {
- if (button != null && button.isActiveAndEnabled)
- {
- img.color = button.colors.highlightedColor;
- }
- }
- }
- }
+ if(HrefInfosDoesExists(group.Value,out foundAtIndex)) {
+ m_HrefInfos[foundAtIndex].startIndex = s_TextBuilder.Length * 4; // Hyperlinks in text starting vertex indices;
+ m_HrefInfos[foundAtIndex].endIndex = (s_TextBuilder.Length + match.Groups[2].Length - 1) * 4 + 3;
- public void OnPointerExit(PointerEventData eventData)
- {
+ } else {
+ var hrefInfo = new HrefInfo
+ {
+ startIndex = s_TextBuilder.Length * 4, // Hyperlinks in text starting vertex indices
+ endIndex = (s_TextBuilder.Length + match.Groups[2].Length - 1) * 4 + 3,
+ name = group.Value
+ };
+ m_HrefInfos.Add(hrefInfo);
+ }
- //do your stuff when highlighted
- //selected = false;
- if (m_ImagesPool.Count >= 1)
- {
- foreach (Image img in m_ImagesPool)
- {
- if (button != null && button.isActiveAndEnabled)
- {
- img.color = button.colors.normalColor;
- }
- else
- {
- img.color = color;
- }
- }
- }
- }
- public void OnSelect(BaseEventData eventData)
- {
- //do your stuff when selected
- //selected = true;
- if (m_ImagesPool.Count >= 1)
- {
- foreach (Image img in m_ImagesPool)
- {
- if (button != null && button.isActiveAndEnabled)
- {
- img.color = button.colors.highlightedColor;
- }
- }
- }
- }
+ s_TextBuilder.Append(match.Groups[2].Value);
+ s_TextBuilder.Append(" ");
+ indexText = match.Index + match.Length;
+ }
+ s_TextBuilder.Append(fixedString.Substring(indexText, fixedString.Length - indexText));
- ///
- /// Hyperlinks Info
- ///
- private class HrefInfo
- {
- public int startIndex;
+ return s_TextBuilder.ToString();
+ }
- public int endIndex;
+ ///
+ /// If Href exists than just modify its startIndex and endIndex, dont clear the whole array of m_HrefInfos which also clears the previously created boxes for href.
+ ///
+ /// true , if hrefName already exists in the list of m_HrefInfos, false otherwise.
+ /// Href name.
+ /// Index at.
+ private bool HrefInfosDoesExists(string hrefName, out int indexAt) {
+ bool flag = false;
+ int foundAtIndex = -1;
+ foreach(var hrefInfoTest in m_HrefInfos){
+ if(hrefInfoTest.name == hrefName) {
+ foundAtIndex++;
+ flag = true;
+ break;
+ } else {
+ foundAtIndex++;
+ }
+ }
+ indexAt = foundAtIndex;
+ return flag;
+ }
- public string name;
+ ///
+ /// Click event is detected whether to click a hyperlink text
+ ///
+ ///
+ public void OnPointerClick(PointerEventData eventData)
+ {
+ Vector2 lp;
+ RectTransformUtility.ScreenPointToLocalPointInRectangle(
+ rectTransform, eventData.position, eventData.pressEventCamera, out lp);
- public readonly List boxes = new List();
- }
-
- /* TEMPORARY FIX REMOVE IMAGES FROM POOL DELETE LATER SINCE CANNOT DESTROY */
- void Update() {
- if (clearImages) {
- for (int i = 0; i < culled_ImagesPool.Count; i++){
- DestroyImmediate(culled_ImagesPool[i]);
- }
- culled_ImagesPool.Clear();
- clearImages = false;
- }
- }
- }
+ foreach (var hrefInfo in m_HrefInfos)
+ {
+ var boxes = hrefInfo.boxes;
+ for (var i = 0; i < boxes.Count; ++i)
+ {
+ if (boxes[i].Contains(lp))
+ {
+ m_OnHrefClick.Invoke(hrefInfo.name);
+ return;
+ }
+ }
+ }
+ }
+
+ public void OnPointerEnter(PointerEventData eventData)
+ {
+ //do your stuff when highlighted
+ //selected = true;
+ if (m_ImagesPool.Count >= 1)
+ {
+ foreach (Image img in m_ImagesPool)
+ {
+ if (button != null && button.isActiveAndEnabled)
+ {
+ img.color = button.colors.highlightedColor;
+ }
+ }
+ }
+ }
+
+ public void OnPointerExit(PointerEventData eventData)
+ {
+
+ //do your stuff when highlighted
+ //selected = false;
+ if (m_ImagesPool.Count >= 1)
+ {
+ foreach (Image img in m_ImagesPool)
+ {
+ if (button != null && button.isActiveAndEnabled)
+ {
+ img.color = button.colors.normalColor;
+ }
+ else
+ {
+ img.color = color;
+ }
+ }
+ }
+ }
+ public void OnSelect(BaseEventData eventData)
+ {
+ //do your stuff when selected
+ //selected = true;
+ if (m_ImagesPool.Count >= 1)
+ {
+ foreach (Image img in m_ImagesPool)
+ {
+ if (button != null && button.isActiveAndEnabled)
+ {
+ img.color = button.colors.highlightedColor;
+ }
+ }
+ }
+ }
+
+ ///
+ /// Hyperlinks Info
+ ///
+ private class HrefInfo
+ {
+ public int startIndex;
+
+ public int endIndex;
+
+ public string name;
+
+ public readonly List boxes = new List();
+ }
+
+ /* TEMPORARY FIX REMOVE IMAGES FROM POOL DELETE LATER SINCE CANNOT DESTROY */
+ void Update() {
+ if (clearImages) {
+ for (int i = 0; i < culled_ImagesPool.Count; i++){
+ DestroyImmediate(culled_ImagesPool[i]);
+ }
+ culled_ImagesPool.Clear();
+ clearImages = false;
+ }
+ }
+ }
}
\ No newline at end of file