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()

    {


    }


}




여기서 SIGN IN을 누르면 OUT으로 텍스트가 바뀔줄알았는데 오브젝트를 못찾겠다고 뜨네 계속..

왜 이런걸까.. 흉아들..