123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113 |
- using Common.Utility.CombatEvent;
- using Core.Event.Event;
- using Core.Language;
- using Excel2Json;
- using Fort23.Core;
- using Fort23.UTool;
- using GameLogic.Hero;
- using UnityEngine;
- using UnityEngine.EventSystems;
- namespace Fort23.Mono
- {
- [UIBinding(prefab = "SkillKongWidget")]
- public partial class SkillKongWidget : ItemWidgetBasic
- {
- public int index;
- private SkillSelectPanel skillSelectPanel;
- public SkillInfo SkillInfo;
- protected bool _isSelect;
- private void Init()
- {
- }
- public override void AddEvent()
- {
- }
- public override void DelEvent()
- {
- }
- public override CTask<bool> AsyncInit(object[] uiData)
- {
- isAddLongPressBtn = (bool)uiData[0];
- return base.AsyncInit(uiData);
- }
- public override void AddButtonEvent()
- {
- // myButton.onClick = delegate
- // {
- // skillSelectPanel.SelectKongSkill(this);
- // };
- // myButton.OnPressAndHold = delegate
- // {
- // if (SkillInfo == null)
- // {
- // return;
- // }
- //
- // SkillConfig skillConfig= SkillInfo.skillConfig;
- // SkillMassgePanel.OpenSkillSelectPanel(LanguageManager.Instance.Text(skillConfig.name) , LanguageManager.Instance.Text(skillConfig.dec));
- // };
- base.AddButtonEvent();
- // //添加拖拽事件
- // longPressBtn.onDragStart = OnDragStart;
- // longPressBtn.onDrag = OnDrag;
- // longPressBtn.onDragEnd = OnDragEnd;
- }
-
- public void SelectState(bool isSelect)
- {
- _isSelect = isSelect;
- myBg.color = _isSelect ? Color.green : new Color32(44, 67, 71, 200);
- }
- public override void DormancyObj()
- {
- base.DormancyObj();
- Cleared();
- }
- public void Cleared()
- {
- this.SkillInfo = null;
- icon.gameObject.SetActive(false);
- }
- public void SetSKill(SkillInfo skillId)
- {
- if (skillId == null)
- {
- return;
- }
- skillId.index = index;
- this.SkillInfo = skillId;
- icon.gameObject.SetActive(true);
- SkillConfig skillConfig = SkillInfo.skillConfig;
- icon.icon_name = skillConfig.icon;
- Text_Tips.gameObject.SetActive(skillConfig.ID != 0 && skillConfig.SkillType == 2);
- }
- public void InitWidget(int index, SkillSelectPanel skillSelectPanel)
- {
- this.skillSelectPanel = skillSelectPanel;
- this.index = index;
- icon.gameObject.SetActive(false);
- SkillInfo = null;
- Text_Tips.gameObject.SetActive(false);
- }
- }
- }
|