diff --git a/Assets/Scripts/Managers/GameOverManager.cs b/Assets/Scripts/Managers/GameOverManager.cs index a1786ef243fd35dad19b15a21aa292c63ef11129..92e70281017331875d43bc274be30128e71ed1d7 100755 --- a/Assets/Scripts/Managers/GameOverManager.cs +++ b/Assets/Scripts/Managers/GameOverManager.cs @@ -4,28 +4,29 @@ using UnityEngine.SceneManagement; public class GameOverManager : MonoBehaviour { -Â Â Â public Text warningText; -Â Â Â public PlayerHealth playerHealth; -Â -Â Â Â Animator anim; -Â -Â Â Â void Awake() -Â Â Â { -Â Â Â Â Â Â Â anim = GetComponent<Animator>(); -Â Â Â } -Â -Â Â Â void Update() -Â Â Â { -Â Â Â Â Â Â Â if (playerHealth.currentHealth <= 0) -Â Â Â Â Â Â Â { -Â Â Â Â Â Â Â Â Â Â Â anim.SetTrigger("GameOver"); -Â Â Â Â Â Â Â } -Â Â Â } -Â -Â Â Â public void ShowWarning(float enemyDistance) -Â Â Â { -Â Â Â Debug.Log("SHOWWARNING"); -Â Â Â Â Â Â Â warningText.text = string.Format("! {0} m",Mathf.RoundToInt(enemyDistance)); -Â Â Â Â Â Â Â anim.SetTrigger("Warning"); -Â Â Â } + public Text warningText; + public PlayerHealth playerHealth; + + Animator anim; + + void Awake() + { + anim = GetComponent<Animator>(); + } + + void Update() + { + if (playerHealth.currentHealth <= 0) + { +Â Â Â Â Â Â Â Â Â Â Â //anim.SetTrigger("GameOver"); + SceneManager.LoadScene("GameOverScene"); + } + } + + public void ShowWarning(float enemyDistance) + { + Debug.Log("SHOWWARNING"); + warningText.text = string.Format("! {0} m", Mathf.RoundToInt(enemyDistance)); + anim.SetTrigger("Warning"); + } }