CloudOnce v2.7.5
Unified Game Services API
CloudOnce.Cloud Class Reference

Access point to the current platform-specific Cloud service provider More...

Static Public Member Functions

static void Initialize (bool activateCloudSave=true, bool autoSignIn=true, bool autoCloudLoad=true)
 Initializes the current cloud provider. More...
 
static void SignIn (bool autoCloudLoad=true, UnityAction< bool > callback=null)
 Signs in to the current cloud provider. More...
 
static void SignOut ()
 Signs out of the current cloud provider.
 
static void LoadUsers (string[] userIDs, Action< IUserProfile[]> callback)
 Load the user profiles associated with the given array of user IDs. More...
 

Properties

static UnityAction OnInitializeComplete
 Raised once the current platforms Initialize method is done.
 
static UnityAction< bool > OnSignedInChanged
 Raised after player signed in status changed. Parameter indicates whether the player was signed in or out.
 
static UnityAction OnSignInFailed
 Raised after an unsuccessful sign in attempt.
 
static UnityAction< Texture2D > OnPlayerImageDownloaded
 Raised if the currently signed in player's profile picture is successfully downloaded.
 
static UnityAction< bool > OnCloudSaveComplete
 Raised after an attempt has been made to save cloud data. Parameter indicates success.
 
static UnityAction< bool > OnCloudLoadComplete
 Raised after an attempt has been made to load cloud data. Parameter indicates success.
 
static UnityAction< string[]> OnNewCloudValues
 Raised if local data is changed as a result of loading cloud data. Returns a string array of the changed internal IDs.
 
static string ServiceName [get]
 Name of the currently used service, e.g. "Apple Game Center".
 
static string PlayerID [get]
 ID for currently signed in player. Will return an empty string if no player is signed in.
 
static string PlayerDisplayName [get]
 Display name for currently signed in player. Will return an empty string if no player is signed in.
 
static Texture2D PlayerImage [get]
 Profile picture for currently signed in player. Will return null if the user has no avatar, or it has not loaded yet.
 
static bool IsSignedIn [get]
 Whether or not the user is currently signed in.
 
static bool CloudSaveEnabled [get, set]
 Whether or not Cloud Save is enabled. Disabling Cloud Save will make Cloud.Storage.Save only save to disk. Can only be enabled if Cloud Save was initialized in Cloud.Initialize method.
 
static Interval AutoLoadInterval [get, set]
 How often to check for new cloud data.
 
static GenericLeaderboardsWrapper Leaderboards [get]
 Interface for accessing leaderboards on the current platform.
 
static GenericAchievementsWrapper Achievements [get]
 Interface for accessing achievements on the current platform.
 
static ICloudStorageProvider Storage [get]
 Interface for accessing cloud save on the current platform.
 

Detailed Description

Access point to the current platform-specific Cloud service provider

Member Function Documentation

◆ Initialize()

static void CloudOnce.Cloud.Initialize ( bool  activateCloudSave = true,
bool  autoSignIn = true,
bool  autoCloudLoad = true 
)
inlinestatic

Initializes the current cloud provider.

Parameters
activateCloudSaveWhether or not Cloud Saving should be activated.
autoSignInWhether or not SignIn will be called automatically once the cloud provider is initialized.
autoCloudLoadWhether or not cloud data should be loaded automatically if the user is successfully signed in. Ignored if Cloud Saving is deactivated or the user fails to sign in.

◆ LoadUsers()

static void CloudOnce.Cloud.LoadUsers ( string[]  userIDs,
Action< IUserProfile[]>  callback 
)
inlinestatic

Load the user profiles associated with the given array of user IDs.

Parameters
userIDsThe users to retrieve profiles for.
callbackCallback to handle the user profiles.

◆ SignIn()

static void CloudOnce.Cloud.SignIn ( bool  autoCloudLoad = true,
UnityAction< bool >  callback = null 
)
inlinestatic

Signs in to the current cloud provider.

Parameters
autoCloudLoadWhether or not cloud data should be loaded automatically when the user is successfully signed in. Ignored if Cloud Saving is deactivated or the user fails to sign in.
callbackThe callback to call when authentication finishes. It will be called with true if authentication was successful, false otherwise.

The documentation for this class was generated from the following file: