| | |
| | | unline = transform.GetComponentInChildren<TextUnline>(); |
| | | if (unline == null) |
| | | { |
| | | GameObject obj = BuiltInLoader.LoadPrefab("TextUnline"); |
| | | // GameObject obj = UILoader.LoadPrefab("TextUnline") as GameObject; |
| | | obj = Instantiate(obj); |
| | | obj.transform.SetParent(transform); |
| | | obj.transform.localScale = Vector3.one; |
| | | unline = obj.GetComponent<TextUnline>(); |
| | | unline.raycastTarget = false; |
| | | // GameObject obj = await BuiltInLoader.LoadPrefabAsync("TextUnline"); |
| | | // if (this == null) return; |
| | | // obj = Instantiate(obj); |
| | | // obj.transform.SetParent(transform); |
| | | // obj.transform.localScale = Vector3.one; |
| | | // unline = obj.GetComponent<TextUnline>(); |
| | | // unline.raycastTarget = false; |
| | | |
| | | BuiltInLoader.LoadPrefabAsync("TextUnline").ContinueWith(prefab => |
| | | { |
| | | if (this == null) return; |
| | | GameObject obj = Instantiate(prefab); |
| | | obj.transform.SetParent(transform); |
| | | obj.transform.localScale = Vector3.one; |
| | | unline = obj.GetComponent<TextUnline>(); |
| | | unline.raycastTarget = false; |
| | | }).Forget(); |
| | | } |
| | | } |
| | | |
| | |
| | | #endregion |
| | | |
| | | #region 解析 |
| | | private string GetOutputText(string _text) |
| | | private async UniTask<string> GetOutputText(string _text) |
| | | { |
| | | string result = _text; |
| | | result = GetExtenalData(result); |
| | | result = GetTaskInfo(result); |
| | | result = RichTextMgr.Inst.Analysis(result, out m_ImgList, out m_HrefList, this); |
| | | result = await RichTextMgr.Inst.Analysis(result, this); |
| | | m_ImgList = RichTextMgr.Inst.GetImgList(); |
| | | m_HrefList = RichTextMgr.Inst.GetHrefList(); |
| | | return result; |
| | | } |
| | | #endregion |
| | |
| | | value = string.Empty; |
| | | } |
| | | m_RichText = value; |
| | | SetRichTextDirty(); |
| | | SetRichTextDirty().Forget(); |
| | | } |
| | | } |
| | | |
| | |
| | | } |
| | | #endif |
| | | |
| | | private void SetRichTextDirty() |
| | | private async UniTask SetRichTextDirty() |
| | | { |
| | | m_RichText = UIHelper.ReplaceNewLine(m_RichText); |
| | | m_OutputText = GetOutputText(m_RichText); |
| | | m_OutputText = await GetOutputText(m_RichText); |
| | | if (AutoNewLine) |
| | | { |
| | | SetFitterSize(); |