Пример #1
0
        private void TransitionWithMove(TrainMove move, TrainState state, bool immediate = false)
        {
            var obstacle = Obstacle.HandleMovePressed(move);

            var moveCue = GetMoveCue(obstacle, immediate);

            TrainController.TransitionState(state, moveCue);
        }
Пример #2
0
        private bool HandleMoveHold(TrainMove move, TrainState stateOnRelease)
        {
            var playerReleased = TrainMoves.GetKeyRelease(move);

            if (playerReleased)
            {
                TrainController.TransitionState(stateOnRelease, null);
            }

            return(playerReleased);
        }
Пример #3
0
        // protected bool HandleHonk()
        // {
        //     var honk = TrainMoves.GetKeyDown(TrainMove.Honk);
        //     if (!honk) return false;
        //
        //     TrainController.Instance.HonkAnim();
        //     var obstacle = Obstacle.HandleMovePressed(TrainMove.Honk);
        //     return obstacle != null;
        // }


        private bool HandleMoveTransition(TrainMove move, TrainState state, bool immediate = false)
        {
            var playerPressed = TrainMoves.GetKeyDown(move);

            if (playerPressed)
            {
                TransitionWithMove(move, state, immediate);
            }

            return(playerPressed);
        }
Пример #4
0
 public TrainJumpState(float timeToExit, TrainState autoExitState) : base(timeToExit, autoExitState)
 {
 }
Пример #5
0
 public AutoExitTrainState(float timeToExit, TrainState autoExitState)
 {
     AutoExitState = autoExitState;
     _timeToExit   = timeToExit;
 }
Пример #6
0
        private void TransitionWithMove(TrainMove move, TrainState state)
        {
            var obstacle = Obstacle.HandleMovePressed(move);

            TrainController.TransitionState(state, obstacle ? obstacle.MoveCue : null);
        }