private bool HandleMoveHold(TrainMove move, TrainState stateOnRelease) { var playerReleased = TrainMoves.GetKeyRelease(move); if (playerReleased) { TrainController.TransitionState(stateOnRelease, null); } return(playerReleased); }
// 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); }
private void OnTriggerExit(Collider other) { if (!other.CompareTag("Player")) { return; } CurrObstacles[trainMove].Remove(this); if (isMoveHold && TrainMoves.GetKeyHold(Move)) { Debug.Log($"KEY HOLD! ({Move})"); OnPressedInZone(); } else if (!_succeeded) { SendEventUsingFields(); } }