Hello, im making a mobile game. Im currently adding a leaderboard. This is the code: `using UnityEngine;
using System;
using UnityEngine.UI;
using GooglePlayGames;
using UnityEngine.SocialPlatforms;
using GooglePlayGames.BasicApi;
public class PlayGames : MonoBehaviour
{
public Button btnn;
string leaderboardID = "CgkIxP_l7PYYEAIQAQ";
public static LeaderBoardManager instance;
void Awake()
{
if (instance == null)
instance = this;
}
// Use this for initialization
// Use this for initialization
void Start()
{
PlayGamesClientConfiguration config = new PlayGamesClientConfiguration.Builder()
// enables saving game progress.
.EnableSavedGames()
// requests the email address of the player be available.
// Will bring up a prompt for consent.
.RequestEmail()
// requests a server auth code be generated so it can be passed to an
// associated back end server application and exchanged for an OAuth token.
.RequestServerAuthCode(false)
// requests an ID token be generated. This OAuth token can be used to
// identify the player to other services such as Firebase.
.RequestIdToken()
.Build();
PlayGamesPlatform.InitializeInstance(config);
// recommended for debugging:
PlayGamesPlatform.DebugLogEnabled = true;
// Activate the Google Play Games platform
PlayGamesPlatform.Activate();
SignIn();
}
// Update is called once per frame
void Update () {
}
void SignIn()
{
Social.localUser.Authenticate((bool success) =>
{
if (success)
{
Debug.Log("Login Sucess");
}
else
{
Debug.Log("Login failed");
}
});
}
public void AddNewScore()
{
Social.ReportScore(PlayerPrefs.GetInt("bopCountScore"), leaderboardID, (bool success) => {
});
}
public void ShowLeaderBoard()
{
PlayGamesPlatform.Instance.ShowLeaderboardUI(leaderboardID);
}
}`
But i get a error message: The type or namespace name 'LeaderBoardManager' could not be found (are you missing a using directive or an assembly reference?) [Assembly-CSharp]
I have installed; GooglePlayGamesPlugin-0.10.12.unitypackage , but it doesent work. Can i get help please?
↧