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.

57 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. public interface 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. /// <summary>
  21. /// Gets invoked when the application is closed.
  22. /// </summary>
  23. void OnApplicationQuit();
  24. /// <summary>
  25. /// Gets invoked on every graphic update.
  26. /// </summary>
  27. void OnUpdate();
  28. /// <summary>
  29. /// Gets invoked on ever physics update.
  30. /// </summary>
  31. void OnFixedUpdate();
  32. /// <summary>
  33. /// Gets invoked whenever a scene is loaded.
  34. /// </summary>
  35. /// <param name="scene">The scene currently loaded</param>
  36. /// <param name="sceneMode">The type of loading</param>
  37. void OnSceneLoaded(Scene scene, LoadSceneMode sceneMode);
  38. /// <summary>
  39. /// Gets invoked whenever a scene is unloaded
  40. /// </summary>
  41. /// <param name="scene">The unloaded scene</param>
  42. void OnSceneUnloaded(Scene scene);
  43. /// <summary>
  44. /// Gets invoked whenever a scene is changed
  45. /// </summary>
  46. /// <param name="prevScene">The Scene that was previously loaded</param>
  47. /// <param name="nextScene">The Scene being loaded</param>
  48. void OnActiveSceneChanged(Scene prevScene, Scene nextScene);
  49. }
  50. }