Esempio n. 1
0
    private void StartNewGame()
    {
        _hasSaveData = false;

        _saveSystem.WriteEmptySaveFile();
        _saveSystem.SetNewGameData();
        _loadLocation.RaiseEvent(_locationsToLoad, _showLoadScreen);
    }
Esempio n. 2
0
    void StartNewGame()
    {
        _hasSaveData = false;

        _saveSystem.WriteEmptySaveFile();
        _saveSystem.SetNewGameData();
        //Start new game
        _startGameEvent.RaiseEvent(_locationsToLoad, _showLoadScreen);
    }
Esempio n. 3
0
 public void OnPlayButtonPress()
 {
     if (!_hasSaveData)
     {
         //Start new game
         onPlayButtonPress.RaiseEvent(locationsToLoad, showLoadScreen);
     }
     else
     {
         //Load Game
         StartCoroutine(LoadSaveGame());
     }
 }
Esempio n. 4
0
 private void OnTriggerEnter2D(Collider2D collision)
 {
     if (collision.gameObject.layer == playerId)
     {
         loadEventChannelSO.RaiseEvent(nextLevelScene, _showLoadScreen);
     }
 }
Esempio n. 5
0
    IEnumerator RaiseLoadEndMenuEvent()
    {
        yield return(new WaitForSeconds(5f));


        _onFinalCutsceneEnded.RaiseEvent(locationsToLoad, showLoadScreen);
    }
Esempio n. 6
0
 private void OnTriggerEnter(Collider other)
 {
     if (other.CompareTag("Player"))
     {
         _locationExitLoadChannel.RaiseEvent(_locationsToLoad, _showLoadScreen);
     }
 }
Esempio n. 7
0
    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
    }
Esempio n. 8
0
 private void OnTriggerEnter(Collider other)
 {
     if (other.CompareTag("Player"))
     {
         _pathStorage.lastPathTaken = _leadsToPath;
         _locationExitLoadChannel.RaiseEvent(_locationToLoad, false, true);
     }
 }
Esempio n. 9
0
    private void ReloadScene(AsyncOperationHandle <LoadEventChannelSO> obj)
    {
        LoadEventChannelSO loadEventChannelSO = (LoadEventChannelSO)_loadSceneEventChannel.Asset;

        loadEventChannelSO.RaiseEvent(new GameSceneSO[] { _thisSceneSO });

        SceneManager.UnloadSceneAsync(_thisSceneSO.sceneReference.editorAsset.name);
    }
Esempio n. 10
0
    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
        }
    }
Esempio n. 11
0
    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);
    }
Esempio n. 12
0
    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);
    }
Esempio n. 13
0
 public void OnPlayButtonPress()
 {
     onPlayButtonPress.RaiseEvent(locationsToLoad, showLoadScreen);
 }
Esempio n. 14
0
 void StartNewGame()
 {
     _startGameEvent.RaiseEvent(_locationToLoad, _showLoadScreen);
 }
Esempio n. 15
0
 public void LoadSceneAction()
 {
     onLoadEvent.RaiseEvent(locationsToLoad, showLoadScreen);
 }
Esempio n. 16
0
 //Used to load a location from a custscene
 public void LoadScene()
 {
     _sceneLoadChannel.RaiseEvent(_sceneToLoad, false, true);
 }
Esempio n. 17
0
 public void OnPlayButtonClicked()
 {
     _loadEventChannel.RaiseEvent(_locationsToLoad, _enableLoadingScreen);
 }
Esempio n. 18
0
    private void OnNotifyChannelLoaded(AsyncOperationHandle <LoadEventChannelSO> obj)
    {
        LoadEventChannelSO loadEventChannelSO = (LoadEventChannelSO)_notifyColdStartupChannel.Asset;

        loadEventChannelSO.RaiseEvent(_thisSceneSO);
    }
Esempio n. 19
0
 //Used to load a location from a custscene
 public void LoadScene()
 {
     _locationExitLoadChannel.RaiseEvent(_locationToLoad, false, true);
 }