yyl
2026-02-11 3f2cd27c5dfb3b450245bf1a37fc1b3414031c7c
Main/System/Message/ImgAnalysis.cs
@@ -2,6 +2,7 @@
using System.Collections;
using System.Collections.Generic;
using System.Text.RegularExpressions;
using Cysharp.Threading.Tasks;
using UnityEngine;
public class ImgAnalysis : TRichAnalysis<ImgAnalysis>
@@ -229,6 +230,46 @@
        }
    }
    private async UniTask LoadSpriteAsync()
    {
        if (presentImgInfo.IsFace) return;
        if (IconConfig.isInit)
        {
            if (!string.IsNullOrEmpty(presentImgInfo.folderName))
            {
                presentImgInfo.sprite = await UILoader.LoadSpriteAsync(presentImgInfo.folderName, presentImgInfo.spriteName);
            }
            else
            {
                presentImgInfo.sprite = await UILoader.LoadSpriteAsync(presentImgInfo.spriteName);
            }
        }
        if (presentImgInfo.sprite != null)
        {
            RichText text = RichTextMgr.Inst.presentRichText;
            if (text != null)
            {
                if (text.LockImgSize)
                {
                    presentImgInfo.width = presentImgInfo.height = text.fontSize;
                    return;
                }
                else if (text.ModifyImgSiez)
                {
                    presentImgInfo.width = text.ModifyImgWidth;
                    presentImgInfo.height = text.ModifyImgHeight;
                    return;
                }
            }
            if (presentImgInfo.scale != 1f)
            {
                presentImgInfo.width = presentImgInfo.sprite.rect.width * presentImgInfo.scale;
                presentImgInfo.height = presentImgInfo.sprite.rect.height * presentImgInfo.scale;
            }
        }
    }
    private const string FACE_REPLACE = @"#~([0-9a-zA-Z][0-9a-zA-Z][0-9a-zA-Z])";
    public static Regex FaceRegex = new Regex(FACE_REPLACE, RegexOptions.Singleline);
    public static string ReplaceFace(string msg)