예제 #1
0
        private static void MenuClicked()
        {
            MsgDispatcher.UnRegisterAll("Do");
            MsgDispatcher.UnRegisterAll("OK");

            UnityEditor.EditorApplication.isPlaying = true;

            new GameObject("MsgReceiverObj")
            .AddComponent <FrameworkExample>();
        }
        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");
        }
예제 #3
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");
        }