yyl
2025-10-27 d7bb467b74c78370a5274db9e2be92fb91ae7997
125 战斗 BUFF图标配置未配置 设置为空的防错 (空的都做了防错)
1个文件已修改
36 ■■■■■ 已修改文件
Main/Utility/ComponentExtersion.cs 36 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Main/Utility/ComponentExtersion.cs
@@ -290,6 +290,12 @@
            return;
        }
        if (string.IsNullOrEmpty(_id))
        {
            Debug.LogError("Image SetSprite id is null or empty " + _id);
            return;
        }
        var sprite = UILoader.LoadSprite(_id);
        _image.overrideSprite = sprite;
    }
@@ -302,6 +308,12 @@
            return;
        }
        if (string.IsNullOrEmpty(_id))
        {
            Debug.LogError("TextImage SetSprite id is null or empty " + _id);
            return;
        }
        var sprite = UILoader.LoadSprite(_id);
        _textImage.sprite = sprite;
    }
@@ -311,6 +323,12 @@
    {
        if (_image == null)
        {
            return;
        }
        if (string.IsNullOrEmpty(iconName))
        {
            Debug.LogError("SetOrgSprite iconName is null or empty " + iconName);
            return;
        }
@@ -332,6 +350,12 @@
            return;
        }
        if (string.IsNullOrEmpty(itemConfig.IconKey))
        {
            Debug.LogError("SetItemSprite IconKey is null or empty for itemID " + itemID);
            return;
        }
        var sprite = UILoader.LoadSprite("icon", itemConfig.IconKey);
        _image.overrideSprite = sprite;
    }
@@ -346,6 +370,12 @@
        var skillConfig = SkillConfig.Get(skillID);
        if (skillConfig == null)
        {
            return;
        }
        if (string.IsNullOrEmpty(skillConfig.IconName))
        {
            Debug.LogError("SetSkillSprite IconName is null or empty for skillID " + skillID);
            return;
        }
@@ -388,6 +418,12 @@
            return;
        }
        if (string.IsNullOrEmpty(_id))
        {
            Debug.LogError("SetTexture2DPNG id is null or empty " + _id);
            return;
        }
        var texture = UILoader.LoadTexture2DPNG(_id);
        _image.texture = texture;
    }