Exemplo n.º 1
0
        /// <summary>
        /// Shows the native achievement user interface, allowing the player to browse achievements.
        /// </summary>
        /// <param name="id">Current platform's ID for the leaderboard.</param>
        /// <param name="internalID">Internal CloudOnce ID, if available.</param>
        public void ShowOverlay(string id = "", string internalID = "")
        {
            if (!AGSPlayerClient.IsSignedIn())
            {
#if CLOUDONCE_DEBUG
                Debug.LogWarning("ShowOverlay can only be called after authentication.");
#endif
                return;
            }

            if (string.IsNullOrEmpty(id))
            {
#if CLOUDONCE_DEBUG
                Debug.Log("Showing leaderboards overlay.");
#endif
                AGSLeaderboardsClient.ShowLeaderboardsOverlay();
            }
            else
            {
#if CLOUDONCE_DEBUG
                Debug.Log(string.IsNullOrEmpty(internalID)
                    ? string.Format("Showing {0} leaderboard overlay.", id)
                    : string.Format("Showing {0} ({1}) leaderboard overlay.", internalID, id));
#endif
                AGSLeaderboardsClient.ShowLeaderboardsOverlay(id);
            }
        }
    /// <summary>
    /// Draws the menu. Note that this must be called from an OnGUI function.
    /// </summary>
    public override void DrawMenu()
    {
        // this button will open the leaderboard overlay.
        if (GUILayout.Button(DisplayLeaderboardOverlayButtonLabel))
        {
            AGSLeaderboardsClient.ShowLeaderboardsOverlay();
        }

        // If the leaderboard list has not been requested yet, display
        // a button that requests the leaderboard list.
        if (string.IsNullOrEmpty(requestLeaderboardsStatus))
        {
            if (GUILayout.Button(requestLeaderboardsButtonLabel))
            {
                RequestLeaderboards();
            }
        }
        else
        {
            // once a request has been made for the list of leaderboards,
            // display the status message of that process.
            AmazonGUIHelpers.CenteredLabel(requestLeaderboardsStatus);
            if (!string.IsNullOrEmpty(requestLeaderboardsStatusMessage))
            {
                AmazonGUIHelpers.CenteredLabel(requestLeaderboardsStatusMessage);
            }

            // If the leaderboards are not ready, display how long it has been since the request was put in.
            if (!leaderboardsReady)
            {
                AmazonGUIHelpers.CenteredLabel(string.Format(leaderboardRequestTimeLabel, (System.DateTime.Now - leaderboardsRequestTime).TotalSeconds));
            }
            else
            {
                // Once the leaderboard list request callback has been received,
                // display the leaderboards if available.
                if (null != leaderboardList && leaderboardList.Count > 0)
                {
                    foreach (AGSLeaderboard leaderboard in leaderboardList)
                    {
                        DisplayLeaderboard(leaderboard);
                    }
                }
                // If the leaderboards are not available, display a message explaining that.
                else
                {
                    AmazonGUIHelpers.CenteredLabel(noLeaderboardsAvailableLabel);
                }
                // display the invalid leaderboard (used to make sure GameCircle handles invalid data gracefully)
                if (null != invalidLeaderboard)
                {
                    DisplayLeaderboard(invalidLeaderboard);
                }
            }
        }
    }
Exemplo n.º 3
0
 public void ShowLeaderBoardPage()
 {
     if (AGSClient.IsServiceReady())
     {
         AGSLeaderboardsClient.ShowLeaderboardsOverlay();
     }
     else
     {
         Debug.Log("Show sigin page Service NOOOOOOT Ready");
     }
 }
Exemplo n.º 4
0
 public void ShowLeaderBoard()
 {
             #if AMAZON
     AGSLeaderboardsClient.ShowLeaderboardsOverlay();
             #else
     if (Social.localUser.authenticated)
     {
                     #if UNITY_ANDROID
         ((PlayGamesPlatform)Social.Active).ShowLeaderboardUI(Constants.LEADER_BOARD_ID);
                     #elif UNITY_IOS
         Social.ShowLeaderboardUI();
                     #endif
     }
     else
     {
         //			Debug.Log("Not signed so login");
         SignIn();
     }
             #endif
 }
Exemplo n.º 5
0
 /// <summary>
 /// Shows the leaderboard UI.
 /// </summary>
 public void ShowLeaderboardUI()
 {
     AGSLeaderboardsClient.ShowLeaderboardsOverlay();
 }
Exemplo n.º 6
0
 public void ShowLeaderboardsOverlay()
 {
             #if AMAZON_CIRCLE_ENABLED
     AGSLeaderboardsClient.ShowLeaderboardsOverlay();
             #endif
 }