コード例 #1
0
 private static void DispatchMsg()
 {
     MessageDispatch.RemoveAllMsgFuncs("test");
     MessageDispatch.RegisterMsg("test", MsgFunc);
     MessageDispatch.RegisterMsg("test", MsgFunc);
     MessageDispatch.SendMsg("test", "hello");
     MessageDispatch.RemoveSingleMsgFunc("test", MsgFunc);
     MessageDispatch.SendMsg("test", "Harkey");
 }
コード例 #2
0
        protected void UnRegisterMsg(string msgName)
        {
            var selectedRecords = _msgRecorder.FindAll(record => record.msgName == msgName);

            selectedRecords.ForEach(record =>
            {
                MessageDispatch.RemoveAllMsgFuncs(msgName);
                _msgRecorder.Remove(record);

                record.Recycle();
            });
            selectedRecords.Clear();
        }
コード例 #3
0
 private static void Test()
 {
     MessageDispatch.RemoveAllMsgFuncs("test");
     EditorApplication.isPlaying = true;
     new GameObject("MsgReceiveObj").AddComponent <FrameworkExample>();
 }