| using System;  | 
| using System.Collections; | 
| using System.Collections.Generic; | 
| using System.Text;  | 
|   | 
| using UnityEngine; | 
| using UnityEngine.UI;  | 
|   | 
| namespace vnxbqy.UI  | 
| {  | 
|     public class SkillBehaviour : MonoBehaviour  | 
|     {  | 
|         [SerializeField] Image m_SkillIcon;  | 
|         [SerializeField] Button m_SkillButton;  | 
|         [SerializeField] Text m_SkillName;  | 
|         [SerializeField] Text m_SkillDescription;  | 
|         private int skillId = 0;  | 
|   | 
|         public event Action<int> onClick;  | 
|   | 
|         private void Awake()  | 
|         {  | 
|             m_SkillButton.onClick.AddListener(OnSkillButton);  | 
|         }  | 
|   | 
|         public void Display(int _skillId)  | 
|         {  | 
|             var config = SkillConfig.Get(_skillId);  | 
|             skillId = 0;  | 
|             if (config != null)  | 
|             {  | 
|                 skillId = _skillId;  | 
|                 m_SkillIcon.SetSprite(config.IconName);  | 
|             }  | 
|         }  | 
|   | 
|         public void DisplayNewGot(int _skillId)  | 
|         {  | 
|             var config = SkillConfig.Get(_skillId);  | 
|             skillId = 0;  | 
|             if (config != null)  | 
|             {  | 
|                 skillId = _skillId;  | 
|                 m_SkillIcon.SetSprite(config.IconName);  | 
|                 m_SkillName.text = config.SkillName;  | 
|                 m_SkillDescription.text = config.Description;  | 
|                 m_SkillDescription.color = UIHelper.GetUIColor(TextColType.LightYellow);  | 
|             }  | 
|         }  | 
|   | 
|         private void OnSkillButton()  | 
|         {  | 
|             if (skillId != 0)  | 
|             {  | 
|                 switch (ActivateShow.activateType)  | 
|                 {  | 
|                     case ActivateShow.ActivateFunc.Realm:  | 
|                         break;  | 
|                     case ActivateShow.ActivateFunc.GodWeapon:  | 
|                         var _model = ModelCenter.Instance.GetModel<MagicianModel>();  | 
|                         var _dict = _model.godWeaponSkillDict[ActivateShow.godWeaponType];  | 
|                         var _lv = 0;  | 
|                         foreach (var _key in _dict.Keys)  | 
|                         {  | 
|                             if (skillId == _dict[_key])  | 
|                             {  | 
|                                 _lv = _key;  | 
|                                 break;  | 
|                             }  | 
|                         }  | 
|                         var config = GodWeaponConfig.GetConfig(ActivateShow.godWeaponType, _lv);  | 
|                         SkillDetails.ShowSkillDetails(config.SkillID, SkillDetails.SkillSourceType.GodWeaponSkill, 0, config.Name, string.Empty);  | 
|                         break;  | 
|                 }  | 
|   | 
|                 if (onClick != null)  | 
|                 {  | 
|                     onClick(skillId);  | 
|                 }  | 
|             }  | 
|         }  | 
|     }  | 
| } |