Example #1
0
        void UpdateInput()
        {
            TimeController ctrl = TimeController.Instance;

            if (!WorldSwith.ForbidTimeOperation && InputMgr.PauseTime)
            {
                IsPause = !IsPause;
                PauseGame(IsPause, true);
                if (IsPause)
                {
                    ctrl.Freeze();
                }
            }

            if (InputMgr.EscButton)
            {
                if (UiManager.IsUIOpening(1))
                {
                    UiManager.OpenUI(0);
                    PauseGame(false, false);
                }
                else
                {
                    UiManager.OpenUI(1);
                    PauseGame(true, false);
                    ctrl.Freeze();
                }
            }

            if (!IsPause)
            {
                PlayerLogic.ApplyInput(InputMgr);
            }

            if (!WorldSwith.ForbidDrawLine)
            {
                LineMgr.ApplyInput(InputMgr);
            }
        }
Example #2
0
        void ProcessTime()
        {
            TimeController ctrl  = TimeController.Instance;
            var            state = TimeController.Instance.CurrentState;

            if (InputMgr.TimebackDown)
            {
                if (!ctrl.IsRewindEnd())
                {
                    RecordingTime = false;
                    PauseGame(false, false);
                    ctrl.RewindTime();
                }
                else
                {
                    PauseGame(true, false);
                    ctrl.Freeze();
                }
            }
            else if (InputMgr.TimebackUp)
            {
                if (!ctrl.IsRewindEnd())
                {
                    RecordingTime = false;
                    PauseGame(true, false);
                    ctrl.Freeze();
                }
                else
                {
                    PauseGame(true, false);
                    ctrl.Freeze();
                }
            }
            else if (InputMgr.TimeForwardDown && state != TimeControllState.Recording)
            {
                if (!ctrl.IsForwardEnd())
                {
                    RecordingTime = false;
                    PauseGame(false, false);
                    ctrl.ForwardTime();
                }
                else
                {
                    PauseGame(true, false);
                    ctrl.Freeze();
                }
            }
            else if (InputMgr.TimeForwardup && state != TimeControllState.Recording)
            {
                if (!ctrl.IsForwardEnd())
                {
                    RecordingTime = false;
                    PauseGame(true, false);
                    ctrl.Freeze();
                }
                else
                {
                    PauseGame(true, false);
                    ctrl.Freeze();
                    TimeController.Instance.ClearRewindData();
                }
            }
        }