private IEnumerator Start() { MsgDispatcher.Send("Do", "你好"); yield return(new WaitForSeconds(3f)); MsgDispatcher.Send("Do", "你好呀,哈哈"); }
private static void MenuClicked() { MsgDispatcher.UnRegisterAll("Message_1"); MsgDispatcher.Register("Message_1", OnMsgReceived); MsgDispatcher.Register("Message_1", OnMsgReceived); MsgDispatcher.Send("Message_1", "hello world"); MsgDispatcher.UnRegister("Message_1", OnMsgReceived); MsgDispatcher.Send("Message_1", "hello"); }
private IEnumerator Start() { MsgDispatcher.Send("Do", "hello"); yield return(new WaitForSeconds(1.0f)); MsgDispatcher.Send("Do", "hello1"); SendMsg("OK", "hello"); SendMsg("OK", "hello"); }
private static void MenuClicked() { // 全部清空,确保测试有效 MsgDispatcher.UnRegisterAll("消息1"); MsgDispatcher.Register("消息1", OnMsgReceived); MsgDispatcher.Register("消息1", OnMsgReceived); MsgDispatcher.Send("消息1", "hello world"); MsgDispatcher.UnRegister("消息1", OnMsgReceived); MsgDispatcher.Send("消息1", "hello"); }
public static void SendMsg(string msgName, object data) { MsgDispatcher.Send(msgName, data); }
protected void SendMsg(string msgName, object data) { MsgDispatcher.Send(msgName, data); }