For AI agents: the complete documentation index is available at /quick-save/en/llms.txt, the full documentation bundle is available at /quick-save/en/llms-full.txt, and this page is available as Markdown at /quick-save/en/api/methods.md.

QuickSave<T> Methods

Public method reference for QuickSave<T>.

Generic constraint: where T : class


SaveData

public void SaveData(T data)

Serializes data with MemoryPack and writes it to a file. If encryption is enabled, the binary is encrypted after serialization.

ParameterTypeDescription
dataTThe object to save
save.SaveData(player);

SaveDataAsync

public Task SaveDataAsync(T data)

Async version of SaveData. Does not block the main thread.

await save.SaveDataAsync(player);

LoadData

public T LoadData()

Reads the save file and returns the deserialized object.

Return valueCondition
T instanceSuccessfully loaded
nullFile does not exist
Throws InvalidDataExceptionFile exists but deserialization fails
try
{
    var data = save.LoadData();
    if (data == null) { /* no file */ }
}
catch (InvalidDataException e)
{
    Debug.LogError(e.Message); // corrupted file
}

LoadDataAsync

public Task<T> LoadDataAsync()

Async version of LoadData.

var data = await save.LoadDataAsync();

HasSaveData

public bool HasSaveData()

Returns true if the save file exists, false otherwise. Use this to check for a file before calling LoadData.

if (save.HasSaveData())
{
    var data = save.LoadData();
}

DeleteData

public void DeleteData()

Deletes the save file. Does nothing if the file doesn't exist.

save.DeleteData();