Michele Mantovan

Custom Event System for Unity

The Unity built-in event system is good for simple stuff and basic message sending. But when it comes to sending complex data or deactivate listeners it doesn’t fit well for that.

If you want a more customizable system you could use my event system:


I developed it (in C#) starting from the following class, than I extended it to satisfy my needs:


This event system allows you to define a specific event class (with all the benefits of encapsulated data), to add and remove listeners from a specific event and to define a callback for that event.

It’s safer than the Unity standard system, since it uses a delegate (like a function pointer) to specify callbacks, instead of strings (typo unsafe). It also uses the class name to differentiate events, and a listener has to use the type of the event to which it wants to react.

Use it freely on your projects. Happy coding!

Source code