But of course it wont be stored in an array or anything, which I could do too.
Then I can initialize the UIEventHandler BUT I don't know if I can do this in the loop, or if it has to be in start, or what. AND I need to pass in an argument (the id of the instance) which I'm not sure how to do because they don't take arguments.
Please help :) Thank you.
Title: Re: Dynamically Generated Buttons - UIEventListener (&Passing Args)
Post by: ArenMook on January 20, 2014, 07:34:36 AM
My suggest... never use Find. Ever.
Also, never try to find something on children. Instead have children look up scripts on parents.
Reason being, a parent can exist without a child, but a child cannot exist without a parent.
So... have a script on your children that will either forward events to an appropriate script on the parent (NGUITools.FindInParents is handy!), or call the correct function directly.
Title: Re: Dynamically Generated Buttons - UIEventListener (&Passing Args)
Post by: Vaei on January 20, 2014, 08:04:49 AM