public static void RemoveHook(Type type, ComponentHook hook) { ComponentHook all; if (Hooks.TryGetValue(type, out all)) { all -= hook; Hooks[type] = all; } }
public static void AddHook(Type type, ComponentHook hook) { ComponentHook all; if (Hooks.TryGetValue(type, out all)) { all += hook; } else { all = hook; } Hooks[type] = all; }
public static void RemoveHook <T>(ComponentHook hook) where T : Component { RemoveHook(typeof(T), hook); }
public static void AddHook <T>(ComponentHook hook) where T : Component { AddHook(typeof(T), hook); }