Example #1
0
        private IEnumerator Start()
        {
            MsgDispatcher.Send("Do", "hello1");
            yield return(new WaitForSeconds(1.0f));

            MsgDispatcher.Send("Do", "hello2");
            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 void SendMsg(string msgName, object data)
 {
     MsgDispatcher.Send(msgName, data);
 }