private void DoDeath() { Debug.Log("StopExplosion"); GameOverExplosive.StopExplosion(); if (TrainController.Instance.Lives == 0) { OnGameOver(); } else { Restart(); } }
public void OnDeath() { GameOverExplosive.Explode(); var livesRemaining = --TrainController.Instance.Lives; if (livesRemaining == 0) { Invoke(nameof(DoDeath), 5f); } else { Invoke(nameof(DoDeath), 2f); } sfxManager.TunnelBump.PlayRandomPitch(); }