Exemple #1
0
 public void PlayerDie()
 {
     if (myPlayer.player1 == true)
     {
         recipeBookScript_P1.ExitCookingStationDelayFunction();
         esP1.DestroyAllEnemies();
         esP1.enemySpawnerActive = false;
         esP1.enemyReadyToSpawn  = false;
         esP1.enemySpawnTimer    = 0;
     }
     else if (myPlayer.player2 == true)
     {
         recipeBookScript_P2.ExitCookingStationDelayFunction();
         esP2.DestroyAllEnemies();
         esP2.enemySpawnerActive = false;
         esP2.enemyReadyToSpawn  = false;
         esP2.enemySpawnTimer    = 0;
     }
     else if (myPlayer.player3 == true)
     {
         recipeBookScript_P3.ExitCookingStationDelayFunction();
         esP3.DestroyAllEnemies();
         esP3.enemySpawnerActive = false;
         esP3.enemyReadyToSpawn  = false;
         esP3.enemySpawnTimer    = 0;
     }
     else if (myPlayer.player4 == true)
     {
         recipeBookScript_P4.ExitCookingStationDelayFunction();
         esP4.DestroyAllEnemies();
         esP4.enemySpawnerActive = false;
         esP4.enemyReadyToSpawn  = false;
         esP4.enemySpawnTimer    = 0;
     }
     StartCoroutine(CloseControls());
     SFX_PlayerDie.Play();
     StartCoroutine(Die());
 }