protected override void OnTriggerExit2D(Collider2D col)
 {
     base.OnTriggerExit2D(col);
     if (isShowing)
     {
         PanelAssetMgr.PopPanel();
     }
 }
Exemple #2
0
        void Start()
        {
            if (enableMiniMap)
            {
                MemoryMgr.InstantiateGameObject(UiPath.Image_MiniMapBackGround,
                                                GlobalVar.G_Canvas.transform);
            }


            if (PanelUiAsset != null)
            {
                PanelAssetMgr.PushPanel(PanelUiAsset);
            }
            CEventCenter.BroadMessage(Message.M_RankAwake, 0, 0);
        }
 void Update()
 {
     if (isClose)
     {
         //Debug.Log("Close");
         if (Input.GetKeyDown(KeyCode.E))
         {
             Debug.Log("KeyDown");
             if (isShowing)
             {
                 PanelAssetMgr.PopPanel();
                 isShowing = false;
             }
             else
             {
                 PanelAssetMgr.PushPanel(shopPanelAsset);
                 //PanelMgr.PushPanel(PanelName.shopPanel);
                 isShowing = true;
             }
         }
     }
 }
Exemple #4
0
        protected override void Update()
        {
            foreach (var VARIABLE in playerInfo.commonSkillInfos)
            {
                if (Input.GetKeyDown(VARIABLE.key))
                {
                    VARIABLE.skillAsset.RunSkill(this);
                }
            }

            //Z强化
            if (Input.GetKeyDown(playerInfo.superKey))
            {
                TrySuper();
            }

            //背包
            if (Input.GetKeyDown(playerInfo.bagKey))
            {
                PanelAssetMgr.PushPanel(playerInfo.packagePanelAsset);
            }

            if (Input.GetKeyUp(playerInfo.bagKey))
            {
                PanelAssetMgr.PopPanel();
            }

            #region  连击

            ComboSkillInfo lastSkill = null;
            var            index     = this.comboNum - 1;

            if (this.comboNum > 0)
            {
                lastSkill = playerInfo.comboSkillInfos[this.comboNum - 1];

                Assert.IsTrue(this.comboNum > 0 && this.comboNum < 4);

                if (this.timer - lastSkill.StartTime > lastSkill.canMoveTime)
                {
//                    Debug.Log("过了移动锁定时间,恢复人物控制");
                    mainc._inControl = true;
                }

                if (this.timer - lastSkill.StartTime >
                    lastSkill.LastTime * lastSkill.beginComboTest + lastSkill.faultToleranceTime)
                {
                    this.comboNum = 0;
                    MainLoop.Instance.RemoveUpdateFunc(_DeUpdate);
                    //恢复人物控制
//                    Debug.Log("连击中断,恢复人物控制");
                    mainc._inControl = true;
                }
                else
                {
                }
            }

            if (Input.GetKeyDown(playerInfo.comboKey))
            {
//                Debug.Log("按键");
                if (!cc.isGrounded)
                {
                    mainc._playerVelocityY = 0;
//                    this.TakeBattleEffect(new HitbackEffect(new Vector2(this.Dir * Mathf.Abs(this.AirXMove), 0)));
                }

//                Debug.Log("按下攻击键,无论如何,锁定人物");
                mainc._inControl = false;


                index++;
                if (index >= playerInfo.comboSkillInfos.Count)
                {
                    return;
                }


                ComboSkillInfo thisSkill = playerInfo.comboSkillInfos[index];


                if (this.comboNum == 0) //初次攻击
                {
                    this.timer = 0;
                    //开始增加时间
                    //                    Debug.Log("初次攻击");
                    MainLoop.Instance.AddUpdateFunc(_DeUpdate);
//                    Debug.Log("执行了技能" + index + " " + thisSkill.SkillName);
                    thisSkill.RunSkill(this, this.playerInfo.comboSkillInfos[0].ignoreInput, this.timer);

                    this.comboNum++;
                }

                else if (this.timer - lastSkill.StartTime <
                         lastSkill.LastTime * lastSkill.beginComboTest + lastSkill.faultToleranceTime)
                {
                    if (this.timer - lastSkill.StartTime > lastSkill.LastTime * lastSkill.beginComboTest)
                    {
                        if (this.comboNum < this.playerInfo.comboSkillInfos.Count)
                        {
//                             Debug.Log("执行了技能" + index + " " + thisSkill.SkillName);
                            thisSkill.RunSkill(this, lastSkill.ignoreInput, this.timer);
                            this.comboNum++;
                        }

//                         else
//                         {
//                             Debug.Log($"连击数大于攻击次数:this.comboNum:{comboNum}, 技能数量:{this.playerInfo.comboSkillInfos.Count}");
//                         }
                    }

//                    else
//                        Debug.Log($"还没有开始连击检测! 距离上次攻击间隔:{this.timer-lastSkill.StartTime}, lastSkill.StartTime: {lastSkill.StartTime},开始连击检测的间隔:{playerInfo.comboSkillInfos[this.comboNum-1].beginComboTest*lastSkill.LastTime}");
                }

//                else
//                {
//                    var skill = this.playerInfo.comboSkillInfos[comboNum - 1];
//                    Debug.Log($"技能开始时间:{skill.StartTime}, 技能持续时间:{skill.LastTime} 连击中止时间:"+(skill.faultToleranceTime+skill.LastTime*skill.beginComboTest));
//                    Debug.Log($"已经超过连击检测容错时间: 上次释放技能到现在间隔:{this.timer-lastSkill.StartTime}, 容错时间:{ lastSkill.LastTime * this.playerInfo.comboSkillInfos[this.comboNum - 1].beginComboTest + this.playerInfo.comboSkillInfos[this.comboNum - 1].faultToleranceTime}");
//                }
            }

            #endregion
        }