/// <summary> /// Опубликовать результат /// </summary> /// <param name="score"> /// Количество очков /// </param> public void Publish(int score) { Social.ReportScore(score, LEADERBOARD, (result) => { if (!result) { AppDebug.Error($"Publish score({score}) fail"); } }); }
/// <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); } }
private void Awake() { try { PlayGamesClientConfiguration config = new PlayGamesClientConfiguration.Builder().Build(); PlayGamesPlatform.InitializeInstance(config); PlayGamesPlatform.Activate(); } catch (Exception ex) { AppDebug.Error(ex.Message); } }
/// <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); } }