Несколько дней go Я начал внедрять систему лидеров Google Play в своей игре, но проблема в том, что я не могу отправить пользовательский счет на сервер Google Play. Я пробовал много разных способов, но ничего не получается.
Я уже создал счетчик рекордов в своей игре. Как я могу получить высокий балл (из текста) и сообщить о нем на серверы списка лидеров игры goolge?
using UnityEngine;
using System.Collections;
using GooglePlayGames;
using UnityEngine.SocialPlatforms;
public class GPGDemo : MonoBehaviour
{
#region PUBLIC_VAR
public string leaderboard;
#endregion
#region DEFAULT_UNITY_CALLBACKS
void Start ()
{
// recommended for debugging:
PlayGamesPlatform.DebugLogEnabled = true;
// Activate the Google Play Games platform
PlayGamesPlatform.Activate ();
}
#endregion
#region BUTTON_CALLBACKS
/// <summary>
/// Login In Into Your Google+ Account
/// </summary>
public void LogIn ()
{
Social.localUser.Authenticate ((bool success) =>
{
if (success) {
Debug.Log ("Login Sucess");
} else {
Debug.Log ("Login failed");
}
});
}
/// <summary>
/// Shows All Available Leaderborad
/// </summary>
public void OnAddScoreToLeaderBorad ()
{
if (Social.localUser.authenticated) {
Social.ReportScore (100, leaderboard, (bool success) =>
{
if (success) {
Debug.Log ("Update Score Success");
} else {
Debug.Log ("Update Score Fail");
}
});
}
}
/// <summary>
/// On Logout of your Google+ Account
/// </summary>
public void OnLogOut ()
{
((PlayGamesPlatform)Social.Active).SignOut ();
}
}