static public GameTextNode CreateText(string text, Vector3 pos) { GameTextNode gtn = new GameTextNode(s_CloneTemplate); gtn.m_tfTxtNode.position = pos; gtn.text = text; return(gtn); }
static public GameTextNode CreateEmpty(Transform attachObj) { GameTextNode gtn = new GameTextNode(s_CloneTemplate); gtn.m_tfParent = attachObj; gtn.m_tfTxtNode.SetParent(attachObj, false); return(gtn); }
static public GameTextNode CreateText(string text, Transform attachObj) { for (int i = 0; i < s_listAttachObj.Count; i++) { if (s_listAttachObj[i] != null && s_listAttachObj[i].m_tfParent == attachObj) { s_listAttachObj[i].text = text; return(s_listAttachObj[i]); } } GameTextNode gtn = new GameTextNode(s_CloneTemplate); gtn.m_tfParent = attachObj; gtn.m_tfTxtNode.SetParent(attachObj, false); gtn.text = text; s_listAttachObj.Add(gtn); return(gtn); }