void Update() { if (castle1.GetCastleHealth() <= 0) { changeScene = true; scene = 3; } if (castle2.GetCastleHealth() <= 0) { changeScene = true; scene = 2; } if (changeScene) { time -= Time.deltaTime; } if (time < 0) { SceneManager.LoadScene(scene); } }