Hi, im coming from flash-programming and would like to know, if unity contains something like an "EventListener" like that one from flash to register events and listen do them... Whats your workflow to handle events in unity?
Hey there, I don't want to self-promote but this is something I tackled in November but just haven't had any time to release to the Wiki.
I wrote the initial mention of it here: http://infiniteunity3d.com/flash-esque-event-system-for-unity/
Basically it is exactly what you're asking for, a round-abouts port of the AS3 event system. It is far more efficient than the C# manager currently on the Wiki, but does require you to code in C#.
We have AS3 background people here (myself included) who are now solely Unity devs and this was aimed to provide a familiar environment to help in the transitioning for anyone coming on in the future.
I will try really hard to post up my source code over the weekend for this and provide a link in an edit.
**EDIT**
Looks like I had some time today to get that posted. http://infiniteunity3d.com/flash-esque-event-system-for-unity-pt-2/
Thanks for making me get off my rear and post it, I really have been meaning to.
Cheers,
==
It's fairly simple to write a general-purpose event manger in Unity. In fact there's one on the Wiki, here:
http://www.unifycommunity.com/wiki/index.php?title=CSharpEventManager
This could probably be improved (and become more similar to flash's events) by passing delegates (references to functions) rather than strings as the event type to trigger.
Technically, the standard .NET runtime events are already very similar to AS3's event system. (I can only post 1 link so Google ".NET events" and the msdn article has the details.
I made an event system that performs the same task as AS3 events but does so in a way more closely modelled to the NSNotificationCenter. The unity package is available here: http://forum.unity3d.com/viewtopic.php?t=40311&start=15#249309 It is highly efficient and suitable for the iPhone.
Hi guys, I did try the Event Manager system that we can get on this page:
My first question is how do you throw the event?
right now I do this: TestEvent tmp = new TestEvent();
Do I need to do anything else?
I did exactly a copy and paste but the handleEvent function is never called, anny idea?
Thanks
Here is Asset you looking for.