Search Unity

Why unity 5.5 not support "using GooglePlayGames?

Discussion in 'Scripting' started by rhendra, Jan 20, 2019.

  1. rhendra

    rhendra

    Joined:
    Dec 27, 2017
    Posts:
    44
    help me please.......
    I try this script in unity 5.5 but that doesnt support.
    mynotebook just suppoort unity 5.5, but i need add a leaderboard to my game.
    what should I do?

    Code (csharp):
    1.  
    2. using GooglePlayGames;
    3. using GooglePlayGames.BasicApi;
    4. using UnityEngine;
    5.  
    6. public class PlayGamesScript : MonoBehaviour {
    7.  
    8. // Use this for initialization
    9. void Start () {
    10.         PlayGamesClientConfiguration config = new PlayGamesClientConfiguration.Builder().Build();
    11.         PlayGamesPlatform.InitializeInstance(config);
    12.         PlayGamesPlatform.Activate();
    13.  
    14.         SignIn();
    15. }
    16.  
    17.     void SignIn()
    18.     {
    19.         Social.localUser.Authenticate(success => { });
    20.     }
    21.  
    22.     #region Achievements
    23.     public static void UnlockAchievement(string id)
    24.     {
    25.         Social.ReportProgress(id, 100, success => { });
    26.     }
    27.  
    28.     public static void IncrementAchievement(string id, int stepsToIncrement)
    29.     {
    30.         PlayGamesPlatform.Instance.IncrementAchievement(id, stepsToIncrement, success => { });
    31.     }
    32.  
    33.     public static void ShowAchievementsUI()
    34.     {
    35.         Social.ShowAchievementsUI();
    36.     }
    37.     #endregion /Achievements
    38.  
    39.     #region Leaderboards
    40.     public static void AddScoreToLeaderboard(string leaderboardId, long score)
    41.     {
    42.         Social.ReportScore(score, leaderboardId, success => { });
    43.     }
    44.  
    45.     public static void ShowLeaderboardsUI()
    46.     {
    47.         Social.ShowLeaderboardUI();
    48.     }
    49.     #endregion /Leaderboards
    50.  
    51. }
    52.  
    upload_2019-1-20_7-10-21.png
     
    Last edited: Jan 20, 2019
  2. AcidArrow

    AcidArrow

    Joined:
    May 20, 2010
    Posts:
    11,735
  3. rhendra

    rhendra

    Joined:
    Dec 27, 2017
    Posts:
    44
  4. rhendra

    rhendra

    Joined:
    Dec 27, 2017
    Posts:
    44
    upload_2019-1-20_8-0-2.png
    when im add google play services package. this problem arise. would you explant what's wrong?