public void OnSceneChange(string sceneName) { UIManager.OnSceneChange(); Data.SetCurrentScene(sceneName); _sceneReferenceManager = GameObject.FindObjectOfType <SceneReferenceManager>(); _mageFactory.SetStationObjects(_sceneReferenceManager.StationObjects); WaveManager.SetWaypoints(_sceneReferenceManager.StartWaypoint, _sceneReferenceManager.EndWaypoint); for (var i = 0; i < _sceneReferenceManager.AllAssignableBuildings.Length; i++) { _sceneReferenceManager.AllAssignableBuildings[i].Initialize(i, this); } InitializeMages(); StartCoroutine(WaveManager.SendWave()); }