Пример #1
0
        void LateUpdate()
        {
            if (skillID == 0 || CoreEntry.gActorMgr.MainPlayer == null)
            {
                return;
            }
            //if (ShareCD == 0 && CD == 0 && m_TextCDCountDown.enabled == false) return;
            float ShareCD = ModuleServer.MS.GSkillCastMgr.QueryShareCDOverTime(skillID);
            float CD      = ModuleServer.MS.GSkillCastMgr.QuerySkillCDOverTime(skillID);

            if (CD > ShareCD)
            {
                totalTime  = ModuleServer.MS.GSkillCastMgr.GetSkillCDTime(skillID) / 1000;
                fBeginTime = ModuleServer.MS.GSkillCastMgr.GetSkillCDBegin(skillID);
            }
            else
            {
                totalTime  = ModuleServer.MS.GSkillCastMgr.GetShareSkillCDTime(skillID) / 1000;
                fBeginTime = ModuleServer.MS.GSkillCastMgr.GetShareSkillCDBegin(skillID);
            }

            UpdateCD();

            if ((ModuleServer.MS.GSkillCastMgr.InCDCoolState(skillID) == false) && m_isPressed && m_isDrag) // 普攻需要按住连续释放
            {
                m_sendRatio -= Time.deltaTime;
                if (m_sendRatio <= 0)
                {
                    m_sendRatio = 0.1f;

                    //如果硬直状态


                    LuaTable skill = ConfigManager.Instance.Skill.GetSkillConfig(skillID);

                    if (CoreEntry.gActorMgr.MainPlayer.IsInEndure())
                    {
                        return;
                    }

                    PreProcessWhenNormalAttack(CoreEntry.gActorMgr.MainPlayer);
                    //版本2的技能是手动指向型技能,不能自动释放
                    if (SkillBase.GetSkillVersion(CoreEntry.gActorMgr.MainPlayer, skill) != 2)
                    {
                        if (m_ImageDisable.gameObject.activeSelf == false)
                        {
                            ModuleServer.MS.GSkillCastMgr.CastSkill(skillID);
                        }
                    }
                }
            }
        }
Пример #2
0
        public void OnPress(bool isPressed)
        {
            BtnPressedTween(isPressed);
            if (isPressed == false)
            {
                if (m_isPressed && m_isDrag)
                {
                    OnClick(this.gameObject);
                }
                m_isPressed = false;
                //m_isClick = false;
                m_isDrag = false;
            }

            if (isPressed)
            {
                m_isPressed = true;
                m_isDrag    = true;
                //m_sendRatioShowScope = 0.2f;

                if (CoreEntry.gActorMgr.MainPlayer != null)
                {
                    //普攻时不能移动
                    PreProcessWhenNormalAttack(CoreEntry.gActorMgr.MainPlayer);
                    if ((ModuleServer.MS.GSkillCastMgr.InCDCoolState(skillID) == false) && skillDesc != null && SkillBase.GetSkillVersion(CoreEntry.gActorMgr.MainPlayer, skillDesc) == 2)
                    {
                        StateParameter param = new StateParameter();
                        param.state   = ACTOR_STATE.AS_AIMING;
                        param.skillID = skillID;
                        CoreEntry.gActorMgr.MainPlayer.RequestChangeState(param);
                    }
                }
            }
        }
Пример #3
0
        public void OnClick(GameObject obj)
        {
            if (buttonindex == (int)enSkillIndex.Player_Skill_Beauty && PlayerData.Instance.BaseAttr.Level < BeautyOpenLevel)
            {
                //UITips.ShowTips(string.Format("魔神变身{0}级开放", BeautyOpenLevel));
                UITips.ShowUnHeroModelShow();
                return;
            }
            if (buttonindex == (int)enSkillIndex.Player_Skill_Beauty)
            {
                if (m_ImageDisable.gameObject.activeSelf)
                {
                    //   UITips.ShowTips(string.Format("您未获得魔神"));
                    UITips.ShowUnHeroModelShow();
                    return;
                }
                else
                {
                    if (guidewidget != null)
                    {
                        guidewidget.OnButtonClick();
                    }
                    if (m_ImageCD.fillAmount < 1)
                    {
                        string strTips = Localization.Get("技能冷却中");
                        if (strTips.Length > 0)
                        {
                            UITips.ShowTips(strTips);
                        }
                    }
                }
            }

            if (m_ImageDisable.gameObject.activeSelf)
            {
                if (buttonindex == (int)enSkillIndex.Player_Skill_WangzheVip)
                {
                    MainPanelMgr.Instance.ShowDialog("UIBaiYinVIP");
                    return;
                }

                UITips.ShowTips(string.Format("该技能尚未解锁"));
                return;
            }


            if (skillID == 0)
            {
                return;
            }
            if (CoreEntry.gActorMgr.MainPlayer != null)
            {
                if (buttonindex == (int)enSkillIndex.Player_att || buttonindex == (int)enSkillIndex.Beauty_att)
                {
                    CoreEntry.gActorMgr.MainPlayer.ReleaseCanNotBeControlledByInputFromNormalAttack();
                }
            }
            LuaTable skill = ConfigManager.Instance.Skill.GetSkillConfig(skillID);

            if (skill == null)
            {
                return;
            }

            if (SkillBase.GetSkillVersion(CoreEntry.gActorMgr.MainPlayer, skill) == 2 && CoreEntry.gActorMgr.MainPlayer.curActorState != ACTOR_STATE.AS_AIMING)
            {
                return;
            }

            SDKMgr.Instance.TrackGameOptLog(1, 500 + buttonindex);

            m_isDrag = false;
            //m_isClick = false;   // 按住不能放技能
            m_sendRatio = 0.05f;
            if (buttonindex == (int)enSkillIndex.Player_Skill_Beauty)
            {
                LogMgr.UnityWarning("Player_Skill_Beauty:" + skillID);
            }
            ModuleServer.MS.GSkillCastMgr.CastSkill(skillID);
        }