From 9e91c51e4ece0002b58e22e27ec57fd8d23176a9 Mon Sep 17 00:00:00 2001
From: yyl <yyl>
Date: 星期五, 29 八月 2025 15:24:42 +0800
Subject: [PATCH] 125 【战斗】战斗系统 协议更新

---
 Main/System/SkillUI/SkillBaseCell.cs |   24 ++++++++++++++++++++----
 1 files changed, 20 insertions(+), 4 deletions(-)

diff --git a/Main/System/SkillUI/SkillBaseCell.cs b/Main/System/SkillUI/SkillBaseCell.cs
index 1e1b161..77101a2 100644
--- a/Main/System/SkillUI/SkillBaseCell.cs
+++ b/Main/System/SkillUI/SkillBaseCell.cs
@@ -50,15 +50,31 @@
         LoadPrefab();
     }
 
-    private void Init(int skillID, UnityAction onclick, bool showType = false)
+    public void Init(int skillID, UnityAction onclick = null, bool showType = false)
     {
         var config = SkillConfig.Get(skillID);
-        skillIcon.SetSprite(config.IconName);
-        skillBtn.AddListener(onclick);
+        if (config == null)
+        {
+            Debug.LogErrorFormat("鎶�鑳芥湭閰嶇疆 : {0}", skillID);
+            return;
+        }
+        skillIcon.SetOrgSprite(config.IconName, "SkillIcon");
+#if UNITY_EDITOR
+        if (string.IsNullOrEmpty(config.IconName))
+        { 
+            //鍐呯綉娴嬭瘯
+            skillIcon.SetOrgSprite("skillicondefault", "SkillIcon");
+        }
+#endif
+        
+        skillBtn.AddListener(()=>
+        {
+            onclick?.Invoke();
+        });
 
         if (showType)
         {
-            skillType.text = Language.Get(config.FuncType == 23 ? "HeroSkillType_1" : "HeroSkillType_2");
+            skillType.text = Language.Get(config.FuncType == 1 ? "HeroSkillType_1" : "HeroSkillType_2");
         }
         else
         { 

--
Gitblit v1.8.0