| | |
| | | using System.Collections; |
| | | using System.Collections.Generic; |
| | | using Cysharp.Threading.Tasks; |
| | | using UnityEngine; |
| | | |
| | | public class RichTextMgr { |
| | |
| | | /// </summary> |
| | | /// <param name="_text"></param> |
| | | /// <returns></returns> |
| | | public string Analysis(string _text,out List<ImgInfo> imgList,out List<HrefInfo> hrefList,RichText text=null) |
| | | public async UniTask<string> Analysis(string _text, RichText text=null) |
| | | { |
| | | imgList = new List<ImgInfo>(); |
| | | m_ImgInfoList = imgList; |
| | | hrefList = new List<HrefInfo>(); |
| | | m_HrefInfoList = hrefList; |
| | | m_ImgInfoList = new List<ImgInfo>(); |
| | | m_HrefInfoList = new List<HrefInfo>(); |
| | | |
| | | presentRichText = text; |
| | | |
| | | string result=GetAnalysis(_text); |
| | | string result= await GetAnalysis(_text); |
| | | //for (int i = 0; i < m_ImgInfoList.Count; i++) { |
| | | ImgAnalysis.Inst.CalculateTextIndex(result, 0); |
| | | //} |
| | | return result; |
| | | } |
| | | |
| | | public string Analysis(string val) |
| | | public async UniTask<string> Analysis(string val) |
| | | { |
| | | m_HrefInfoList = null; |
| | | m_ImgInfoList = null; |
| | | |
| | | return GetAnalysis(val); |
| | | return await GetAnalysis(val); |
| | | } |
| | | |
| | | private string GetAnalysis(string val) |
| | | private async UniTask<string> GetAnalysis(string val) |
| | | { |
| | | string result = ImgAnalysis.ReplaceFace(val); |
| | | try |
| | | { |
| | | result = ColorAnalysis.Inst.Analysis(result, true); |
| | | result = await ColorAnalysis.Inst.Analysis(result, true); |
| | | result = WordAnalysis.Inst.ReplaceSpace(result); |
| | | result = ImgAnalysis.Inst.Analysis(result, true); |
| | | result = WordAnalysis.Inst.Analysis(result, true); |
| | | result = HrefAnalysis.Inst.Analysis(result, true); |
| | | result = SuitNameAnalysis.Inst.Analysis(result, true); |
| | | result = await ImgAnalysis.Inst.Analysis(result, true); |
| | | result = await WordAnalysis.Inst.Analysis(result, true); |
| | | result = await HrefAnalysis.Inst.Analysis(result, true); |
| | | result = await SuitNameAnalysis.Inst.Analysis(result, true); |
| | | result = HrefAnalysis.Inst.CalculateTextIndex(result, 0); |
| | | } |
| | | catch (System.Exception e) |