docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Class LocalPersistence

    This saves data locally onto the user's device.

    Inheritance
    object
    BaseDataPersistence
    LocalPersistence
    Implements
    IDataPersistence
    Inherited Members
    BaseDataPersistence.k_SaveVersion
    BaseDataPersistence.serializer
    Namespace: UnityEngine.GameFoundation.DataPersistence
    Assembly: solution.dll
    Syntax
    public class LocalPersistence : BaseDataPersistence, IDataPersistence

    Constructors

    Name Description
    LocalPersistence(IDataSerializer)

    Basic constructor that takes in a data serializer which this will use.

    Fields

    Name Description
    kBackupSuffix

    Methods

    Name Description
    Delete(string, Action, Action<Exception>)

    Asynchronously delete data from the persistence layer.

    GetFilePath(string)

    Get the file path for the given id.

    Load<TSerializableData>(string, Action<TSerializableData>, Action<Exception>)

    Asynchronously loads data from the persistence layer. Deserialized data, when loaded, are passed as second argument of the given onFinish Action. The generic param will be provided by the serializer underneath and need to implement ISerializableData

    Save(string, ISerializableData, Action, Action<Exception>)

    Asynchronously saves data onto the persistence layer. When the async save operation is done, onFinish Action get called.

    In This Article
    Back to top
    Copyright © 2024 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)