Skip to content

Commit 6896c89

Browse files
committed
Merge branch 'pr/396' into main
2 parents f05a402 + 5663f57 commit 6896c89

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

UOP1_Project/Assets/Scripts/SceneManagement/EditorColdStartup.cs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff 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
}

0 commit comments

Comments
 (0)