示例#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);
        }