| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180 | using Common.Utility.CombatEvent;using Core.Language;using Excel2Json;using Fort23.Core;using GameLogic.Combat.CombatTool;using GameLogic.Combat.Hero.Turntable;using GameLogic.Combat.Skill;using GameLogic.Player;using UnityEngine;namespace Fort23.Mono{    [UIBinding(prefab = "EnemyGf_skill")]    public partial class EnemyGf_skill : UIComponent    {        public SkillSlots SkillSlots;        public SkillBasic SkillBasic;        public float jd;        public int useCount;        public WuXingType HuangDaoWuXingType;        public CombatHeroEntity combatHeroEntity;        private void Init()        {        }        public override void AddEvent()        {            CombatEventManager.Instance.AddEventListener(CombatEventType.SkillSlotsAlter, SkillSlotsAlter);            CombatEventManager.Instance.AddEventListener(CombatEventType.HuangDaoAlterSlots, HuangDaoAlterSlots);        }        public override void DelEvent()        {            CombatEventManager.Instance.RemoveEventListener(CombatEventType.SkillSlotsAlter, SkillSlotsAlter);            CombatEventManager.Instance.RemoveEventListener(CombatEventType.HuangDaoAlterSlots, HuangDaoAlterSlots);        }        private void HuangDaoAlterSlots(IEventData iEventData)        {            HuangDaoAlterSlotsEventData huangDaoAlterSlotsEventData = iEventData as HuangDaoAlterSlotsEventData;            if (huangDaoAlterSlotsEventData.CombatHeroEntity != combatHeroEntity || SkillSlots == null)            {                return;            }            if (huangDaoAlterSlotsEventData.index != SkillSlots.index)            {                return;            }            HuangDaoWuXingType = huangDaoAlterSlotsEventData.WuXingType;            switch ((int)HuangDaoWuXingType)            {                case 1:                    quan.color = new Color(1f, 0.98f, 0.09f);                    break;                case 2:                    quan.color = new Color(0.19f, 0.51f, 1f);                    break;                case 4:                    quan.color = new Color(0.17f, 1f, 0.35f);                    break;                case 8:                    quan.color = new Color(1f, 0.19f, 0.04f);                    break;                case 16:                    quan.color = new Color(1f, 0.65f, 0.17f);                    break;            }        }        public void SkillSlotsAlter(IEventData eventData)        {            SkillSlotsAlterEventData skillSlotsAlterEventData = (SkillSlotsAlterEventData)eventData;            if (skillSlotsAlterEventData.SkillSlots == SkillSlots)            {                SkillBasic = SkillSlots.SkillBasic;                              SetUIInfo();            }        }        public override void AddButtonEvent()        {            mybutton.onClick.AddListener(OnClick);        }        private void OnClick()        {             SkillConfig skillConfig = SkillBasic.SelfSkillConfig;            CombatController.currActiveCombat.isUpdate = false;            SkillMassgePanel.OpenSkillSelectPanel(LanguageManager.Instance.Text(skillConfig.name), LanguageManager.Instance.Text(skillConfig.dec),                delegate()                {                    CombatController.currActiveCombat.isUpdate = true;                });        }        private void SetUIInfo()        {            if (SkillBasic == null)            {                useSkillIcon.transform.parent.gameObject.SetActive(false);                quan.color = new Color(1, 1, 1, 0.2f);                // if (PlayerGf_widget != null)                // {                //     PlayerGf_widget.Play("likai",false);                // }                return;            }            useSkillIcon.transform.parent.gameObject.SetActive(true);            useSkillIcon.icon_name = SkillBasic.SelfSkillConfig.icon;            cd.fillAmount = 0;            if (SkillBasic.SelfSkillConfig.SkillType == 2)            {                quan.color = new Color(0.81f, 0.21f, 1f);                return;            }            // useCount= SkillBasic.UseCount;            switch (SkillBasic.SelfSkillConfig.attribute)            {                case 1:                    quan.color = new Color(1f, 0.98f, 0.09f);                    break;                case 2:                    quan.color = new Color(0.19f, 0.51f, 1f);                    break;                case 4:                    quan.color = new Color(0.17f, 1f, 0.35f);                    break;                case 8:                    quan.color = new Color(1f, 0.19f, 0.04f);                    break;                case 16:                    quan.color = new Color(1f, 0.65f, 0.17f);                    break;            }        }        public void Update()        {            if (SkillSlots == null || SkillBasic == null)            {                return;            }            SkillBasic skillBasic = SkillBasic;            if (skillBasic.SelfSkillConfig.SkillType != 1)            {                return;            }            float bl = 1 - SkillSlots.GetFinishBl();            cd.fillAmount = bl;        }        public void InitSkillWidget(SkillBasic SkillBasic, CombatHeroEntity combatHeroEntity)        {            this.combatHeroEntity = combatHeroEntity;            this.SkillBasic = SkillBasic;            this.SkillSlots = null;            SetUIInfo();        }        public void InitWidget(SkillSlots skillSlots, CombatHeroEntity combatHeroEntity)        {            this.combatHeroEntity = combatHeroEntity;            this.SkillSlots = skillSlots;            SkillBasic = skillSlots.SkillBasic;            SetUIInfo();        }    }}
 |