Beispiel #1
0
        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");
        }
Beispiel #3
0
        private IEnumerator Start()
        {
            MsgDispatcher.Send("Do", "hello");

            yield return(new WaitForSeconds(1.0f));

            MsgDispatcher.Send("Do", "hello1");

            SendMsg("OK", "hello");
            SendMsg("OK", "hello");
        }
Beispiel #4
0
        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");
        }
Beispiel #5
0
 public static void SendMsg(string msgName, object data)
 {
     MsgDispatcher.Send(msgName, data);
 }
 protected void SendMsg(string msgName, object data)
 {
     MsgDispatcher.Send(msgName, data);
 }