public override void Create() { behaviours = new List <GameBehaviour>(ModData.mods.Values.Select(m => m.gameBehaviour)); base.Create(); preUpdate = HookManager.CreateHooks <GameBehaviour, Action>(behaviours, "PreUpdate"); postUpdate = HookManager.CreateHooks <GameBehaviour, Action>(behaviours, "PostUpdate"); onUpdateKeyboard = HookManager.CreateHooks <GameBehaviour, Action>(behaviours, "OnUpdateKeyboard"); updateMusic = HookManager.CreateHooks <GameBehaviour, Action <Ref <BgmEntry> > >(behaviours, "UpdateMusic"); }
public override void Create() { behaviours = new List <GameBehaviour>(ModData.mods.Values.Select(m => m.gameBehaviour).Where(gb => gb != null)); base.Create(); preUpdate = HookManager.CreateHooks <GameBehaviour, Action>(behaviours, "PreUpdate"); postUpdate = HookManager.CreateHooks <GameBehaviour, Action>(behaviours, "PostUpdate"); onUpdateKeyboard = HookManager.CreateHooks <GameBehaviour, Action>(behaviours, "OnUpdateKeyboard"); preDraw = HookManager.CreateHooks <GameBehaviour, Action <SpriteBatch> >(behaviours, "PreDraw"); postDraw = HookManager.CreateHooks <GameBehaviour, Action <SpriteBatch> >(behaviours, "PostDraw"); preScreenClear = HookManager.CreateHooks <GameBehaviour, Action>(behaviours, "PreScreenClear"); postScreenClear = HookManager.CreateHooks <GameBehaviour, Action>(behaviours, "PostScreenClear"); preDrawBackground = HookManager.CreateHooks <GameBehaviour, Func <SpriteBatch, bool> >(behaviours, "PreDrawBackground"); postDrawBackground = HookManager.CreateHooks <GameBehaviour, Action <SpriteBatch> >(behaviours, "PostDrawBackground"); updateDebug = HookManager.CreateHooks <GameBehaviour, Action>(behaviours, "UpdateDebug"); updateMusic = HookManager.CreateHooks <GameBehaviour, Action <Ref <BgmEntry> > >(behaviours, "UpdateMusic"); }
public void Create() { onAllModsLoaded = HookManager.CreateHooks <ModDef, Action>(ModData.mods.Values, "OnAllModsLoaded"); onUnload = HookManager.CreateHooks <ModDef, Action>(ModData.mods.Values, "OnUnload"); }