- Home /
How do I add an event listener for the WWW class?
I want an event dispatched whenever WWW is done loading in C#. I don't want to use yield, and I don't want to loop until it's done. What is the right way to dispatch these kind of events?
Answer by StephanK · Nov 15, 2010 at 11:27 AM
I guess you will have to use yield one way or another. You could write a wrapper for your www calls, that internally uses yield, but will trigger an event when finished. You can use the C# standard event system for that.
O$$anonymous$$ which are example classes in Unity which DO allow eventlisteners? I come from an AS3 background so I feel comfortable with events :)
You'd look up delegates (or events) in the c# reference on $$anonymous$$SDN, e.g. http://msdn.microsoft.com/en-us/library/aa288459(VS.71).aspx
Your answer
Follow this Question
Related Questions
Add event listener to referenced prefab Child 1 Answer
Is it wise to add scripts to Unity's Event System? 0 Answers
Best way to handle multiple buttons? 2 Answers
Chain UI animations with Events? 1 Answer
OnSceneGUI mouse Dragging 0 Answers