docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Access a save system

    The Platform Toolkit package can help manage save files when accessing an available save system. Save systems are available from user accounts on most common platforms.

    Access a platform-specific save system

    Use the following example to access a platform save system that's connected to a system-level user account:

    ISavingSystem savingSystem;
    
    if (PlatformToolkit.Capabilities.Accounts)
    {
       try
       {
           savingSystem = await account.GetSavingSystem();
       }
       catch (InvalidAccountException e)
       {
           // Handle signed out account
       }
    }
    else if (PlatformToolkit.Capabilities.LocalSaving)
    {
       savingSystem = PlatformToolkit.LocalSaving;
    }
    

    For more information, refer to the GetSavingSystem API reference.

    Access a local save system

    If your target platform doesn't have system-level user accounts, use the local saving system.

    Note

    Not all platforms support a local saving system. Check the capabilities of your target platform service to ensure you use the most appropriate system for your application.

    var savingSystem = PlatformToolkit.LocalSaving;
    

    Use the local saving system for platforms that don't support accounts, or for platforms where a user can decline to sign in but still continue to play the game.

    When developing for mobile platforms, you can use the local saving system when a user declines to sign into an account and then migrate the data later to an account saving system. Both local and account-based saving systems are accessible at the same time on mobile platforms.

    For more information, refer to the LocalSaving scripting API reference.

    Additional resources

    • Manage save files
    • GetSavingSystem scripting API reference
    • LocalSaving scripting API reference
    In This Article
    Back to top
    Copyright © 2026 Unity Technologies — Trademarks and terms of use
    • Legal
    • Privacy Policy
    • Cookie Policy
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)