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"); }
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(); }
private static void Test() { MessageDispatch.RemoveAllMsgFuncs("test"); EditorApplication.isPlaying = true; new GameObject("MsgReceiveObj").AddComponent <FrameworkExample>(); }