Example #1
0
 /// <summary>
 /// Show the build-in UI fora  particular leaderboard.
 /// </summary>
 /// <param name="id">Use class GPGIds to choose correct ID</param>
 public static void ShowUI(string id)
 {
     if (!AllInOneMobileSettings.Instance.useAchievements)
     {
         Debug.LogError("Game Services are disabled.");
         return;
     }
     GooglePlayServices.SignIn();
     GooglePlayGames.PlayGamesPlatform.Instance.ShowLeaderboardUI(id);
 }
Example #2
0
 /// <summary>
 /// Show the build-in UI for achievements.
 /// </summary>
 public static void ShowUI()
 {
     if (!AllInOneMobileSettings.Instance.useAchievements)
     {
         Debug.LogError("Game Services are disabled.");
         return;
     }
     GooglePlayServices.SignIn();
     Social.ShowAchievementsUI();
 }
Example #3
0
        /// <summary>
        /// Save score on leaderboard.
        /// </summary>
        /// <param name="id">Use class GPGIds to choose correct ID</param>
        /// <param name="score">Score to post</param>
        public static bool ReportScore(string id, long score)
        {
            if (!AllInOneMobileSettings.Instance.useAchievements)
            {
                Debug.LogError("Game Services are disabled.");
                return(false);
            }
            bool value = false;

            GooglePlayServices.SignIn();
            Social.ReportScore(score, id, succes => { value = succes; });
            return(value);
        }
Example #4
0
        /// <summary>
        /// Increase increment achievement.
        /// </summary>
        /// <param name="id">Use class GPGIds to choose correct ID</param>
        /// <param name="stepsToIncrement">Amount to increment</param>
        public static bool Increment(string id, int stepsToIncrement = 1)
        {
            if (!AllInOneMobileSettings.Instance.useAchievements)
            {
                Debug.LogError("Game Services are disabled.");
                return(false);
            }
            bool value = false;

            GooglePlayServices.SignIn();
            GooglePlayGames.PlayGamesPlatform.Instance.IncrementAchievement(id, stepsToIncrement,
                                                                            succes => { value = succes; });
            return(value);
        }