Exemple #1
0
    /// <summary>
    /// Requests the local player data from the GameCircle plugin.
    /// </summary>
    void RequestLocalPlayerData()
    {
        // Need to subscribe to callback messages to receive the player from GameCircle.
        SubscribeToPlayerEvents();
        // Request the player from the GameCircle plugin
        AGSPlayerClient.RequestLocalPlayer();

        // update the menu to show that the retrieval process has begun.
        playerStatus = playerRetrievingLabel;
    }
        private void OnSignedInStateChangedEvent(bool signedIn)
        {
            if (signedIn)
            {
#if CLOUDONCE_DEBUG
                Debug.Log("Signed in to Amazon GameCircle.");
#endif
                if (CloudSaveInitialized && cloudSaveEnabled && autoLoadOnSignInEnabled)
                {
                    Cloud.Storage.Load();
                }

                AGSPlayerClient.RequestLocalPlayer();
                UpdateAchievementsData();
            }
            else
            {
#if CLOUDONCE_DEBUG
                Debug.Log("Signed out of Amazon GameCircle.");
#endif
            }

            cloudOnceEvents.RaiseOnSignedInChanged(signedIn);
        }
 /// <summary>
 /// Authenticate the local user with the active Social plugin.
 /// </summary>
 /// <param name='callback'>
 /// Callback.
 /// </param>
 public void Authenticate(System.Action <bool> callback)
 {
     // The Unity Social API implies a heavy connection between
     // initialization of the Social API and the local user.
     // http://docs.unity3d.com/Documentation/Components/net-SocialAPI.html
     // This means that the local player should be available as early as possible.
     callback += (successStatus) => {
         if (successStatus)
         {
             // On a successful initialization of the GameCircle through
             // the Unity Social API, immediately begin the process
             // of retrieving the local player.
             AGSPlayerClient.PlayerReceivedEvent += (player) => {
                 this.player = player;
             };
             AGSPlayerClient.RequestLocalPlayer();
         }
         else
         {
             player = null;
         }
     };
     Social.Active.Authenticate(this, callback);
 }
 public void RequestLocalPlayer(Action <bool> callback)
 {
     simpleCallbacks.Add(requestID, callback);
     AGSPlayerClient.RequestLocalPlayer(requestID++);
 }
Exemple #5
0
 public void RetrieveLocalPlayer()
 {
             #if AMAZON_CIRCLE_ENABLED
     AGSPlayerClient.RequestLocalPlayer();
             #endif
 }