Exemplo n.º 1
0
        private void RefreshSkillEnableState()
        {
            if (Singleton <CBattleSystem> .GetInstance().FightForm == null)
            {
                return;
            }
            CSkillButtonManager skillButtonManager = Singleton <CBattleSystem> .GetInstance().FightForm.m_skillButtonManager;

            SkillSlotType skillSlotType;

            if (!skillButtonManager.HasMapSlectTargetSkill(out skillSlotType))
            {
                return;
            }
            SkillSlot skillSlot  = null;
            Player    hostPlayer = Singleton <GamePlayerCenter> .GetInstance().GetHostPlayer();

            if (hostPlayer == null || !hostPlayer.Captain)
            {
                return;
            }
            if (!hostPlayer.Captain.get_handle().SkillControl.TryGetSkillSlot(skillSlotType, out skillSlot))
            {
                return;
            }
            this.m_NeedConfirm = (skillButtonManager.GetSkillJoystickMode(skillSlotType) == enSkillJoystickMode.MapSelectOther);
            if (this.m_TargetSkillEnable != skillSlot.IsEnableSkillSlot())
            {
                this.m_TargetSkillEnable = !this.m_TargetSkillEnable;
                if (this.m_TargetSkillEnable)
                {
                    this.OnPlayerSkillEnable();
                }
                else
                {
                    this.OnPlayerSkillDisable();
                }
            }
        }