private void LoadMainScreen(AsyncOperationHandle <LoadSceneRequestSO> obj) { // Request to load scenes LoadSceneRequestSO loadSceneRequest = (LoadSceneRequestSO)_loadSceneRequest.Asset; if (loadSceneRequest != null) { loadSceneRequest.RaiseEvent(_sceneToLoad); } // Unload the initialization scene // It is the only scene in BuildSettings, thus it has index 0 SceneManager.UnloadSceneAsync(0); }
public void OnPlayButtonPress() { if (!_hasSaveData) { //saveSystem.WriteEmptySaveFile(); //Start new game _onPlayButtonPress.RaiseEvent(_scenesToLoad, _showLoadScreen); } else { //Load Game //StartCoroutine(LoadSaveGame()); } }