Data Management

How to manage save file data.

You may need to code a bit differently if you have background task enabled. See Understanding Background Save & Load

Getting the Save File

The first step to saving data is getting the save file. This can be done by getting the save file setup component first, which will give you access to the save file with SaveFileSetup.GetSaveFile. This can be skipped if you already have a save file reference.

saveFileSetup = GetComponent<SaveFileSetup>();
saveFile = saveFileSetup.GetSaveFile();

It's recommended to use this code in Awake or Start.

Last updated