/// <summary> /// 注册一个客户端事件; /// </summary> /// <param name="func"></param> public static bool AddEventAction(Action action, bool dontDestroy = false) { if (EventFunctionLibrary.ExternalDispose(action.Method.Name)) { return(false); } EventFunctionLibrary.Add(action.Method.Name, action, dontDestroy); return(true); }
/// <summary> /// 注册一个客户端类中所有符合要求的客户端事件; /// </summary> public static bool AddScpritEventAction <T>(bool dontDestroy = false) where T : class { return(FunctionObtaining.AddAllObjectAction <T>((s, f) => { if (EventFunctionLibrary.ExternalDispose(s)) { return false; } EventFunctionLibrary.Add(s, f, dontDestroy); return true; })); }