From c98e5060a2d4d90942c7229f0918c868c1bfb681 Mon Sep 17 00:00:00 2001 From: metalimangal <31962950+metalimangal@users.noreply.github.com> Date: Fri, 8 Jan 2021 18:18:07 +0530 Subject: [PATCH] Update UnityNode.cs Added changes for getting the text for TMP_text and TextMeshProUGUI --- Unity3D/ugui/UnityNode.cs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/Unity3D/ugui/UnityNode.cs b/Unity3D/ugui/UnityNode.cs index b51212a..694cfc3 100644 --- a/Unity3D/ugui/UnityNode.cs +++ b/Unity3D/ugui/UnityNode.cs @@ -26,6 +26,8 @@ public class UnityNode : AbstractNode { "Selectable", "Selectable" }, { "Camera", "Camera" }, { "RectTransform", "Node" }, + { "TextMeshProUGUI","TMPROUGUI" }, + { "TMP_Text","TMPRO" }, }; public static string DefaultTypeName = "GameObject"; private GameObject gameObject; @@ -212,8 +214,13 @@ private bool GameObjectClickable(List components) private string GameObjectText() { + TMP_Text tmpText = gameObject.GetComponent(); + if (tmpText) return tmpText.GetParsedText(); + TextMeshProUGUI tmpUIText = gameObject.GetComponent(); + if (tmpUIText) return tmpUIText.GetParsedText(); Text text = gameObject.GetComponent(); - return text ? text.text : null; + if (text) return text.text; + return null; } private string GameObjectTag()