Deleting

How to delete data from SaveStates.

Single

Use the DeleteData method to delete saved data with a specific ID.

saveState.DeleteData("MyDataID");

This method returns a Save Operation (result type: bool). The result is true if the data was successfully deleted. Otherwise, false.

Multiple

You can also delete multiple data with the DeleteData method. Simply provide the ID of each of the data that you'd like to delete.

saveState.DeleteData("MyDataID1", "MyDataID2");

This method returns a Save Operation (result type: bool). The result is true if all specified data's were deleted. If even one fails, the result is false.

All

The DeleteAllData method deletes all saved data, completely emptying a save state. This does not remove the save state itself.

saveState.DeleteAllData();

This method returns a Save Operation (result type: bool). The result in this case is irrelevant (always true).

Last updated