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 /
  • Help Room /
avatar image
0
Question by angelodelvecchio · Jan 13, 2016 at 04:48 AM · unity 5pluginfunctionyield

The Legend of the waiting for function to end! Still no answer for that, Please Help

Hello friends!, unity is sooooo wonderful !, i love you unity! BUT i am having a problem! i have a function:

public function TestePegarLista() {

 var pathToPHP = PHP_Lista;
 var finalizou: boolean = false;
 
 var w : WWW = new WWW( pathToPHP ); //
 yield w;
 
 atualizando = "Informacoes Recebidas, Processando";    
 
 if (w.error != null)
 {
         atualizando = "Falha de Comunicacao?";
 } 
 else
 {
            
     pro_ean        = new List.<String>();
     pro_dc        = new List.<String>();
     pro_pre_ven    = new List.<String>();        

     var args : String[] =  w.text.Split(":"[0]); 
     if (args[0] != "0")            
     {
              
     registros_total = args.length;
     registros_atual = 0;

             return;

     }        

     for (var i = 1; i < args.length; i++)
     {
         var fields : String[] = args[i].Split("="[0]);  
         
         pro_ean.Add(fields[0]);
         pro_dc.Add(fields[1]);
         pro_pre_ven.Add(fields[2]);
         
         registros_atual = registros_atual + 1;
                 
     }       
     
  }           
  

}

So, I try something like

function ButtonClick() {

TestePegarLista();

if( registros_total != 0 ) { Here I can fill any var or clone buttons for example, BUT it dont wait for the LOOP FUNCTION of the other function to END !, it returns registros_total = 0!!!!! i must to double run the function to make it works, its not waiting for the TestePegarLista to end to start processing the nex step, please folks how its possible to make it works ?

Many thanks

}

}

Comment
Add comment
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

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by angelodelvecchio · Jan 14, 2016 at 07:38 PM

This mean, i will not for example, be able to make an array system, and a function to locate data ?

like

code : List. = new List.(); description : List. = new List.();

function LocateByDescription( Desc: String ) {

for (var i = 1; i < managerDatabaseScript.description .Count; i++) {

  if( managerDatabaseScript.code [ i ] == Desc)
  {
  
    return i;
         
  }
  

}

}

Because i cant wait for the function to do it ? Please help!

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

47 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

Related Questions

Difference between C# Invoke and Unity Invoke 0 Answers

Android plugin - how to create a daily notification 0 Answers

FBX Exporter is not responding 0 Answers

Radial Menu using HTC vive input utilities 0 Answers

Problems sharing textures with plugin in Unity 5 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