Ejemplo n.º 1
0
        public void LoginWithGoogleButtonClicked()
        {
            GoogleButton.interactable    = false;
            AnonymousButton.interactable = false;

            Text buttonText = GoogleButton.GetComponentInChildren <Text>();

            string oldButtonText = buttonText.text;

            buttonText.text = "Logging in...";
            authHandler.DoGoogleLogin((auth) =>
            {
                buttonText.text = oldButtonText;
                APIService.Instance.access_token = auth.IdToken;

                InvalidateUI();
            }, (error) =>
            {
                GoogleButton.interactable    = true;
                AnonymousButton.interactable = true;
                buttonText.text = "Login Failed. Try Again?";
            });
        }