AutoSaveAsync

AutoSaveAsync(string key, Transform transform, int intervalSeconds, CancellationToken cancellationToken)

Purpose: Periodically saves an array of Transform objects asynchronously at set intervals.

Parameters:

  • key: A string for the save path.

  • transforms: An array of Transform objects to save periodically.

  • intervalSeconds: The interval between saves in seconds.

  • cancellationToken: A token to signal cancellation.

Return Value: An async Task.

Sample uses:

public void  AutoSave()
{
    TransformSaveManager.AutoSaveAsync(DATA_KEY, _transform, 3, _cancellationToken);
}

Sample uses for multiple objects:

public void AutoSaveAll()
{
    TransformSaveManager.AutoSaveAsync(DATA_KEY, _transforms, 3, _cancellationToken);
}

Last updated