// Update is called once per frame void Update() { if (Input.GetMouseButtonDown(0)) { TypeEventSystem.Send(new A()); } if (Input.GetMouseButtonDown(1)) { TypeEventSystem.Send(new B()); } if (Input.GetKeyDown(KeyCode.U)) { TypeEventSystem.UnRegister <A>(ReceiveA); TypeEventSystem.UnRegister <B>(ReceiveB); } }
// Start is called before the first frame update void Start() { TypeEventSystem.Register <A>(ReceiveA); TypeEventSystem.Register <B>(ReceiveB); }
void Subscribe() { TypeEventSystem.Register <NotifyEvent>(Update); }
public void Dispose() { TypeEventSystem.UnRegister <NotifyEvent>(Update); }
void Notify() { TypeEventSystem.Send(new NotifyEvent()); }