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 /
This question was closed Mar 23, 2018 at 07:59 PM by fafase for the following reason:

StartCoroutine not used on a coroutine call

avatar image
0
Question by Drakeus2000 · Mar 23, 2018 at 07:55 PM · serverwwwphp

www request ienumerator function doesn't work

hi guys, i have a code that is supposed to do a simple GET on a server, but apparently everything in the getunlockedvalue() doesn't get executed.

Simply put Debug log shows me Debug.Log("pre funkcije") but doesn't show me Debug.Log("I am here dammit!") which makes me think getunlockedvalue() is not working at all.

 public Text mytext;
 public InputField un, pass;
 public Button Continue_button;
 string username, password;
 string unlocked;
 string enkodovan_name;

 // Use this for initialization
 void Start () {
     Continue_button = GetComponent<Button>();
     mytext = GetComponentInChildren<Text>();
     Continue_button.onClick.AddListener(ProcessText);
     
 }
 void ProcessText()
 {
     mytext.text = "Loging In...";
     Continue_button.enabled = false;
     username = un.text;
     password = pass.text;
     enkodovan_name = WWW.EscapeURL(username);
     if ((username=="1") && (password == "1"))
             Application.LoadLevel("biraj_kulturu");
     Debug.Log("pre funkcije");
     getunlockedvalue();

 }

 IEnumerator getunlockedvalue()
 {
     Debug.Log("I am here dammit!");
     WWW otkljucano = new WWW("http://localhost/php_check_password.php" + "?email=" + enkodovan_name + "&password=" +    password); //GET data is sent via the URL

     while (!otkljucano.isDone && string.IsNullOrEmpty(otkljucano.error))
     {
         Debug.Log(otkljucano);
         yield return unlocked = otkljucano.text;
         Debug.Log(unlocked);
         if (unlocked == "true") { 
         PlayerPrefs.SetString("unlocked", "true");
         PlayerPrefs.SetString("culture", "none");
         PlayerPrefs.SetString("email", username);
             Application.LoadLevel("biraj_kulturu"); // Think about adding a screen that says congratulations, you unlocked the game. Bla Bla...
         }
         Debug.Log(unlocked);
     }

     if (unlocked == null) 
     Debug.LogWarning(otkljucano.error);
     Continue_button.enabled = true;
 }
 // Update is called once per frame
 void Update () {
     
 }

}

Any help is much appreciated...

Comment
Add comment · Show 2
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 fafase · Mar 23, 2018 at 07:59 PM 2
Share

To call a coroutine you need to call:

       StartCoroutine(CoroutineName())
avatar image Drakeus2000 fafase · Mar 23, 2018 at 08:08 PM 0
Share

God, completely overlooked it. Works like a charm. Thanks :)

0 Replies

  • Sort: 

Follow this Question

Answers Answers and Comments

79 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

Related Questions

Network class vs php for authoritative actions? 1 Answer

How to get different variables from PHP page ? (example included)... 1 Answer

`Recv failure: Connection was reset` In editor? (platform set to Android NOT WebPlayer) 0 Answers

How to grab POST image data from WWWForm on server? 1 Answer

asset bundle works fine on url1 but doesn't on url2? 0 Answers


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