You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

29 lines
1.1 KiB

  1. namespace IPA
  2. {
  3. /// <summary>
  4. /// Provides methods to allow runtime enabling and disabling of a plugin.
  5. /// </summary>
  6. public interface IDisablablePlugin
  7. {
  8. /// <summary>
  9. /// Called when a plugin is enabled. This is where you should set up Harmony patches and the like.
  10. /// </summary>
  11. /// <remarks>
  12. /// This will be called after Init, and will be called when the plugin loads normally too.
  13. /// When a plugin is disabled at startup, neither this nor Init will be called until it is enabled.
  14. ///
  15. /// Init will only ever be called once.
  16. /// </remarks>
  17. void OnEnable();
  18. /// <summary>
  19. /// Called when a plugin is disabled at runtime. This should disable things like Harmony patches and unsubscribe
  20. /// from events. After this is called there should be no lingering effects of the mod.
  21. /// </summary>
  22. /// <remarks>
  23. /// This will get called at shutdown, after <see cref="IBeatSaberPlugin.OnApplicationQuit"/>, as well as when the
  24. /// plugin is disabled at runtime.
  25. /// </remarks>
  26. void OnDisable();
  27. }
  28. }