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.

53 lines
2.0 KiB

  1. using System;
  2. using UnityEngine.SceneManagement;
  3. namespace IPA
  4. {
  5. /// <summary>
  6. /// Interface for BSIPA plugins. Every class that implements this will be loaded if the DLL is placed at
  7. /// &lt;install dir&gt;/Plugins.
  8. /// </summary>
  9. /// <remarks>
  10. /// Mods implemented with this interface should handle being enabled at runtime properly, unless marked
  11. /// with the "no-runtime-enable" feature.
  12. /// </remarks>
  13. [Obsolete("Use the attribute-based system instead.")]
  14. public interface IPlugin
  15. {
  16. /// <summary>
  17. /// Called when a plugin is enabled. This is where you should set up Harmony patches and the like.
  18. /// </summary>
  19. /// <remarks>
  20. /// This will be called after <c>Init</c>, and will be called when the plugin loads normally too.
  21. /// When a plugin is disabled at startup, neither this nor Init will be called until it is enabled.
  22. ///
  23. /// Init will only ever be called once.
  24. /// </remarks>
  25. void OnEnable();
  26. /// <summary>
  27. /// Gets invoked when the application is closed.
  28. /// </summary>
  29. void OnApplicationQuit();
  30. /// <summary>
  31. /// Gets invoked whenever a scene is loaded.
  32. /// </summary>
  33. /// <param name="scene">The scene currently loaded</param>
  34. /// <param name="sceneMode">The type of loading</param>
  35. void OnSceneLoaded(Scene scene, LoadSceneMode sceneMode);
  36. /// <summary>
  37. /// Gets invoked whenever a scene is unloaded
  38. /// </summary>
  39. /// <param name="scene">The unloaded scene</param>
  40. void OnSceneUnloaded(Scene scene);
  41. /// <summary>
  42. /// Gets invoked whenever a scene is changed
  43. /// </summary>
  44. /// <param name="prevScene">The Scene that was previously loaded</param>
  45. /// <param name="nextScene">The Scene being loaded</param>
  46. void OnActiveSceneChanged(Scene prevScene, Scene nextScene);
  47. }
  48. }