Beispiel #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);
        }
Beispiel #2
0
        public override void OnUpdate()
        {
            _timeSinceEnter += Time.deltaTime;

            if (_timeSinceEnter >= _timeToExit)
            {
                TrainController.TransitionState(TrainController.DriveState, null);
            }
        }
Beispiel #3
0
        private bool HandleMoveHold(TrainMove move, TrainState stateOnRelease)
        {
            var playerReleased = TrainMoves.GetKeyRelease(move);

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

            return(playerReleased);
        }
Beispiel #4
0
 public void Init(TrainController train, Func <Transform, bool> condition)
 {
     _train     = train;
     _condition = condition;
 }
Beispiel #5
0
        private void TransitionWithMove(TrainMove move, TrainState state)
        {
            var obstacle = Obstacle.HandleMovePressed(move);

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