コード例 #1
0
ファイル: Laoding.cs プロジェクト: CastBart/All-Projects
        public void Update(GameTime gameTime)
        {
            Game.previousKeyBoardState = Game.aCurrentKeyboardState;
            Game.aCurrentKeyboardState = Keyboard.GetState();
            elapsed += (float)gameTime.ElapsedGameTime.TotalSeconds;

            if (elapsed <= 5)
            {
            }
            else
            {
                currentState = CurentState.Continue;
            }

            if (currentState == CurentState.Continue)
            {
                if (Game.aCurrentKeyboardState.IsKeyDown(Keys.Enter))
                {
                    Game.gameState = Game.GameMode.LicenceScreen;
                }
            }
            if (timer >= 150f)
            {
                timer = 0f;
            }
            else
            {
                timer++;
            }
        }
コード例 #2
0
        public void Update()
        {
            if (_pause)
            {
                return;
            }

            CurentState?.OnStateUpdate();
        }
コード例 #3
0
        private void SwitchToNewState(MainMenuStates nextState)
        {
            CurentState?.ExitState();

            CurentState = _availableStates[nextState];

            CurentState?.EnterState();

            OnStateChanged?.Invoke(CurentState);
        }
コード例 #4
0
        private void Update()
        {
            if (CurentState == null)
            {
                CurentState = _availableStates.Values.First();
                CurentState.EnterState();
            }

            MainMenuStates nextState = CurentState.Tick();

            Debug.Log(CurentState);

            PreviousState = CurentState;

            if (nextState != MainMenuStates.Null && _availableStates[nextState]?.GetType() != CurentState?.GetType())
            {
                SwitchToNewState(nextState);
            }
        }
コード例 #5
0
 public void SendNewStateToCurentState(int newState)
 {
     CurentState.ChangeState((MainMenuStates)(newState));
 }