yyl
2026-03-04 bc1cb6da854cb2e9144f10ed55330a537ecdca16
Main/System/Message/RichText.cs
@@ -182,13 +182,23 @@
        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();
        }
    }
@@ -285,12 +295,14 @@
    #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
@@ -1033,7 +1045,7 @@
                value = string.Empty;
            }
            m_RichText = value;
            SetRichTextDirty();
            SetRichTextDirty().Forget();
        }
    }
@@ -1044,10 +1056,10 @@
    }
#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();