Skip to content

Latest commit

 

History

History
34 lines (25 loc) · 940 Bytes

README.md

File metadata and controls

34 lines (25 loc) · 940 Bytes

Hourai Teahouse Core Libraries for Unity

A core utilities library underpinning most Hourai Teahouse projects in Unity 3D.

Standard Libraries

Unity does not include some key items for System.* binaries. This package includes the following:

Mediator

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(...);