コード例 #1
0
ファイル: Idle.cs プロジェクト: GTullemans/Examen_game
        private IEnumerator RandomIdle(RPGCharacterController controller)
        {
            float waitTime = Random.Range(15f, 25f);

            yield return(new WaitForSeconds(waitTime));

            // If we're not still idling, stop here.
            if (!IsActive())
            {
                randomIdleCoroutine = null;
                yield break;
            }

            if (controller.canMove)
            {
                controller.RandomIdle();
            }

            StartRandomIdleCountdown(controller);
        }