Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
0
Question by miggsta10 · Dec 25, 2018 at 09:49 PM · gameobjectscript.unity 2d

can i get help with a minor debug please ?

in short, I'm following a tutorial on Lynda in which I'm creating a firebase to help with user logins in my app. in the process of adding the option to log in with an email address and password however I'm having issues with linking the code functions from the script into the properties of the specific objects in my unity project (images will show what i mean) Going to copy and paste script as this forum won't let me upload image of it.

using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.UI; using System.Text; using System.Text.RegularExpressions; using System.Threading.Tasks; using Firebase; using Firebase.Auth;

public class FormManager : MonoBehaviour {

 // UI objects linked from the inspector
 public InputField emailInput;
 public InputField passwordInput;

 public Button SignUpbutton;
 public Button LoginButton;

 public Text statusText;

 public Authmanager authmanager;

 private void Awake()
 {
     ToggleButtonStates(false);

     // auth delegate subscriptions

     authmanager.authCallback += HandleAuthCallback;

 }

 /// <summary>
 /// Validates the email input
 /// </summary>

 public void ValidateEmail()
 {
     string email = emailInput.text;
     var regexPattern = @"^(([\w ]+\.)+[\w ]+|([a zA-Z]{1}|[\w ]{2,}))@"
         + @"((([0-1]?[0-9]{1,2}|25[0-5]|2[0-4][0-9])\.([0-1]?[0-9]{1,2}|25[0-5}|2[0-4][0-9](\."
         + @"([0-1]?[0-9]{1,2}|25[0-5]|2[0-4][0-9])\.([0-1]?[0-9]{1,2}|25[0-5}|2[0-4][0-9])){1}|"
         + @"([a-zA-Z]+[\w-]+\.)+[a-zA-Z]{2,4})S";
     if (email != "" && Regex.IsMatch(email, regexPattern))
     {
         ToggleButtonStates(true);
     }
     else
     {
         ToggleButtonStates(false);

     }


 }

 //firebase methods
 public void Onsignup()
 {
     authmanager.SignUpNewUser(emailInput.text, passwordInput.text);

     Debug.Log("sign up");


 }

 public void OnLogIn()
 {

     Debug.Log("Login");

 }

 IEnumerator HandleAuthCallback(Task<Firebase.Auth.FirebaseUser> task, string operation)
 {

     yield return null;

     if (task.IsFaulted || task.IsCanceled)
     {
         Updatestatus("sorry, there was an error creating your new account. Error: " + task.Exception);


     }
     else if (task.IsCompleted)
     {

         Firebase.Auth.FirebaseUser newPlayer = task.Result;
         Updatestatus("loading the game scene");
     }
 }

 private void OnDestroy()
 {
     authmanager.authCallback -= HandleAuthCallback;
 }

 // Utilities
 private void ToggleButtonStates(bool toState)
 {
     SignUpbutton.interactable = toState;
     LoginButton.interactable = toState;

 }


 private void Updatestatus(string message)
 {
     statusText.text = message;
 }

}

alt text

screenshot-2018-12-25-at-213234.png (237.5 kB)
screenshot-2018-12-25-at-214449.png (509.7 kB)
Comment
Add comment · Show 1
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image rozatlab · Jan 15, 2020 at 08:35 PM 0
Share

@miggsta10 did you find a solution for this? I'm working through the same tutorial now and cannot figure out how to run the coroutine from inside the task thread he has setup for this part as well as the authCallback. It works for him somehow, which is extra confusing. Any help is greatly appreciated!

2 Replies

· Add your reply
  • Sort: 
avatar image
0

Answer by H1ddeNGames · Dec 27, 2018 at 11:19 AM

If the method you're looking to give to that On Click() isn't showing up, that means it's a method that does not return void or it's a method that takes in an unsupported parameter. As far as I know only string and int parameters work and you may only have on parameter when you want to make a button run a user made function.

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image
0

Answer by a5216276 · May 20, 2019 at 06:28 AM

I am running "Task task" and there will be an error. Do you have a similar situation?

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

152 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

I'm trying to make scorezones but i cant seems to get it right.,Im trying to make a scorezone that you can go through and that can add 1 point to the player. 0 Answers

How to make game object move every 10 seconds? 0 Answers

how can i access to the scripts which have same name and were attached to the same gameobject. 2 Answers

How can I do that in an array with gameobject.findobjectoftype but that does not count the same object in which this script is? 1 Answer

Do you tend to have scripts to mark prefabs 1 Answer


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges