예제 #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
        public override void OnUpdate()
        {
            _timeSinceEnter += Time.deltaTime;

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

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

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

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