public static void KillPlayer(Idle player) { BGMLvl.StopBGM(); SoundManager.PlaySound("death"); Destroy(player.gameObject); gm.StartCoroutine(gm.RespawnPlayer()); }
public IEnumerator RespawnPlayer() { yield return(new WaitForSeconds(spawnDelay)); Instantiate(playerPrefab.gameObject, spawnPoint.position, spawnPoint.rotation); SoundManager.PlaySound("start"); yield return(new WaitForSeconds(soundDelay)); BGMLvl.StartBGM(); }
public static void isWin() { BGMLvl.StopBGM(); if (score < 100) { //Game Over lives = 0; poinMin = true; SoundManager.PlaySound("gameOver"); } else { //win win = true; SoundManager.PlaySound("win"); } }