private static void LoadPlugin() { var typeName = "UBAddons.Champions." + Player.Instance.Hero + "." + Player.Instance.Hero; var type = Type.GetType(typeName); if (type == null) { return; } PluginInstance = (IHeroBase)Activator.CreateInstance(type); Libs.Dictionary.FleeSpell.Initialize(); Core.DelayAction(() => { if (Initialize(PluginInstance)) { UtilityPlugin.OnLoad(); if (UBCore.CoreMenu.UseOnTick) { Game.OnTick += UtilityPlugin.OnUpdate; } if (UBCore.CoreMenu.UseOnUpdate) { Game.OnUpdate += UtilityPlugin.OnUpdate; } } }, 200); }
private static bool Initialize(IHeroBase addonbase) { try { addonbase.CreateMenu(); Interrupter.OnInterruptableSpell += addonbase.OnInterruptable; Orbwalker.OnUnkillableMinion += addonbase.OnUnkillableMinion; Gapcloser.OnGapcloser += addonbase.OnGapcloser; Drawing.OnDraw += addonbase.OnDraw; if (UBCore.CoreMenu.UseOnTick) { Game.OnTick += addonbase.OnTick; } if (UBCore.CoreMenu.UseOnUpdate) { Game.OnUpdate += addonbase.OnTick; } return(true); } catch (Exception e) { Debug.Print(e.ToString(), Console_Message.Error); return(false); } }
private static void Initialize(IHeroBase addonbase) { addonbase.CreateMenu(); Interrupter.OnInterruptableSpell += addonbase.OnInterruptable; Orbwalker.OnUnkillableMinion += addonbase.OnUnkillableMinion; Gapcloser.OnGapcloser += addonbase.OnGapcloser; Drawing.OnDraw += addonbase.OnDraw; if (UBCore.CoreMenu.UseOnTick) { Game.OnTick += addonbase.OnTick; } if (UBCore.CoreMenu.UseOnUpdate) { Game.OnUpdate += addonbase.OnTick; } }