A core utilities library underpinning most Hourai Teahouse projects in Unity 3D.
Unity does not include some key items for System.*
binaries. This package includes
the following:
An event bus for subscribing to and publishing events.
// Events are just data objects.
public class LogEvent {
public string Message;
}
// Creating a Mediator.
Mediator mediator = new Mediator();
// Accessing the global event bus.
Mediator globalMediator = Mediator.Global;
// Subscribing to events.
Mediator.Global.Subscribe<LogEvent>(log => Debug.Log(log.Message));
// Publishing Events.
Mediator.Global.Publish(new LogEvent { Message = "Hello World!" });
// Unsubscribing from events.
Mediator.Global.Unsubscribe(...);