Beispiel #1
0
        /// <summary>
        /// アバター配置
        /// </summary>
        /// <param name="autoStartTimer">タイマーを作動させるかどうか</param>
        public void SpawnAvatar(bool autoStartTimer = true)
        {
            // 2回インクリメントして正しくない挙動ですが、
            // 運用中のランキングに影響出るので仕様としました><
            var nextNum     = (int)_spawnNumCurve.Evaluate(++_spawnCount);
            var nextTrapNum = (int)_spawnTrapNumCurve.Evaluate(++_spawnCount);

            do
            {
                // ダンジョン自動生成
                _mazeGenerator.GenerateMaze();

                // 各種オブジェクト配置
                _mazeGenerator.ClearObjects();
                _mazeGenerator.SpawnGoal(nextNum);
                _mazeGenerator.SpawnAvatar(nextNum);
                _mazeGenerator.SpawnTrap(nextTrapNum);

                // 迷路が狭すぎてアバターを配置できない場合は、生成からやり直す
                var spawnedObjects = _mazeGenerator.GetSpawnedObjects();
                if (spawnedObjects.Exists(x => x.GetComponent <AvatarControlChecker>() != null))
                {
                    break;
                }
            } while (true);

            _timer.StopTimer();
            if (autoStartTimer)
            {
                _timer.StartTimer();
            }
        }
Beispiel #2
0
 private void StopShootBallCoroutines()
 {
     if (shootTimerCoroutine != null)
     {
         circularTimer?.StopTimer();
         StopCoroutine(shootTimerCoroutine);
         shootTimerCoroutine = null;
     }
     if (chargeShotCoroutine != null)
     {
         shotChargeIndicator.Stop();
         StopCoroutine(chargeShotCoroutine);
         chargeShotCoroutine = null;
     }
 }
    private void StopShootBallCoroutines()
    {
        if (shootTimer != null)
        {
            circularTimer?.StopTimer();
            StopCoroutine(shootTimer);
            shootTimer = null;
        }
        if (chargeShot != null)
        {
            shotChargeIndicator.Stop();
            StopCoroutine(chargeShot);
            chargeShot = null;
        }

        playerMovement.freezeRotation = false;
    }