yyl
2025-07-29 b0a5d4688f1af73b5ad03ccc2df11c9aac1523a9
Main/Component/UI/Core/OutlineEx.cs
@@ -34,15 +34,23 @@
    private static List<UIVertex> m_VetexList = new List<UIVertex>();
    // 材质池:Key为"颜色_宽度"格式的字符串,Value为对应的材质; 减少合批问题,又能保持不同的描边;共用材质会同时改变参数
    private static Dictionary<string, Material> m_MaterialPool = new Dictionary<string, Material>();
    private static Shader m_Shader;
    static Shader m_tmpShader;
    private static Shader m_Shader
    {
        get
        {
            if (m_tmpShader == null)
            {
                m_tmpShader = Shader.Find("TSF Shaders/UI/OutlineEx");
            }
            return m_tmpShader;
        }
    }
    protected override void Start()
    {
        base.Start();
        if (m_Shader == null)
        {
            m_Shader = Shader.Find("TSF Shaders/UI/OutlineEx");
        }
        
        // 使用材质池获取或创建材质
        string key = GetMaterialKey(OutlineColor, OutlineWidth);