예제 #1
0
        private bool HandleMoveHold(TrainMove move, TrainState stateOnRelease)
        {
            var playerReleased = TrainMoves.GetKeyRelease(move);

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

            return(playerReleased);
        }
예제 #2
0
        // 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);
        }
예제 #3
0
        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();
            }
        }