public override void Initialize() { Instance = this; Instance.Log("Blackmoth initializing!"); ModHooks.Instance.HeroUpdateHook += Update; ModHooks.Instance.HeroUpdateHook += GetReferences; ModHooks.Instance.DashVectorHook += CalculateDashVelocity; ModHooks.Instance.DashPressedHook += CheckForDash; ModHooks.Instance.LanguageGetHook += Descriptions; UnityEngine.SceneManagement.SceneManager.sceneLoaded += ResetPosition; EventInfo hi = ModHooks.Instance.GetType().GetEvent("HitInstanceHook", BindingFlags.Instance | BindingFlags.Public); isHitInstance = !Equals(hi, null); if (isHitInstance) { Log("HitInstanceHook found!"); Delegate handler = Delegate.CreateDelegate(hi.EventHandlerType, this, "SetDamages"); hi.AddEventHandler(ModHooks.Instance, handler); } else { Log("HitInstanceHook not found! Using older methods."); ModHooks.Instance.HeroUpdateHook += OldSetDamages; ModHooks.Instance.OnGetEventSenderHook += DashSoul; } Instance.Log("Blackmoth initialized!"); }
public override void Initialize() { Instance = this; Instance.Log("Blackmoth initializing!"); ModHooks.Instance.HeroUpdateHook += Update; ModHooks.Instance.NewGameHook += GetReferences; ModHooks.Instance.AfterSavegameLoadHook += GetReferences; ModHooks.Instance.DashVectorHook += CalculateDashVelocity; ModHooks.Instance.DashPressedHook += CheckForDash; ModHooks.Instance.LanguageGetHook += Descriptions; UnityEngine.SceneManagement.SceneManager.sceneLoaded += ResetPosition; ModHooks.Instance.HitInstanceHook += SetDamages; On.PlayMakerFSM.Awake += PlayMakerFSM_Awake; Instance.Log("Blackmoth initialized!"); }
public override void Initialize() { Instance = this; Instance.Log("Blackmoth initializing!"); ModHooks.Instance.NewGameHook += GetReferences; ModHooks.Instance.AfterSavegameLoadHook += GetReferences; ModHooks.Instance.LanguageGetHook += Descriptions; ModHooks.Instance.HeroUpdateHook += Update; ModHooks.Instance.DashVectorHook += CalculateDashVelocity; ModHooks.Instance.DashPressedHook += CheckForDash; ModHooks.Instance.TakeDamageHook += InstanceOnTakeDamageHook; On.HeroController.LookForQueueInput += HeroControllerOnLookForQueueInput; On.HealthManager.TakeDamage += SetDamages; // Init dictionaries to stop nullRef. InitializeDictionaries(); Instance.Log("Blackmoth initialized!"); }