public void Init() { Current = this; HealthUI = GetComponentInChildren <HealthUI>(); HealthUI.Init(); ScoreUI = GetComponentInChildren <ScoreUI>(); ScoreUI.Init(); LivesUI = GetComponentInChildren <LivesUI>(); LivesUI.Init(); EndUI = GetComponentInChildren <EndUI>(); EndUI.Init(); }
/// <summary> /// Resets game if button is pressed. /// </summary> public void Yes() { GameManager.Instance.score.CurrentScore = 0; GameManager.Instance.Player.ResetUnit(); List <Unit> enemies = GameManager.Instance.Enemies; foreach (Unit unit in enemies) { unit.ResetUnit(); } EndUI.InitItems(); Time.timeScale = 1; }