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.

70 lines
2.1 KiB

5 years ago
5 years ago
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Text;
  4. using UnityEngine.SceneManagement;
  5. namespace IPA
  6. {
  7. /// <summary>
  8. /// Interface for Beat Saber plugins. Every class that implements this will be loaded if the DLL is placed at
  9. /// data/Managed/Plugins.
  10. /// </summary>
  11. public interface IBeatSaberPlugin
  12. {
  13. /// <summary>
  14. /// Gets the name of the plugin.
  15. /// </summary>
  16. string Name { get; }
  17. /// <summary>
  18. /// Gets the version of the plugin.
  19. /// </summary>
  20. string Version { get; }
  21. /// <summary>
  22. /// Gets the info for the Modsaber release of this plugin. Return null if there is no Modsaber release.
  23. /// </summary>
  24. ModsaberModInfo ModInfo { get; }
  25. /// <summary>
  26. /// Gets invoked when the application is started.
  27. /// </summary>
  28. void OnApplicationStart();
  29. /// <summary>
  30. /// Gets invoked when the application is closed.
  31. /// </summary>
  32. void OnApplicationQuit();
  33. /// <summary>
  34. /// Gets invoked on every graphic update.
  35. /// </summary>
  36. void OnUpdate();
  37. /// <summary>
  38. /// Gets invoked on ever physics update.
  39. /// </summary>
  40. void OnFixedUpdate();
  41. /// <summary>
  42. /// Gets invoked whenever a scene is loaded.
  43. /// </summary>
  44. /// <param name="scene">The scene currently loaded</param>
  45. /// <param name="sceneMode">The type of loading</param>
  46. void OnSceneLoaded(Scene scene, LoadSceneMode sceneMode);
  47. /// <summary>
  48. /// Gets invoked whenever a scene is unloaded
  49. /// </summary>
  50. /// <param name="scene">The unloaded scene</param>
  51. void OnSceneUnloaded(Scene scene);
  52. /// <summary>
  53. /// Gets invoked whenever a scene is changed
  54. /// </summary>
  55. /// <param name="prevScene">The Scene that was previously loaded</param>
  56. /// <param name="nextScene">The Scene being loaded</param>
  57. void OnActiveSceneChanged(Scene prevScene, Scene nextScene);
  58. }
  59. }