Writing Changes
Officially saving the data.
Saving, Loading, and Deleting, only edit the save data in memory. The changes aren't officially saved until the Save
method is called.
Why Is It Like This?
There are 2 reasons as to why the data management methods don't automatically call Save
:
The
Save
method writes data directly to a file on the user's system—a process that can be time-consuming, especially with large amounts of data. IfSave
was called automatically every timeAddOrUpdateData
orDeleteData
was used, it would affect performance.You can give players control over when their data is officially saved—for example, by letting them manually save through a dedicated save menu. This approach allows
AddOrUpdateData
andDeleteData
to be used frequently during gameplay to modify player data while reservingSave
for moments when the data needs to be officially written into the save file.
Last updated