Esempio n. 1
0
    public static AndroidGoogleSignIn Init(GameObject attachTo)
    {
        AndroidGoogleSignIn instance = attachTo.GetComponent <AndroidGoogleSignIn> ();

        if (instance != null)
        {
            return(instance);
        }

        return(attachTo.AddComponent <AndroidGoogleSignIn>());
    }
Esempio n. 2
0
    public void _SignIn()
    {
        var googleSignInScript = AndroidGoogleSignIn.Init(this.gameObject);

        googleSignInScript.SignIn(WEB_CLIENT_ID, GoogleSuccessCallback, GoogleErrorCallback);
    }
Esempio n. 3
0
    //void OnGUI()
    //{
    //    if (!_loginStarted)
    //    {
    //        if (GUI.Button(new Rect(20, 10, Screen.width - 20, 50), "Click To Login with Google", new GUIStyle{fontSize= 100}))
    //        {
    //            _loginStarted = true;
    //            GoogleLogin();
    //        }
    //    }
    //    else
    //    {
    //        if (!string.IsNullOrEmpty(_token))
    //        {
    //            GUI.Label(new Rect(10, 50, Screen.width - 10, 100), _token, new GUIStyle{fontSize= 100});
    //        }
    //        else if (!string.IsNullOrEmpty(_errorMsg))
    //        {
    //            GUI.Label(new Rect(10, 10, Screen.width - 10, 50), _errorMsg, new GUIStyle{fontSize= 100});
    //        }
    //    }
    //}

    #endregion

    #region Implementation

    void Start()
    {
        _pluginScript = AndroidGoogleSignIn.Init(this.gameObject);
        rg            = this.GetComponent <Register>();
    }
 void Start()
 {
     _pluginScript = AndroidGoogleSignIn.Init(this.gameObject);
 }