Пример #1
0
        partial void OnSafeAwake()
        {
            RegisterAll();
            PanelMgr.PushPanel(startPanel.StringValue);
//			AudioMgr.Instance.PlayBgm(startBgm.StringValue);
            //do any thing you want
        }
Пример #2
0
    void Start()
    {
        print("Normal_Start");

        GameMgr.Instance.PlayerPos = this.PlayerPos;

        if (enableMiniMap)
        {
            MemoryMgr.InstantiateGameObject(DirPath.LittleUiDir + UiName.Image_MiniMap, GlobalVar.G_Canvas.transform);
        }

        if (!string.IsNullOrEmpty(UiPanelName))
        {
            PanelMgr.PushPanel(UiPanelName);
            if (UiPanelName == PanelName.battlePanel)
            {
                CEventCenter.BroadMessage(Message.M_RankAwake, 0, 0);
            }
        }

        if (creatTestPeople)
        {
            new TestPerson("Test", DirPath.GameObjectDir + GameObjectName.TestPerson, EnemyPos);
        }
    }
Пример #3
0
        partial void OnSafeAwake()
        {
            //初始化等级数据
            UlevelMgr.Instance.Init();

            CEventCenter.AddListener(Message.LoginLogicServerSuccess, OnLoginLogicServerSuccess);
            CEventCenter.AddListener(Message.GetUgameInfoSuccess, OnGetUgaemInfoSuccess);
            //do any thing you want
            PanelMgr.PushPanel(startPanel.StringValue);
        }
Пример #4
0
        /// <summary>
        /// 加载场景,并加载新UI
        /// </summary>
        /// <param name="newSceneName"></param>
        /// <param name="newPanelName"></param>
        public static void LoadScene(string newSceneName, string newPanelName)
        {
            if (currentSceneName == newSceneName)
            {
                return;
            }

            MainLoop.Instance.StartCoroutine(_LoadScene(AbstractSceneInfo.GetScene(newSceneName),
                                                        null,
                                                        () => PanelMgr.PushPanel(newPanelName)));
        }
Пример #5
0
        void Start()
        {
            PanelMgr.PushPanel(startPanel.StringValue);
            AudioMgr.Instance.PlayBgm(startBgm.StringValue);


            if (enableMiniMap)
            {
                ResourceMgr.InstantiateGameObject(UiName.Image_MiniMapBackGround,
                                                  GlobalVar.G_Canvas.transform);
            }
        }
Пример #6
0
        void Start()
        {
            if (!gameObject.activeSelf || !enabled)
            {
                return;
            }
            PanelMgr.PushPanel(startPanel.StringValue);
            AudioMgr.Instance.PlayBgm(startBgm.StringValue);


            if (enableMiniMap)
            {
                ResourceMgr.InstantiateGameObject(UiName.Image_MiniMapBackGround,
                                                  GlobalVar.GCanvasObj.transform);
            }
        }
 protected override void Update()
 {
     base.Update();
     if (Input.GetKeyDown(mapKey))
     {
         if (mapped)
         {
             PanelMgr.PopPanel();
         }
         else
         {
             PanelMgr.PushPanel(PanelName.MapPanel);
         }
         mapped = !mapped;
     }
 }
Пример #8
0
 void Update()
 {
     if (isClose)
     {
         //Debug.Log("Close");
         if (Input.GetKeyDown(KeyCode.E))
         {
             if (isShowing)
             {
                 PanelMgr.PopPanel();
                 isShowing = false;
             }
             else
             {
                 PanelMgr.PushPanel(PanelName.ShopPanel);
                 isShowing = true;
             }
         }
     }
 }
        public void RunPanelUnit()
        {
            switch (panelType)
            {
            case DialogUnitInfo.PanelOperateType.Pop:
                PanelMgr.PopPanel();
                break;

            case DialogUnitInfo.PanelOperateType.Push:
                Debug.Log("DialogUnitInfo_RunPanelUnit_Switch_PushPanel");
                if (fade)
                {
                    PanelMgr.PushPanel(panelChooser.StringValue, new FadeInOut(floatValue));
                }
                else
                {
                    PanelMgr.PushPanel(panelChooser.StringValue);
                }
                break;
            }
        }
