private void TransitionWithMove(TrainMove move, TrainState state, bool immediate = false) { var obstacle = Obstacle.HandleMovePressed(move); var moveCue = GetMoveCue(obstacle, immediate); TrainController.TransitionState(state, moveCue); }
public override void OnUpdate() { _timeSinceEnter += Time.deltaTime; if (_timeSinceEnter >= _timeToExit) { TrainController.TransitionState(TrainController.DriveState, null); } }
private bool HandleMoveHold(TrainMove move, TrainState stateOnRelease) { var playerReleased = TrainMoves.GetKeyRelease(move); if (playerReleased) { TrainController.TransitionState(stateOnRelease, null); } return(playerReleased); }
public void Init(TrainController train, Func <Transform, bool> condition) { _train = train; _condition = condition; }
private void TransitionWithMove(TrainMove move, TrainState state) { var obstacle = Obstacle.HandleMovePressed(move); TrainController.TransitionState(state, obstacle ? obstacle.MoveCue : null); }