Beispiel #1
0
    /// <summary>
    /// 2. 로그인
    /// </summary>
    void Check_Login()
    {
        //구글에 로그인 안됐을때
        //그냥 로그인 안됏을때


        if (BackEndAuthManager.Get_Join_User())
        {
            if (BackEndAuthManager.Get_User_Type())
            {
                //게스트 로그인
                BackEndAuthManager.GoogleFireBaseLogin();
            }
            else
            {
                //구글 로그인
                Debug.Log("로그인 되있음");
                SocalManager.Login();
            }
        }
        else
        {
            Debug.Log("로그인 안되있음");
            PopupManager.Open_Popup(LoginPopup);
        }
    }
    public static void Login()
    {
        Social.localUser.Authenticate(success =>
        {
            if (success == false)
            {
                Debug.Log("구글 로그인 실패");
                return;
            }

            // 로그인이 성공되었습니다.
            Debug.Log("GetIdToken - " + PlayGamesPlatform.Instance.GetIdToken());
            Debug.Log("Email - " + ((PlayGamesLocalUser)Social.localUser).Email);
            Debug.Log("GoogleId - " + Social.localUser.id);
            Debug.Log("UserName - " + Social.localUser.userName);
            Debug.Log("UserName - " + PlayGamesPlatform.Instance.GetUserDisplayName());

            PopupManager.Close_Popup();
            BackEndAuthManager.GoogleFireBaseLogin();
        });
    }