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.

326 lines
17 KiB

  1. <!DOCTYPE html>
  2. <!--[if IE]><![endif]-->
  3. <html>
  4. <head>
  5. <meta charset="utf-8">
  6. <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  7. <title>Interface IPlugin
  8. </title>
  9. <meta name="viewport" content="width=device-width">
  10. <meta name="title" content="Interface IPlugin
  11. ">
  12. <meta name="generator" content="docfx 2.48.0.0">
  13. <link rel="shortcut icon" href="../favicon.ico">
  14. <link rel="stylesheet" href="../styles/docfx.vendor.css">
  15. <link rel="stylesheet" href="../styles/docfx.css">
  16. <link rel="stylesheet" href="../styles/main.css">
  17. <link href="https://fonts.googleapis.com/css?family=Roboto" rel="stylesheet">
  18. <meta property="docfx:navrel" content="../toc.html">
  19. <meta property="docfx:tocrel" content="toc.html">
  20. <meta property="docfx:rel" content="../">
  21. <meta property="docfx:newtab" content="true">
  22. </head> <body data-spy="scroll" data-target="#affix" data-offset="120">
  23. <div id="wrapper">
  24. <header>
  25. <nav id="autocollapse" class="navbar navbar-inverse ng-scope" role="navigation">
  26. <div class="container">
  27. <div class="navbar-header">
  28. <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#navbar">
  29. <span class="sr-only">Toggle navigation</span>
  30. <span class="icon-bar"></span>
  31. <span class="icon-bar"></span>
  32. <span class="icon-bar"></span>
  33. </button>
  34. <a class="navbar-brand" href="../index.html">
  35. <img id="logo" class="svg" src="../logo.svg" alt="">
  36. </a>
  37. </div>
  38. <div class="collapse navbar-collapse" id="navbar">
  39. <form class="navbar-form navbar-right" role="search" id="search">
  40. <div class="form-group">
  41. <input type="text" class="form-control" id="search-query" placeholder="Search" autocomplete="off">
  42. </div>
  43. </form>
  44. </div>
  45. </div>
  46. </nav>
  47. <div class="subnav navbar navbar-default">
  48. <div class="container hide-when-search" id="breadcrumb">
  49. <ul class="breadcrumb">
  50. <li></li>
  51. </ul>
  52. </div>
  53. </div>
  54. </header>
  55. <div class="container body-content">
  56. <div id="search-results">
  57. <div class="search-list"></div>
  58. <div class="sr-items">
  59. <p><i class="glyphicon glyphicon-refresh index-loading"></i></p>
  60. </div>
  61. <ul id="pagination"></ul>
  62. </div>
  63. </div>
  64. <div role="main" class="container body-content hide-when-search">
  65. <div class="sidenav hide-when-search">
  66. <a class="btn toc-toggle collapse" data-toggle="collapse" href="#sidetoggle" aria-expanded="false" aria-controls="sidetoggle">Show / Hide Table of Contents</a>
  67. <div class="sidetoggle collapse" id="sidetoggle">
  68. <div id="sidetoc"></div>
  69. </div>
  70. </div>
  71. <div class="article row grid-right">
  72. <div class="col-md-10">
  73. <article class="content wrap" id="_content" data-uid="IPA.IPlugin">
  74. <h1 id="IPA_IPlugin" data-uid="IPA.IPlugin" class="text-break">Interface IPlugin
  75. </h1>
  76. <div class="markdown level0 summary"><p>Interface for BSIPA plugins. Every class that implements this will be loaded if the DLL is placed at
  77. &lt;install dir&gt;/Plugins.</p>
  78. </div>
  79. <div class="markdown level0 conceptual"></div>
  80. <h6><strong>Namespace</strong>: <a class="xref" href="IPA.html">IPA</a></h6>
  81. <h6><strong>Assembly</strong>: IPA.Loader.dll</h6>
  82. <h5 id="IPA_IPlugin_syntax">Syntax</h5>
  83. <div class="codewrapper">
  84. <pre><code class="lang-csharp hljs">[Obsolete(&quot;Use the attribute-based system instead.&quot;)]
  85. public interface IPlugin</code></pre>
  86. </div>
  87. <h5 id="IPA_IPlugin_remarks"><strong>Remarks</strong></h5>
  88. <div class="markdown level0 remarks"><p>Mods implemented with this interface should handle being enabled at runtime properly, unless marked
  89. with the &quot;no-runtime-enable&quot; feature.</p>
  90. </div>
  91. <h3 id="methods">Methods
  92. </h3>
  93. <span class="small pull-right mobile-hide">
  94. <span class="divider">|</span>
  95. <a href="https://github.com/beat-saber-modding-group/BeatSaber-IPA-Reloaded/new/4.0.0-beta/docs/override/new?filename=IPA_IPlugin_OnActiveSceneChanged_UnityEngine_SceneManagement_Scene_UnityEngine_SceneManagement_Scene_.md&amp;value=---%0Auid%3A%20IPA.IPlugin.OnActiveSceneChanged(UnityEngine.SceneManagement.Scene%2CUnityEngine.SceneManagement.Scene)%0Asummary%3A%20'*You%20can%20override%20summary%20for%20the%20API%20here%20using%20*MARKDOWN*%20syntax'%0A---%0A%0A*Please%20type%20below%20more%20information%20about%20this%20API%3A*%0A%0A">Improve this Doc</a>
  96. </span>
  97. <span class="small pull-right mobile-hide">
  98. <a href="https://github.com/beat-saber-modding-group/BeatSaber-IPA-Reloaded/blob/b22da6961244326963e19ed7bfc40f19d74909a7/IPA.Loader/PluginInterfaces/BeatSaber/IPlugin.cs/#L51">View Source</a>
  99. </span>
  100. <a id="IPA_IPlugin_OnActiveSceneChanged_" data-uid="IPA.IPlugin.OnActiveSceneChanged*"></a>
  101. <h4 id="IPA_IPlugin_OnActiveSceneChanged_UnityEngine_SceneManagement_Scene_UnityEngine_SceneManagement_Scene_" data-uid="IPA.IPlugin.OnActiveSceneChanged(UnityEngine.SceneManagement.Scene,UnityEngine.SceneManagement.Scene)">OnActiveSceneChanged(Scene, Scene)</h4>
  102. <div class="markdown level1 summary"><p>Gets invoked whenever a scene is changed</p>
  103. </div>
  104. <div class="markdown level1 conceptual"></div>
  105. <h5 class="decalaration">Declaration</h5>
  106. <div class="codewrapper">
  107. <pre><code class="lang-csharp hljs">void OnActiveSceneChanged(Scene prevScene, Scene nextScene)</code></pre>
  108. </div>
  109. <h5 class="parameters">Parameters</h5>
  110. <table class="table table-bordered table-striped table-condensed">
  111. <thead>
  112. <tr>
  113. <th>Type</th>
  114. <th>Name</th>
  115. <th>Description</th>
  116. </tr>
  117. </thead>
  118. <tbody>
  119. <tr>
  120. <td><span class="xref">UnityEngine.SceneManagement.Scene</span></td>
  121. <td><span class="parametername">prevScene</span></td>
  122. <td><p>The Scene that was previously loaded</p>
  123. </td>
  124. </tr>
  125. <tr>
  126. <td><span class="xref">UnityEngine.SceneManagement.Scene</span></td>
  127. <td><span class="parametername">nextScene</span></td>
  128. <td><p>The Scene being loaded</p>
  129. </td>
  130. </tr>
  131. </tbody>
  132. </table>
  133. <span class="small pull-right mobile-hide">
  134. <span class="divider">|</span>
  135. <a href="https://github.com/beat-saber-modding-group/BeatSaber-IPA-Reloaded/new/4.0.0-beta/docs/override/new?filename=IPA_IPlugin_OnApplicationQuit.md&amp;value=---%0Auid%3A%20IPA.IPlugin.OnApplicationQuit%0Asummary%3A%20'*You%20can%20override%20summary%20for%20the%20API%20here%20using%20*MARKDOWN*%20syntax'%0A---%0A%0A*Please%20type%20below%20more%20information%20about%20this%20API%3A*%0A%0A">Improve this Doc</a>
  136. </span>
  137. <span class="small pull-right mobile-hide">
  138. <a href="https://github.com/beat-saber-modding-group/BeatSaber-IPA-Reloaded/blob/b22da6961244326963e19ed7bfc40f19d74909a7/IPA.Loader/PluginInterfaces/BeatSaber/IPlugin.cs/#L31">View Source</a>
  139. </span>
  140. <a id="IPA_IPlugin_OnApplicationQuit_" data-uid="IPA.IPlugin.OnApplicationQuit*"></a>
  141. <h4 id="IPA_IPlugin_OnApplicationQuit" data-uid="IPA.IPlugin.OnApplicationQuit">OnApplicationQuit()</h4>
  142. <div class="markdown level1 summary"><p>Gets invoked when the application is closed.</p>
  143. </div>
  144. <div class="markdown level1 conceptual"></div>
  145. <h5 class="decalaration">Declaration</h5>
  146. <div class="codewrapper">
  147. <pre><code class="lang-csharp hljs">void OnApplicationQuit()</code></pre>
  148. </div>
  149. <span class="small pull-right mobile-hide">
  150. <span class="divider">|</span>
  151. <a href="https://github.com/beat-saber-modding-group/BeatSaber-IPA-Reloaded/new/4.0.0-beta/docs/override/new?filename=IPA_IPlugin_OnEnable.md&amp;value=---%0Auid%3A%20IPA.IPlugin.OnEnable%0Asummary%3A%20'*You%20can%20override%20summary%20for%20the%20API%20here%20using%20*MARKDOWN*%20syntax'%0A---%0A%0A*Please%20type%20below%20more%20information%20about%20this%20API%3A*%0A%0A">Improve this Doc</a>
  152. </span>
  153. <span class="small pull-right mobile-hide">
  154. <a href="https://github.com/beat-saber-modding-group/BeatSaber-IPA-Reloaded/blob/b22da6961244326963e19ed7bfc40f19d74909a7/IPA.Loader/PluginInterfaces/BeatSaber/IPlugin.cs/#L26">View Source</a>
  155. </span>
  156. <a id="IPA_IPlugin_OnEnable_" data-uid="IPA.IPlugin.OnEnable*"></a>
  157. <h4 id="IPA_IPlugin_OnEnable" data-uid="IPA.IPlugin.OnEnable">OnEnable()</h4>
  158. <div class="markdown level1 summary"><p>Called when a plugin is enabled. This is where you should set up Harmony patches and the like.</p>
  159. </div>
  160. <div class="markdown level1 conceptual"></div>
  161. <h5 class="decalaration">Declaration</h5>
  162. <div class="codewrapper">
  163. <pre><code class="lang-csharp hljs">void OnEnable()</code></pre>
  164. </div>
  165. <h5 id="IPA_IPlugin_OnEnable_remarks">Remarks</h5>
  166. <div class="markdown level1 remarks"><p>This will be called after <code>Init</code>, and will be called when the plugin loads normally too.
  167. When a plugin is disabled at startup, neither this nor Init will be called until it is enabled.</p>
  168. <p>Init will only ever be called once.</p>
  169. </div>
  170. <span class="small pull-right mobile-hide">
  171. <span class="divider">|</span>
  172. <a href="https://github.com/beat-saber-modding-group/BeatSaber-IPA-Reloaded/new/4.0.0-beta/docs/override/new?filename=IPA_IPlugin_OnSceneLoaded_UnityEngine_SceneManagement_Scene_UnityEngine_SceneManagement_LoadSceneMode_.md&amp;value=---%0Auid%3A%20IPA.IPlugin.OnSceneLoaded(UnityEngine.SceneManagement.Scene%2CUnityEngine.SceneManagement.LoadSceneMode)%0Asummary%3A%20'*You%20can%20override%20summary%20for%20the%20API%20here%20using%20*MARKDOWN*%20syntax'%0A---%0A%0A*Please%20type%20below%20more%20information%20about%20this%20API%3A*%0A%0A">Improve this Doc</a>
  173. </span>
  174. <span class="small pull-right mobile-hide">
  175. <a href="https://github.com/beat-saber-modding-group/BeatSaber-IPA-Reloaded/blob/b22da6961244326963e19ed7bfc40f19d74909a7/IPA.Loader/PluginInterfaces/BeatSaber/IPlugin.cs/#L38">View Source</a>
  176. </span>
  177. <a id="IPA_IPlugin_OnSceneLoaded_" data-uid="IPA.IPlugin.OnSceneLoaded*"></a>
  178. <h4 id="IPA_IPlugin_OnSceneLoaded_UnityEngine_SceneManagement_Scene_UnityEngine_SceneManagement_LoadSceneMode_" data-uid="IPA.IPlugin.OnSceneLoaded(UnityEngine.SceneManagement.Scene,UnityEngine.SceneManagement.LoadSceneMode)">OnSceneLoaded(Scene, LoadSceneMode)</h4>
  179. <div class="markdown level1 summary"><p>Gets invoked whenever a scene is loaded.</p>
  180. </div>
  181. <div class="markdown level1 conceptual"></div>
  182. <h5 class="decalaration">Declaration</h5>
  183. <div class="codewrapper">
  184. <pre><code class="lang-csharp hljs">void OnSceneLoaded(Scene scene, LoadSceneMode sceneMode)</code></pre>
  185. </div>
  186. <h5 class="parameters">Parameters</h5>
  187. <table class="table table-bordered table-striped table-condensed">
  188. <thead>
  189. <tr>
  190. <th>Type</th>
  191. <th>Name</th>
  192. <th>Description</th>
  193. </tr>
  194. </thead>
  195. <tbody>
  196. <tr>
  197. <td><span class="xref">UnityEngine.SceneManagement.Scene</span></td>
  198. <td><span class="parametername">scene</span></td>
  199. <td><p>The scene currently loaded</p>
  200. </td>
  201. </tr>
  202. <tr>
  203. <td><span class="xref">UnityEngine.SceneManagement.LoadSceneMode</span></td>
  204. <td><span class="parametername">sceneMode</span></td>
  205. <td><p>The type of loading</p>
  206. </td>
  207. </tr>
  208. </tbody>
  209. </table>
  210. <span class="small pull-right mobile-hide">
  211. <span class="divider">|</span>
  212. <a href="https://github.com/beat-saber-modding-group/BeatSaber-IPA-Reloaded/new/4.0.0-beta/docs/override/new?filename=IPA_IPlugin_OnSceneUnloaded_UnityEngine_SceneManagement_Scene_.md&amp;value=---%0Auid%3A%20IPA.IPlugin.OnSceneUnloaded(UnityEngine.SceneManagement.Scene)%0Asummary%3A%20'*You%20can%20override%20summary%20for%20the%20API%20here%20using%20*MARKDOWN*%20syntax'%0A---%0A%0A*Please%20type%20below%20more%20information%20about%20this%20API%3A*%0A%0A">Improve this Doc</a>
  213. </span>
  214. <span class="small pull-right mobile-hide">
  215. <a href="https://github.com/beat-saber-modding-group/BeatSaber-IPA-Reloaded/blob/b22da6961244326963e19ed7bfc40f19d74909a7/IPA.Loader/PluginInterfaces/BeatSaber/IPlugin.cs/#L44">View Source</a>
  216. </span>
  217. <a id="IPA_IPlugin_OnSceneUnloaded_" data-uid="IPA.IPlugin.OnSceneUnloaded*"></a>
  218. <h4 id="IPA_IPlugin_OnSceneUnloaded_UnityEngine_SceneManagement_Scene_" data-uid="IPA.IPlugin.OnSceneUnloaded(UnityEngine.SceneManagement.Scene)">OnSceneUnloaded(Scene)</h4>
  219. <div class="markdown level1 summary"><p>Gets invoked whenever a scene is unloaded</p>
  220. </div>
  221. <div class="markdown level1 conceptual"></div>
  222. <h5 class="decalaration">Declaration</h5>
  223. <div class="codewrapper">
  224. <pre><code class="lang-csharp hljs">void OnSceneUnloaded(Scene scene)</code></pre>
  225. </div>
  226. <h5 class="parameters">Parameters</h5>
  227. <table class="table table-bordered table-striped table-condensed">
  228. <thead>
  229. <tr>
  230. <th>Type</th>
  231. <th>Name</th>
  232. <th>Description</th>
  233. </tr>
  234. </thead>
  235. <tbody>
  236. <tr>
  237. <td><span class="xref">UnityEngine.SceneManagement.Scene</span></td>
  238. <td><span class="parametername">scene</span></td>
  239. <td><p>The unloaded scene</p>
  240. </td>
  241. </tr>
  242. </tbody>
  243. </table>
  244. <h3 id="extensionmethods">Extension Methods</h3>
  245. <div>
  246. <a class="xref" href="IPA.Utilities.ReflectionUtil.html#IPA_Utilities_ReflectionUtil_SetField_System_Object_System_String_System_Object_">ReflectionUtil.SetField(Object, String, Object)</a>
  247. </div>
  248. <div>
  249. <a class="xref" href="IPA.Utilities.ReflectionUtil.html#IPA_Utilities_ReflectionUtil_SetField__1___0_System_String_System_Object_">ReflectionUtil.SetField&lt;T&gt;(T, String, Object)</a>
  250. </div>
  251. <div>
  252. <a class="xref" href="IPA.Utilities.ReflectionUtil.html#IPA_Utilities_ReflectionUtil_GetField__1_System_Object_System_String_">ReflectionUtil.GetField&lt;T&gt;(Object, String)</a>
  253. </div>
  254. <div>
  255. <a class="xref" href="IPA.Utilities.ReflectionUtil.html#IPA_Utilities_ReflectionUtil_GetField__2___1_System_String_">ReflectionUtil.GetField&lt;T, U&gt;(U, String)</a>
  256. </div>
  257. <div>
  258. <a class="xref" href="IPA.Utilities.ReflectionUtil.html#IPA_Utilities_ReflectionUtil_SetProperty_System_Object_System_String_System_Object_">ReflectionUtil.SetProperty(Object, String, Object)</a>
  259. </div>
  260. <div>
  261. <a class="xref" href="IPA.Utilities.ReflectionUtil.html#IPA_Utilities_ReflectionUtil_SetProperty__1___0_System_String_System_Object_">ReflectionUtil.SetProperty&lt;T&gt;(T, String, Object)</a>
  262. </div>
  263. <div>
  264. <a class="xref" href="IPA.Utilities.ReflectionUtil.html#IPA_Utilities_ReflectionUtil_InvokeMethod_System_Object_System_String_System_Object___">ReflectionUtil.InvokeMethod(Object, String, Object[])</a>
  265. </div>
  266. <div>
  267. <a class="xref" href="IPA.Utilities.ReflectionUtil.html#IPA_Utilities_ReflectionUtil_InvokeMethod__1___0_System_String_System_Object___">ReflectionUtil.InvokeMethod&lt;T&gt;(T, String, Object[])</a>
  268. </div>
  269. <div>
  270. <a class="xref" href="IPA.Utilities.ReflectionUtil.html#IPA_Utilities_ReflectionUtil_InvokeMethod__1_System_Object_System_String_System_Object___">ReflectionUtil.InvokeMethod&lt;T&gt;(Object, String, Object[])</a>
  271. </div>
  272. <div>
  273. <a class="xref" href="IPA.Utilities.ReflectionUtil.html#IPA_Utilities_ReflectionUtil_InvokeMethod__2___1_System_String_System_Object___">ReflectionUtil.InvokeMethod&lt;T, U&gt;(U, String, Object[])</a>
  274. </div>
  275. </article>
  276. </div>
  277. <div class="hidden-sm col-md-2" role="complementary">
  278. <div class="sideaffix">
  279. <div class="contribution">
  280. <ul class="nav">
  281. <li>
  282. <a href="https://github.com/beat-saber-modding-group/BeatSaber-IPA-Reloaded/new/4.0.0-beta/docs/override/new?filename=IPA_IPlugin.md&amp;value=---%0Auid%3A%20IPA.IPlugin%0Asummary%3A%20'*You%20can%20override%20summary%20for%20the%20API%20here%20using%20*MARKDOWN*%20syntax'%0A---%0A%0A*Please%20type%20below%20more%20information%20about%20this%20API%3A*%0A%0A" class="contribution-link">Improve this Doc</a>
  283. </li>
  284. <li>
  285. <a href="https://github.com/beat-saber-modding-group/BeatSaber-IPA-Reloaded/blob/b22da6961244326963e19ed7bfc40f19d74909a7/IPA.Loader/PluginInterfaces/BeatSaber/IPlugin.cs/#L14" class="contribution-link">View Source</a>
  286. </li>
  287. </ul>
  288. </div>
  289. <nav class="bs-docs-sidebar hidden-print hidden-xs hidden-sm affix" id="affix">
  290. <!-- <p><a class="back-to-top" href="#top">Back to top</a><p> -->
  291. </nav>
  292. </div>
  293. </div>
  294. </div>
  295. </div>
  296. <footer>
  297. <div class="grad-bottom"></div>
  298. <div class="footer">
  299. <div class="container">
  300. <span class="pull-right">
  301. <a href="#top">Back to top</a>
  302. </span>
  303. <span>Generated by <strong>DocFX</strong></span>
  304. </div>
  305. </div>
  306. </footer>
  307. </div>
  308. <script type="text/javascript" src="../styles/docfx.vendor.js"></script>
  309. <script type="text/javascript" src="../styles/docfx.js"></script>
  310. <script type="text/javascript" src="../styles/main.js"></script>
  311. </body>
  312. </html>