| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143 | using Common.Utility.CombatEvent;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 = "gf_widget")]    public partial class gf_widget : 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;            quan.color = CombatCalculateTool.Instance.GetColor(HuangDaoWuXingType);        }        public void SkillSlotsAlter(IEventData eventData)        {            SkillSlotsAlterEventData skillSlotsAlterEventData = (SkillSlotsAlterEventData)eventData;            if (skillSlotsAlterEventData.SkillSlots == SkillSlots)            {                SkillBasic = SkillSlots.SkillBasic;                if (SkillBasic != null && HuangDaoWuXingType != WuXingType.Null) //有黄道,播放黄道家成表现                {                    if (PlayerGf_widget != null)                    {                        PlayerGf_widget.Play("huangdao", false);                    }                }                SetUIInfo();            }        }        public override void AddButtonEvent()        {        }        private void SetUIInfo()        {            if (SkillBasic == null)            {                useSkillIcon.transform.parent.gameObject.SetActive(false);                quan.color = new Color(1, 1, 1, 1);                // if (PlayerGf_widget != null)                // {                //     PlayerGf_widget.Play("likai",false);                // }                return;            }            if (PlayerGf_widget != null)            {                PlayerGf_widget.Play("enter", false);            }            useSkillIcon.transform.parent.gameObject.SetActive(true);            useSkillIcon.icon_name = SkillBasic.SelfSkillConfig.icon;            cd.icon_name=SkillBasic.SelfSkillConfig.icon;            cd.fillAmount = 0;            if (SkillBasic.SelfSkillConfig.SkillType == 2)            {                quan.color = new Color(0.81f, 0.21f, 1f);                return;            }            quan.color = CombatCalculateTool.Instance.GetColor((WuXingType)SkillBasic.SelfSkillConfig.attribute);        }        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();        }    }}
 |