public static void Unload() { origLoadLevelHook.Dispose(); loadCustomEntityHook.Dispose(); On.Monocle.Entity.Added -= EntityOnAdded; CustomEntityId2Utils.OnUnload(); }
public static void OnLoad() { origLoadLevelHook = new ILHook(typeof(Level).GetMethod("orig_LoadLevel"), ModOrigLoadLevel); loadCustomEntityHook = new ILHook(typeof(Level).GetMethod("LoadCustomEntity"), ModLoadCustomEntity); On.Monocle.Entity.Added += EntityOnAdded; CustomEntityId2Utils.OnLoad(); }