Class IUsesCloudDataStorageMethods
Extension methods for cloud data storage users
Namespace: Unity.MARS
Syntax
public static class IUsesCloudDataStorageMethods
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 |
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, 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, 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. |
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 |