DEV Community

Cover image for How-To: Event Systems in Unity

How-To: Event Systems in Unity

Bear Evans on April 08, 2024

At some point, you've likely encountered a situation where you needed to trigger functions or change variables in response to a change elsewhere in...
Collapse
 
devsdaddy profile image
Devs Daddy

Interesting option with creating channels via scriptable object. The first method seems not quite convenient because of the need to constantly add Enum. I would probably replace it with either String keys or make it type-dependent.

Collapse
 
bearevans profile image
Bear Evans

Indeed, the first option is best for smaller projects. It can also be made with a generic class, much like the event channels, and broken down into different event managers that handle different types of events, each with their own enum.

My personal favorite is the scriptable objects channels. I find them intuitive and easier to use thanks to my typo-inclined fingers.

Thank you for reading!