예제 #1
0
        protected virtual void CheckUpSelection()
        {
            // no relavent input, restart cooldown
            if (!playerInput.IsUpPress() && !playerInput.IsUp())
            {
                upWait.StopCoroutine();
                return;
            }

            // single press, just move along
            if (playerInput.IsUpPress())
            {
                MoveUp();
                upWait.StartCoroutine();
                return;
            }

            // hold, go if off cooldown
            if (playerInput.IsUp())
            {
                if (upWait.IsRunning)
                {
                    return;
                }
                MoveUp();
                upWait.StartCoroutine();
            }
        }