public static AndroidGoogleSignIn Init(GameObject attachTo) { AndroidGoogleSignIn instance = attachTo.GetComponent <AndroidGoogleSignIn> (); if (instance != null) { return(instance); } return(attachTo.AddComponent <AndroidGoogleSignIn>()); }
public void _SignIn() { var googleSignInScript = AndroidGoogleSignIn.Init(this.gameObject); googleSignInScript.SignIn(WEB_CLIENT_ID, GoogleSuccessCallback, GoogleErrorCallback); }
//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); }