The project on github has an example projects which describes how to use it in more details.
Syntax of BroadcastU:
BroadcastU.Instance.Subscribe(evt=>DoSomething(evt))
BroadcastU.Instance.Publish(new ExampleEvent())
BroadcastU is an object oriented event system and it is one of the essential parts of our games. Especially for the UI. Unity already has a way to broadcast messages and activate functions of other classes but it has one major drawback which makes the code very hard to maintain: the messages are strings.
Because they are strings bugs will be introduced when refactoring and also it’s impossible to send complex event data.
BroadcastU:
- Has a typed event objects which allows for easy refactoring
- Gives compile errors when something is misspelled
- Event objects can carry complex data
We will post tutorials if someone is interested