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. public interface IPlugin : _IPlugin
  9. {
  10. /// <summary>
  11. /// Called when a plugin is enabled. This is where you should set up Harmony patches and the like.
  12. /// </summary>
  13. /// <remarks>
  14. /// This will be called after Init, and will be called when the plugin loads normally too.
  15. /// When a plugin is disabled at startup, neither this nor Init will be called until it is enabled.
  16. ///
  17. /// Init will only ever be called once.
  18. /// </remarks>
  19. void OnEnable();
  20. }
  21. /// <summary>
  22. /// An interface for providing compatability with BSIPA 3.x.x. Do not use.
  23. /// </summary>
  24. public interface _IPlugin {
  25. /// <summary>
  26. /// Gets invoked when the application is closed.
  27. /// </summary>
  28. void OnApplicationQuit();
  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. }