private void StartNewGame() { _hasSaveData = false; _saveSystem.WriteEmptySaveFile(); _saveSystem.SetNewGameData(); _loadLocation.RaiseEvent(_locationsToLoad, _showLoadScreen); }
void StartNewGame() { _hasSaveData = false; _saveSystem.WriteEmptySaveFile(); _saveSystem.SetNewGameData(); //Start new game _startGameEvent.RaiseEvent(_locationsToLoad, _showLoadScreen); }
public void OnPlayButtonPress() { if (!_hasSaveData) { //Start new game onPlayButtonPress.RaiseEvent(locationsToLoad, showLoadScreen); } else { //Load Game StartCoroutine(LoadSaveGame()); } }
private void OnTriggerEnter2D(Collider2D collision) { if (collision.gameObject.layer == playerId) { loadEventChannelSO.RaiseEvent(nextLevelScene, _showLoadScreen); } }
IEnumerator RaiseLoadEndMenuEvent() { yield return(new WaitForSeconds(5f)); _onFinalCutsceneEnded.RaiseEvent(locationsToLoad, showLoadScreen); }
private void OnTriggerEnter(Collider other) { if (other.CompareTag("Player")) { _locationExitLoadChannel.RaiseEvent(_locationsToLoad, _showLoadScreen); } }
private void LoadMainMenu(AsyncOperationHandle <LoadEventChannelSO> obj) { LoadEventChannelSO loadEventChannelSO = (LoadEventChannelSO)_menuLoadChannel.Asset; loadEventChannelSO.RaiseEvent(_menuToLoad); SceneManager.UnloadSceneAsync(0); //Initialization is the only scene in BuildSettings, thus it has index 0 }
private void OnTriggerEnter(Collider other) { if (other.CompareTag("Player")) { _pathStorage.lastPathTaken = _leadsToPath; _locationExitLoadChannel.RaiseEvent(_locationToLoad, false, true); } }
private void ReloadScene(AsyncOperationHandle <LoadEventChannelSO> obj) { LoadEventChannelSO loadEventChannelSO = (LoadEventChannelSO)_loadSceneEventChannel.Asset; loadEventChannelSO.RaiseEvent(new GameSceneSO[] { _thisSceneSO }); SceneManager.UnloadSceneAsync(_thisSceneSO.sceneReference.editorAsset.name); }
void BackToMainMenu(bool confirm) { HideBackToMenuConfirmationPopup(); // hide confirmation screen, show close UI pause, if (confirm) { CloseUIPause(); //close ui pause to unsub from all events _loadMenuEvent.RaiseEvent(_mainMenu, false); //load main menu } }
public void Teleport(LocationSO where, PathSO whichEntrance) { //Avoid reloading the same Location, which would result in an error if (where == _lastLocationTeleportedTo) { return; } _path.lastPathTaken = whichEntrance; _lastLocationTeleportedTo = where; _loadLocationRequest.RaiseEvent(where); }
IEnumerator loadScene(string scenePath) { AsyncOperation loadingSceneAsyncOp = SceneManager.LoadSceneAsync(scenePath, LoadSceneMode.Additive); //Wait until we are done loading the scene while (!loadingSceneAsyncOp.isDone) { yield return(null); } //Raise the event to load the main menu _MenuLoadChannel.RaiseEvent(_MenuToLoad, _showLoadScreen); }
public void OnPlayButtonPress() { onPlayButtonPress.RaiseEvent(locationsToLoad, showLoadScreen); }
void StartNewGame() { _startGameEvent.RaiseEvent(_locationToLoad, _showLoadScreen); }
public void LoadSceneAction() { onLoadEvent.RaiseEvent(locationsToLoad, showLoadScreen); }
//Used to load a location from a custscene public void LoadScene() { _sceneLoadChannel.RaiseEvent(_sceneToLoad, false, true); }
public void OnPlayButtonClicked() { _loadEventChannel.RaiseEvent(_locationsToLoad, _enableLoadingScreen); }
private void OnNotifyChannelLoaded(AsyncOperationHandle <LoadEventChannelSO> obj) { LoadEventChannelSO loadEventChannelSO = (LoadEventChannelSO)_notifyColdStartupChannel.Asset; loadEventChannelSO.RaiseEvent(_thisSceneSO); }
//Used to load a location from a custscene public void LoadScene() { _locationExitLoadChannel.RaiseEvent(_locationToLoad, false, true); }