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
15
15
[ SerializeField ] private AssetReference _notifyColdStartupChannel = default ;
16
16
[ SerializeField ] private VoidEventChannelSO _onSceneReadyChannel = default ;
17
17
[ SerializeField ] private PathStorageSO _pathStorage = default ;
18
+ [ SerializeField ] private SaveSystem _saveSystem = default ;
18
19
19
20
private bool isColdStart = false ;
20
21
@@ -28,6 +29,7 @@ private void Awake()
28
29
//Reset the path taken, so the character will spawn in this location's default spawn point
29
30
_pathStorage . lastPathTaken = null ;
30
31
}
32
+ CreateSaveFileIfNotPresent ( ) ;
31
33
}
32
34
33
35
private void Start ( )
@@ -64,5 +66,13 @@ private void OnNotifyChannelLoaded(AsyncOperationHandle<LoadEventChannelSO> obj)
64
66
//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
65
67
}
66
68
}
69
+
70
+ private void CreateSaveFileIfNotPresent ( )
71
+ {
72
+ if ( _saveSystem != null && ! _saveSystem . LoadSaveDataFromDisk ( ) )
73
+ {
74
+ _saveSystem . WriteEmptySaveFile ( ) ;
75
+ }
76
+ }
67
77
#endif
68
78
}
You can’t perform that action at this time.
0 commit comments