Answer the question
In order to leave comments, you need to log in
Top rating in unity, script not working?
There is a script
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using GooglePlayGames;
using GooglePlayGames.BasicApi;
using UnityEngine.SocialPlatforms;
public class TOP : MonoBehaviour
{
private const string leaderboard = "CgkI2pnKuuEF-----";
private int score;
void Start(){
PlayGamesPlatform.Activate();
}
void OnMouseDown (){
transform.localScale = new Vector3 (transform.localScale.x / 1.2f, transform.localScale.y / 1.2f, transform.localScale.z / 1.2f);
}
void OnMouseUp (){
transform.localScale = new Vector3 (transform.localScale.x * 1.2f, transform.localScale.y * 1.2f, transform.localScale.z * 1.2f);
}
void OnMouseUpAsButton()
{
score = PlayerPrefs.GetInt("balance");
// Активировать Google Play Games Platform
Social.localUser.Authenticate((bool success) => {
if (success) print("Удачно");
else print("Неудачно");
});
Social.ReportScore(score, leaderboard, (bool success) => {
if (success) print("Удачно2");
else print("Неудачно2");
});
Social.ShowLeaderboardUI();
}
void OnApplicationQuit(){
PlayGamesPlatform.Instance.SignOut();
}
}
Answer the question
In order to leave comments, you need to log in
Put in Package Manager
Android Logcat
and see the application logs. There must be some mistake there. Or cover your code with logs to see where it was executed, and where it didn’t even reach. Well, the surest case is to build a build that can be debugged directly on the device.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question