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.

51 lines
1.9 KiB

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