// Manual Listen public void Test02() { UEvent <StructEventDefine> .Listen(Receive02); UEvent <StructEventDefine> .Dispatch(new StructEventDefine() { Message = "Message 02" }); UEvent <StructEventDefine> .Remove(Receive02); }
// Manual Listen public void Test02() { UEvent.Listen <ClassEventDefine>(Receive02); UEvent.Dispatch(new ClassEventDefine() { Message = "Message 02" }); UEvent.Remove <ClassEventDefine>(Receive02); }
public void Test() { // Quick API // Add listen method var listenMethod = this.GetType().GetMethod("ListenMethod"); UEvent.Listen(EventType004.Event01, this, listenMethod); // Add listen action UEvent.Listen(EventType004.Event01, ListenAction); // Check listener exists UEvent.Contains(EventType004.Event01); // Get listeners var listeners = UEvent.Get(EventType004.Event01); // Remove listen method UEvent.Remove(EventType004.Event01, this, listenMethod); // Remove listen action UEvent.Remove(EventType004.Event01, ListenAction); }
// Manual Listen public void Test02() { UEvent.Listen(StringEventDefine.Event02, Receive02); UEvent.Dispatch(StringEventDefine.Event02, "Message 02"); UEvent.Remove(StringEventDefine.Event02, Receive02); }