First Hello from the new user!
I want to install in my app GooglyPlay. I have followed the instructions of the Plugin for Unity. In Google Play, I’ve set up a leaderboard and created an API. Unity received the package and the setup was executed.
I have now created this script:
using UnityEngine;
using GooglePlayGames;
using UnityEngine.SocialPlatforms;
using GooglePlayGames.BasicApi;
public class Google : MonoBehaviour {
private void Start() {
PlayGamesClientConfiguration config = new PlayGamesClientConfiguration.Builder().Build();
PlayGamesPlatform.DebugLogEnabled = true;
PlayGamesPlatform.InitializeInstance(config);
PlayGamesPlatform.Activate();
}
public void LogIn() {
Social.localUser.Authenticate((bool succes) => {
if (succes) {
Debug.Log("Erfolgreich eingeloggt!");
} else {
Debug.Log("Fehler beim Einloggen!");
}
});
}
public void LogOut() {
((PlayGamesPlatform)Social.Active).SignOut();
}
public void PunkteInBestenlisteEintragen() {
Social.ReportScore(500, GPGSIds.leaderboard_highscore, (bool success) => {
});
}
public void BestenlisteAnzeigen() {
PlayGamesPlatform.Instance.ShowLeaderboardUI();
// Social.ShowLeaderboardUI();
}
public void SpezielleBestenlisteAnzeigen() {
PlayGamesPlatform.Instance.ShowLeaderboardUI(GPGSIds.leaderboard_highscore);
}
}
The login and logout functions. It does not work, however, calling the leaderboard and entering points.
I have already read some topics, but unfortunately no solution for my problem found.
Hope you can help me!
Many Thanks!