コード例 #1
0
 void RestartGame()
 {
     if (isInPauseMenu && !isQuitting && Input.GetKeyDown(KeyCode.R))
     {
         isInPauseMenu = false;
         player        = Instantiate(playerPrefab);
         player.ResetCharacter();
         timer.ResetTimer();
         pauseScreen.SetActive(false);
         isGameOver = true;
         monsterSpawner.gameObject.SetActive(true);
         RPGCameraManager.sharedInstance.virtualCamera.Follow = player.transform;
         monsterSpawner.KillAllMonsters();
         monsterSpawner.DestroyLoot();
         monsterSpawner.ResetInterval();
         score.value    = 0;
         Time.timeScale = 1f;
     }
 }