Пример #10
0
        protected override void Update()
        {
            //            Debug.Log("玩家在" + Pos);


            //一技能
            if (Input.GetKeyDown(KeyCode.U))
            {
                //               Debug.Log("按U"+this.MaxRealSkillCount);
                if (this.MaxRealSkillCount >= 1)
                {
                    Debug.Log("释放一技能:" + skills[this.BaseSkillCount].name);
                    skills[this.BaseSkillCount].Execute(this, true);
                }
            }

            //二技能
            if (Input.GetKeyDown(KeyCode.I))
            {
                //               Debug.Log("按I" + this.MaxRealSkillCount);
                if (this.MaxRealSkillCount >= 2)
                {
                    Debug.Log("释放二技能:" + skills[this.BaseSkillCount + 1].name);
                    skills[this.BaseSkillCount + 1].Execute(this);
                }
            }

            //三技能
            if (Input.GetKeyDown(KeyCode.O))
            {
                Debug.Log("按O" + this.MaxRealSkillCount);
                if (this.MaxRealSkillCount >= 3)
                {
//                    Debug.Log("释放三技能:"+skills[this.BaseSkillCount+2].name);
                    skills[this.BaseSkillCount + 2].Execute(this);
                }
            }

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

            //背包
            if (Input.GetKeyDown(KeyCode.Tab))
            {
                PanelMgr.PushPanel(PanelName.packagePanel);
            }
            if (Input.GetKeyUp(KeyCode.Tab))
            {
                PanelMgr.PopPanel();
            }

            #region  连击

            SkillInstance lastSkill = null;
            var           index     = this.comboNum;

            if (this.comboNum > 0)
            {
                lastSkill = skills[index];

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

                if (this.timer - lastSkill.startTime > canMoveTime[this.comboNum - 1])
                {
                    mainc._inControl = true;
                }

                if (this.timer - lastSkill.startTime >
                    lastSkill.LastTime * this.beginComboTest[this.comboNum - 1] + durTimes[this.comboNum - 1])
                {
                    //Debug.Log("归零");
                    this.comboNum = 0;
                    MainLoop.Instance.RemoveUpdateFunc(_DeUpdate);
                    //恢复人物控制
                    mainc._inControl = true;
                }
            }

            if (Input.GetKeyDown(KeyCode.J))
            {
                if (!cc.isGrounded)
                {
                    mainc._playerVelocityY = 0;
                    this.TakeBattleEffect(new HitbackEffect(new Vector2(this.Dir * Mathf.Abs(this.airXMove), 0)));
                }
                mainc._inControl = false;

                //            Debug.Log("按下J");

                var thisSkill = skills[index];

                index++;


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

                else if (
                    this.timer - lastSkill.startTime > lastSkill.LastTime * this.beginComboTest[this.comboNum - 1] &&
                    this.timer - lastSkill.startTime <
                    lastSkill.LastTime * this.beginComboTest[this.comboNum - 1] + durTimes[this.comboNum - 1] &&
                    this.comboNum < skillNames.Count)
                {
                    Debug.Log("执行了技能" + index + " " + thisSkill.name);
                    thisSkill.Execute(this, ignoreInput[this.comboNum - 1], this.timer);
                    this.comboNum++;
                }
            }
            #endregion
        }
Пример #11
0
 private void OnLoginLogicServerSuccess()
 {
     CEventCenter.RemoveListener(Message.LoginLogicServerSuccess, OnLoginLogicServerSuccess);
     Debug.Log("登陆逻辑服务器成功");
     PanelMgr.PushPanel(PanelName.HomePanel);
 }
Пример #12
0
        protected override void Update()
        {
            foreach (var VARIABLE in CharacterController.commonSkillInfos)
            {
                if (Input.GetKeyDown(VARIABLE.key))
                {
                    VARIABLE.skillAsset.RunSkill(this);
                }
            }

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

            //背包
            if (Input.GetKeyDown(CharacterController.bagKey))
            {
                PanelMgr.PushPanel(PanelName.PackagePanel);
            }

            if (Input.GetKeyUp(CharacterController.bagKey))
            {
                PanelMgr.PopPanel();
            }

            #region  连击

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

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

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

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

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

            if (Input.GetKeyDown(CharacterController.comboKey))
            {
//                Debug.Log("按键");
                if (!ActorMover.IsGrounded)
                {
                    ActorMover.VelocityY = 0;
//                    this.TakeBattleEffect(new HitbackEffect(new Vector2(this.FaceDir * Mathf.Abs(this.AirXMove), 0)));
                }

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


                index++;
                if (index >= CharacterController.comboSkillInfos.Count)
                {
//	                Debug.Log($"Index : {index} Count: {CharacterController.comboSkillInfos.Count}");
                    return;
                }


                var thisSkill = CharacterController.comboSkillInfos[index];


                if (this.comboNum == 0) //初次攻击
                {
                    this.timer = 0;
                    //开始增加时间
                    //                    Debug.Log("初次攻击");
                    MainLoop.Instance.AddUpdateFunc(_DeUpdate);
//                    Debug.Log("执行了技能" + index + " " + thisSkill.SkillName);
                    thisSkill.RunSkill(this, CharacterController.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 < CharacterController.comboSkillInfos.Count)
                        {
//                             Debug.Log("执行了技能" + index + " " + thisSkill.SkillName);
                            thisSkill.RunSkill(this, lastSkill.IgnoreInput, this.timer);
                            this.comboNum++;
                        }
//                        else
//                        {
//                             Debug.Log($"连击数大于攻击次数:this.comboNum:{comboNum}, 技能数量:{CharacterController.comboSkillInfos.Count}");
//                        }
                    }
//
//                    else
//                    {
//	                    Debug.Log("lastSkill.Name: "+lastSkill.SkillName+"  lastSkill.lastTime: "+lastSkill.LastTime);
//                        Debug.Log($"还没有开始连击检测! 距离上次攻击间隔:{this.timer-lastSkill.StartTime}, lastSkill.StartTime: {lastSkill.StartTime},开始连击检测的间隔:{CharacterController.comboSkillInfos[this.comboNum-1].beginComboTest*lastSkill.LastTime}");
//                    }
                }
//                else
//                {
//                    var skill = CharacterController.comboSkillInfos[comboNum - 1];
//                    Debug.Log($"技能开始时间:{skill.StartTime}, 技能持续时间:{skill.LastTime} 连击中止时间:"+(skill.faultToleranceTime+skill.LastTime*skill.beginComboTest));
//                    Debug.Log($"已经超过连击检测容错时间: 上次释放技能到现在间隔:{this.timer-lastSkill.StartTime}, 容错时间:{ lastSkill.LastTime * CharacterController.comboSkillInfos[this.comboNum - 1].beginComboTest + CharacterController.comboSkillInfos[this.comboNum - 1].faultToleranceTime}");
//                }
            }

            #endregion
        }
 protected virtual void Start()
 {
     PanelMgr.PushPanel(startPanel.StringValue);
 }