File tree Expand file tree Collapse file tree 1 file changed +10
-0
lines changed
UOP1_Project/Assets/Scripts/SceneManagement Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -15,6 +15,7 @@ public class EditorColdStartup : MonoBehaviour
1515 [ SerializeField ] private AssetReference _notifyColdStartupChannel = default ;
1616 [ SerializeField ] private VoidEventChannelSO _onSceneReadyChannel = default ;
1717 [ SerializeField ] private PathStorageSO _pathStorage = default ;
18+ [ SerializeField ] private SaveSystem _saveSystem = default ;
1819
1920 private bool isColdStart = false ;
2021
@@ -28,6 +29,7 @@ private void Awake()
2829 //Reset the path taken, so the character will spawn in this location's default spawn point
2930 _pathStorage . lastPathTaken = null ;
3031 }
32+ CreateSaveFileIfNotPresent ( ) ;
3133 }
3234
3335 private void Start ( )
@@ -64,5 +66,13 @@ private void OnNotifyChannelLoaded(AsyncOperationHandle<LoadEventChannelSO> obj)
6466 //When this happens, the player won't be able to move between scenes because the SceneLoader has no conception of which scene we are in
6567 }
6668 }
69+
70+ private void CreateSaveFileIfNotPresent ( )
71+ {
72+ if ( _saveSystem != null && ! _saveSystem . LoadSaveDataFromDisk ( ) )
73+ {
74+ _saveSystem . WriteEmptySaveFile ( ) ;
75+ }
76+ }
6777#endif
6878}
You can’t perform that action at this time.
0 commit comments