private void LoadOrreryScene() { Debug.Log("Orrery Scene Loading"); UIManager.InitialiseOrreryUi(); Scene OrreryScene = SceneManager.GetSceneByName(SceneIndex.Orrery.SceneName()); Scene SceneSwappingFrom = SceneManager.GetActiveScene(); CameraRegistry.EnsureObjectsStayAlive(); SceneManager.SetActiveScene(OrreryScene); AsyncOperation Unloading = SceneManager.UnloadSceneAsync(SceneSwappingFrom); UIManager.TransitionToUIElements( UiElementTransitionType.Tracked, UIElements.OrreryUI ); // Debug //DebugCheckObject // = CameraRegistry[(int)CameraRoles.MainMenuAndOrrery].gameObject; //Debug.Log("MainMenuAndOrreryCamera is " // + (DebugCheckObject == null ? "null" : "not null") // + "\nCamera Registry: " // + CameraRegistry.PrintDebugDestroyedRegisteredObjectCheck() // + "\nPlanet Registry: " // + PlanetRegistry.PrintDebugDestroyedRegisteredObjectCheck() // + "\nUIManager is " // + (UIManager == null ? "null" : "not null")); //GameObject OrreryCameraAfter // = GameObject.Find("Main Menu Background Camera(Clone)"); //Debug.Log(( OrreryCameraAfter == null ? "Could not find" : "Found") // + " the main menu background/orrery camera"); //UIManager.DebugLogRegistryStatus(); // end debug UIManager.CameraTransition(CameraRoles.FixedUi | CameraRoles.MainMenuAndOrrery); GameObject OrreryManagerHost = GameObject.Find("OrreryManager"); OrreryManager OrreryManager = OrreryManagerHost.GetComponent <OrreryManager>(); UIManager.SetOrreryManager(OrreryManager); Camera MainMenuBackgroundCamera = CameraRegistry[(int)CameraRoles.MainMenuAndOrrery] .GetComponent <Camera>(); MyContract.RequireFieldNotNull(MainMenuBackgroundCamera, "MainMenuBackgroundCamera"); OrreryManager.UseProvidedCameraAsMainCamera( MainMenuBackgroundCamera ); }
public void SetOrreryManager(OrreryManager newOrreryManager) { OrreryManager = newOrreryManager; OrreryUiManager.OrreryManager = newOrreryManager; }