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.

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