public void Initialize(ChallengeManager challengeManager) { manager = challengeManager; #if UNITY_EDITOR var activeScene = SceneManager.GetActiveScene(); var challengeScene = SceneManager.CreateScene("Challenges"); SceneManager.SetActiveScene(challengeScene); #endif for (int i = 0; i < challenges.Count; i++) { var challenge = challenges[i]; challenge.Initialize(this, i); } #if UNITY_EDITOR SceneManager.SetActiveScene(activeScene); #endif }
void Start() { challengeManager = ChallengeManager.Instance; challengeManager.ProgressChanged += OnProgressChanged; challengeManager.AllChallengesFinished += OnAllChallengesFinished; }