API reference
Everything a mod uses from Lustral is in the Lustral namespace of Lustral.Api, which the SDK references for you. A mod reaches most of it through its Mod class: Log, Harmony, Config, Events, Coroutines, Assets, Game and Mods.
The mod
| Type | Description |
|---|---|
Mod | The base class of a mod's entry point. |
ModInfo | A mod's identity, as declared in its manifest (mod.toml). |
ILog | A log whose messages are tagged with their source. |
The game
| Type | Description |
|---|---|
GameInfo | Information about the running game, as reported by the game itself. |
ScriptingBackend | The scripting backend of a Unity game. |
GameEvents | Scene and frame events for a mod. |
SceneInfo | A Unity scene, represented without Unity types so that it is identical on every backend. |
Coroutines
| Type | Description |
|---|---|
Coroutines | A mod's coroutines: methods that run across multiple frames on the game's main thread, with identical behavior on Mono and IL2CPP. |
CoroutineHandle | A running coroutine. |
Wait | A condition that a coroutine waits for: yield return Wait.Seconds(1). |
Settings
| Type | Description |
|---|---|
ModConfig | A mod's settings file, Lustral/config/<id>.toml in the game folder. |
Assets
| Type | Description |
|---|---|
ModAssets | Loads Unity asset bundles shipped with a mod, on both Mono and IL2CPP: This also works in IL2CPP games whose builds do not include Unity's AssetBundle class, because Lustral calls the engine directly. |
ModAssetBundle | A loaded asset bundle (ModAssets.LoadBundle). |
Other mods
| Type | Description |
|---|---|
LoadedMods | The mods Lustral has loaded in the current session, including libraries, in load order. |