docs.unity3d.com
    Show / Hide Table of Contents

    Class IUsesCloudDataStorageMethods

    Extension methods for cloud data storage users

    Inheritance
    Object
    IUsesCloudDataStorageMethods
    Namespace: Unity.MARS.Providers
    Syntax
    public static class IUsesCloudDataStorageMethods : object

    Methods

    CloudLoadAsync(IUsesCloudDataStorage, String, Action<Boolean, Int64, Byte[]>, ProgressCallback)

    Load from the cloud asynchronously the data of an object which was saved with a known key

    Declaration
    public static void CloudLoadAsync(this IUsesCloudDataStorage user, string key, Action<bool, long, byte[]> callback, ProgressCallback progress = null)
    Parameters
    Type Name Description
    IUsesCloudDataStorage user

    The functionality user

    String key

    string that uniquely identifies this instance of the type.

    Action<Boolean, Int64, Byte[]> callback

    a callback which returns whether the operation was successful, as well as the response payload if it was.

    ProgressCallback progress

    Called every frame while the request is in progress with two 0-1 values indicating upload and download progress, respectively

    CloudLoadAsync(IUsesCloudDataStorage, String, Action<Boolean, Int64, String>, ProgressCallback)

    Load from the cloud asynchronously the data of an object which was saved with a known key

    Declaration
    public static void CloudLoadAsync(this IUsesCloudDataStorage user, string key, Action<bool, long, string> callback, ProgressCallback progress = null)
    Parameters
    Type Name Description
    IUsesCloudDataStorage user

    The functionality user

    String key

    string that uniquely identifies this instance of the type.

    Action<Boolean, Int64, String> callback

    a callback which returns whether the operation was successful, as well as the serialized string of the object if it was.

    ProgressCallback progress

    Called every frame while the request is in progress with two 0-1 values indicating upload and download progress, respectively

    CloudLoadTextureAsync(IUsesCloudDataStorage, String, LoadTextureCallback, ProgressCallback)

    Load a texture asynchronously from cloud storage

    Declaration
    public static void CloudLoadTextureAsync(this IUsesCloudDataStorage user, string key, LoadTextureCallback callback, ProgressCallback progress = null)
    Parameters
    Type Name Description
    IUsesCloudDataStorage user

    The functionality user

    String key

    String that uniquely identifies this instance of the type.

    LoadTextureCallback callback

    A callback which returns whether the operation was successful, as well as the response payload if it was. If the operation failed, the byte array will contain the error string

    ProgressCallback progress

    Called every frame while the request is in progress with two 0-1 values indicating upload and download progress, respectively

    CloudSaveAsync(IUsesCloudDataStorage, String, Byte[], Action<Boolean, Int64, String>, ProgressCallback)

    Save to the cloud asynchronously the data of an object of a certain type with a specified key

    Declaration
    public static void CloudSaveAsync(this IUsesCloudDataStorage user, string key, byte[] bytes, Action<bool, long, string> callback = null, ProgressCallback progress = null)
    Parameters
    Type Name Description
    IUsesCloudDataStorage user

    The functionality user

    String key

    string that uniquely identifies this instance of the type.

    Byte[] bytes

    bytes to save.

    Action<Boolean, Int64, String> callback

    a callback when the asynchronous call is done to show whether it was successful.

    ProgressCallback progress

    Called every frame while the request is in progress with two 0-1 values indicating upload and download progress, respectively

    CloudSaveAsync(IUsesCloudDataStorage, String, String, Action<Boolean, Int64, String>, ProgressCallback)

    Save to the cloud asynchronously the data of an object with a specified key

    Declaration
    public static void CloudSaveAsync(this IUsesCloudDataStorage user, string key, string serializedObject, Action<bool, long, string> callback = null, ProgressCallback progress = null)
    Parameters
    Type Name Description
    IUsesCloudDataStorage user

    The functionality user

    String key

    string that uniquely identifies this instance of the type.

    String serializedObject

    string serialization of the object being saved.

    Action<Boolean, Int64, String> callback

    a callback when the asynchronous call is done to show whether it was successful.

    ProgressCallback progress

    Called every frame while the request is in progress with two 0-1 values indicating upload and download progress, respectively

    GetAPIKey(IUsesCloudDataStorage)

    Get the current API key

    Declaration
    public static string GetAPIKey(this IUsesCloudDataStorage user)
    Parameters
    Type Name Description
    IUsesCloudDataStorage user

    The functionality user

    Returns
    Type Description
    String

    The current API key

    GetProjectIdentifier(IUsesCloudDataStorage)

    Get the current project identifier

    Declaration
    public static string GetProjectIdentifier(this IUsesCloudDataStorage user)
    Parameters
    Type Name Description
    IUsesCloudDataStorage user

    The functionality user

    Returns
    Type Description
    String

    The current project identifier

    IsConnected(IUsesCloudDataStorage)

    Get the current state of the connection to the cloud storage

    Declaration
    public static bool IsConnected(this IUsesCloudDataStorage user)
    Parameters
    Type Name Description
    IUsesCloudDataStorage user

    The functionality user

    Returns
    Type Description
    Boolean

    True if the Cloud Storage is connected to this client, false otherwise.

    LoadLocalTextureAsync(IUsesCloudDataStorage, String, LoadTextureCallback, ProgressCallback)

    Load a texture asynchronously from local storage

    Declaration
    public static void LoadLocalTextureAsync(this IUsesCloudDataStorage user, string path, LoadTextureCallback callback, ProgressCallback progress = null)
    Parameters
    Type Name Description
    IUsesCloudDataStorage user

    The functionality user

    String path

    Path to the texture.

    LoadTextureCallback callback

    A callback which returns whether the operation was successful, as well as the response payload if it was. If the operation failed, the byte array will contain the error string

    ProgressCallback progress

    Called every frame while the request is in progress with two 0-1 values indicating upload and download progress, respectively

    SetAPIKey(IUsesCloudDataStorage, String)

    Set the current API key

    Declaration
    public static void SetAPIKey(this IUsesCloudDataStorage user, string token)
    Parameters
    Type Name Description
    IUsesCloudDataStorage user

    The functionality user

    String token

    The API key to set

    SetProjectIdentifier(IUsesCloudDataStorage, String)

    Set the current project identifier

    Declaration
    public static void SetProjectIdentifier(this IUsesCloudDataStorage user, string id)
    Parameters
    Type Name Description
    IUsesCloudDataStorage user

    The functionality user

    String id

    The project identifier to set

    Back to top
    Copyright © 2023 Unity Technologies — Terms of use
    • Legal
    • Privacy Policy
    • Cookies
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)
    "Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
    Generated by DocFX on 18 October 2023