示例#1
0
 /// <summary>
 ///     Опубликовать результат
 /// </summary>
 /// <param name="score">
 ///     Количество очков
 /// </param>
 public void Publish(int score)
 {
     Social.ReportScore(score, LEADERBOARD, (result) =>
     {
         if (!result)
         {
             AppDebug.Error($"Publish score({score}) fail");
         }
     });
 }
示例#2
0
 /// <summary>
 ///     Отобразить таблицу лидеров
 /// </summary>
 public void OnShowLeaderBoard()
 {
     try
     {
         ((PlayGamesPlatform)Social.Active).ShowLeaderboardUI(LEADERBOARD);
     }
     catch (Exception ex)
     {
         AppDebug.Error(ex.Message);
     }
 }
 private void Start()
 {
     try
     {
         _lvl = int.Parse(this.GetComponentInChildren <Text>().text);
     }
     catch (Exception ex)
     {
         AppDebug.Error(ex.Message);
     }
 }
示例#4
0
 private void Awake()
 {
     try
     {
         PlayGamesClientConfiguration config = new PlayGamesClientConfiguration.Builder().Build();
         PlayGamesPlatform.InitializeInstance(config);
         PlayGamesPlatform.Activate();
     }
     catch (Exception ex)
     {
         AppDebug.Error(ex.Message);
     }
 }
示例#5
0
 /// <summary>
 ///     Подключение к Google Play Srvices
 /// </summary>
 public void ConnectionServies()
 {
     try
     {
         Social.localUser.Authenticate((bool success, string message) =>
         {
             AppDebug.Info($"Loading: {success}");
             if (success)
             {
                 userName = Social.localUser.userName;
                 AppDebug.Info($"User name: {userName}");
             }
             else
             {
                 AppDebug.Error(message);
             }
         });
     }
     catch (Exception ex)
     {
         AppDebug.Error(ex.Message);
     }
 }