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.

63 lines
2.2 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. // TODO: move more of these out of IPlugin
  29. /// <summary>
  30. /// Gets invoked on every graphic update.
  31. /// </summary>
  32. void OnUpdate();
  33. /// <summary>
  34. /// Gets invoked on ever physics update.
  35. /// </summary>
  36. void OnFixedUpdate();
  37. /// <summary>
  38. /// Gets invoked whenever a scene is loaded.
  39. /// </summary>
  40. /// <param name="scene">The scene currently loaded</param>
  41. /// <param name="sceneMode">The type of loading</param>
  42. void OnSceneLoaded(Scene scene, LoadSceneMode sceneMode);
  43. /// <summary>
  44. /// Gets invoked whenever a scene is unloaded
  45. /// </summary>
  46. /// <param name="scene">The unloaded scene</param>
  47. void OnSceneUnloaded(Scene scene);
  48. /// <summary>
  49. /// Gets invoked whenever a scene is changed
  50. /// </summary>
  51. /// <param name="prevScene">The Scene that was previously loaded</param>
  52. /// <param name="nextScene">The Scene being loaded</param>
  53. void OnActiveSceneChanged(Scene prevScene, Scene nextScene);
  54. }
  55. }