Show / Hide Table of Contents

# Interface IPlugin

Interface for BSIPA plugins. Every class that implements this will be loaded if the DLL is placed at <install dir>/Plugins.

###### Namespace: IPA

###### Assembly: IPA.Loader.dll

##### Syntax

    [Obsolete("Use the attribute-based system instead.")]
    public interface IPlugin

##### Remarks

Mods implemented with this interface should handle being enabled at runtime properly, unless marked with the "no-runtime-enable" feature.

### Methods

| Improve this Doc View Source

#### OnActiveSceneChanged(Scene, Scene)

Gets invoked whenever a scene is changed

##### Declaration

    void OnActiveSceneChanged(Scene prevScene, Scene nextScene)

##### Parameters

Type | Name | Description
--- | --- | ---
UnityEngine.SceneManagement.Scene | prevScene | The Scene that was previously loaded
UnityEngine.SceneManagement.Scene | nextScene | The Scene being loaded

| Improve this Doc View Source

#### OnApplicationQuit()

Gets invoked when the application is closed.

##### Declaration

    void OnApplicationQuit()

| Improve this Doc View Source

#### OnEnable()

Called when a plugin is enabled. This is where you should set up Harmony patches and the like.

##### Declaration

    void OnEnable()

##### Remarks

This will be called after `Init`, and will be called when the plugin loads normally too. When a plugin is disabled at startup, neither this nor Init will be called until it is enabled.

Init will only ever be called once.

| Improve this Doc View Source

#### OnSceneLoaded(Scene, LoadSceneMode)

Gets invoked whenever a scene is loaded.

##### Declaration

    void OnSceneLoaded(Scene scene, LoadSceneMode sceneMode)

##### Parameters

Type | Name | Description
--- | --- | ---
UnityEngine.SceneManagement.Scene | scene | The scene currently loaded
UnityEngine.SceneManagement.LoadSceneMode | sceneMode | The type of loading

| Improve this Doc View Source

#### OnSceneUnloaded(Scene)

Gets invoked whenever a scene is unloaded

##### Declaration

    void OnSceneUnloaded(Scene scene)

##### Parameters

Type | Name | Description
--- | --- | ---
UnityEngine.SceneManagement.Scene | scene | The unloaded scene

### Extension Methods

ReflectionUtil.SetField(Object, String, Object)
ReflectionUtil.SetField<T>(T, String, Object)
ReflectionUtil.GetField<T>(Object, String)
ReflectionUtil.SetProperty(Object, String, Object)
ReflectionUtil.SetProperty<T>(T, String, Object)
ReflectionUtil.InvokeMethod(Object, String, Object[])
ReflectionUtil.InvokeMethod<T>(T, String, Object[])
ReflectionUtil.InvokeMethod<T>(Object, String, Object[])
ReflectionUtil.InvokeMethod<T, U>(U, String, Object[])