浏览代码

Create save file on editor cold startup if needed

/main
fqureshi 4 年前
当前提交
7c507f4a
共有 2 个文件被更改,包括 11 次插入0 次删除
  1. 1
      UOP1_Project/Assets/Prefabs/Gameplay/EditorInitializer.prefab
  2. 10
      UOP1_Project/Assets/Scripts/SceneManagement/EditorColdStartup.cs

1
UOP1_Project/Assets/Prefabs/Gameplay/EditorInitializer.prefab


m_SubObjectName:
m_SubObjectType:
m_EditorAssetChanged: 0
_saveSystem: {fileID: 11400000, guid: edc355c4a7d5028408d322b90814e19e, type: 2}

10
UOP1_Project/Assets/Scripts/SceneManagement/EditorColdStartup.cs


[SerializeField] private GameSceneSO _thisSceneSO = default;
[SerializeField] private GameSceneSO _persistentManagersSO = default;
[SerializeField] private AssetReference _notifyColdStartupChannel = default;
[SerializeField] private SaveSystem _saveSystem = default;
private void Start()
{

}
CreateSaveFileIfNotPresent();
}
private void LoadEventChannel(AsyncOperationHandle<SceneInstance> obj)

{
LoadEventChannelSO loadEventChannelSO = (LoadEventChannelSO)_notifyColdStartupChannel.Asset;
loadEventChannelSO.RaiseEvent(_thisSceneSO);
}
private void CreateSaveFileIfNotPresent()
{
if (_saveSystem != null && !_saveSystem.LoadSaveDataFromDisk())
{
_saveSystem.WriteEmptySaveFile();
}
}
#endif
}
正在加载...
取消
保存