using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
using GooglePlayGames;
using GooglePlayGames.BasicApi;
using UnityEngine.SocialPlatforms;
using TMPro;
public class Gamemanger : MonoBehaviour {
private TextMeshProUGUI signInText;
private TextMeshProUGUI authStatus;
public void InitGPGS()
{
PlayGamesClientConfiguration config = new PlayGamesClientConfiguration.Builder().Build();
PlayGamesPlatform.DebugLogEnabled = true;
PlayGamesPlatform.InitializeInstance(config);
PlayGamesPlatform.Activate();
}
public void Login() //로그인 함수
{
Social.localUser.Authenticate((bool success) =>
{
// handle success or failure
if (success)
{
Debug.Log("Connect login");
//로그인 성공
signInText.text = "Sign out";
}
else
{
Debug.Log("Error login");
//로그인 실패
signInText.text = "Sign out";
}
});
}
public void Logout() //로그아웃함수
{
PlayGamesPlatform.Instance.SignOut();
signInText.text = "Sign in";
Debug.Log("sign out");
}
// Use this for initialization
void Start()
{
Login(); //시작시 로그인
InitGPGS(); //InitGPGS 설정
Screen.SetResolution(1080,1920,true);
Screen.orientation = ScreenOrientation.LandscapeLeft; //스크린 홈이 오른쪽 가로 모드
Screen.sleepTimeout = SleepTimeout.NeverSleep; //디스플레이 시간 안꺼짐
signInText = GameObject.Find("SignIn").GetComponentInChildren<TextMeshProUGUI>();
//authStatus = GameObject.Find("authStatus").GetComponent<TextMeshProUGUI>();
}
// Update is called once per frame
void Update()
{
}
}
이제 오류는 안뜨는데 글자가 안바뀌네;;