private void SceneManagerOnActiveSceneChanged(Scene arg0, Scene scene) { if (scene.buildIndex > 0) { if (FirstFetch) { Console.WriteLine("Launching coroutine to grab original sabers!"); SharedCoroutineStarter.instance.StartCoroutine(PreloadDefaultSabers()); Console.WriteLine("Launched!"); } } if (scene.name == "GameCore") { LoadNewSaber(_currentSaberPath); SaberScript.LoadAssets(); } if (scene.name == "Menu") { if (_currentSaber != null) { _currentSaber.Unload(true); } CustomSaberUI.OnLoad(); } }
public void OnUpdate() { if (_currentSaber == null) { return; } if (Input.GetKeyDown(KeyCode.Space)) { RetrieveCustomSabers(); if (_saberPaths.Count == 1) { return; } var oldIndex = _saberPaths.IndexOf(_currentSaberPath); if (oldIndex >= _saberPaths.Count - 1) { oldIndex = -1; } var newSaber = _saberPaths[oldIndex + 1]; LoadNewSaber(newSaber); if (SceneManager.GetActiveScene().buildIndex != 4) { return; } SaberScript.LoadAssets(); } else if (Input.GetKeyDown(KeyCode.Space) && Input.GetKey(KeyCode.LeftAlt)) { RetrieveCustomSabers(); if (_saberPaths.Count == 1) { return; } var oldIndex = _saberPaths.IndexOf(_currentSaberPath); if (oldIndex <= 0) { oldIndex = _saberPaths.Count - 1; } var newSaber = _saberPaths[oldIndex - 1]; LoadNewSaber(newSaber); if (SceneManager.GetActiveScene().buildIndex != 4) { return; } SaberScript.LoadAssets(); } }
private void SceneManagerOnActiveSceneChanged(Scene arg0, Scene scene) { if (scene.name == "NiceEnvironment" || scene.name == "DefaultEnvironment" || scene.name == "BigMirrorEnvironment" || scene.name == "TriangleEnvironment") { LoadNewSaber(_currentSaberPath); SaberScript.LoadAssets(); } if (scene.name == "Menu") { if (_currentSaber != null) { _currentSaber.Unload(true); } CustomSaberUI.OnLoad(); } }
private void SceneManagerOnActiveSceneChanged(Scene arg0, Scene scene) { if (scene.name == "StandardLevel") { LoadNewSaber(_currentSaberPath); SaberScript.LoadAssets(); } if (scene.name == "Menu") { if (_currentSaber != null) { _currentSaber.Unload(true); } CustomSaberUI.OnLoad(); } }
public void OnActiveSceneChanged(Scene from, Scene to) { //if (scene.buildIndex > 0) //{ // if (FirstFetch) // { // //Logger.Log("Launching coroutine to grab original sabers!", LogLevel.Debug); // //SharedCoroutineStarter.instance.StartCoroutine(PreloadDefaultSabers()); // //Logger.Log("Launched!", LogLevel.Debug); // } //} if (to.name == "GameCore") { LoadNewSaber(_currentSaberName); SaberScript.LoadAssets(); } if (to.name == "MenuCore") { CustomSaberUI.OnLoad(); } }