UnityHotReload

v1.0.1·Updated 2025-11-06

Tool for hot reloading your code inside your BepInEx environment.

About this mod Author’s original text

UnityHotReload

Tool for hot reloading your code inside your BepInEx environment.

Setup

Your BepInEx plugin project needs a reference to UnityHotReload.dll.

You can add this reference in several ways, one of them is to download the latest release, extract the zip, and reference the DLL from there.

Once your plugin is built and running, you can trigger a hot reload right after recompiling your code in your IDE by calling:

void Update()

{

if (Input.GetKeyUp(KeyCode.F2))

{

UnityHotReload.LoadNewAssemblyVersion(

typeof(ExamplePlugin).Assembly, // The currently loaded assembly to replace.

"C:/dev/MyPlugin/MyPlugin.dll" // The path to the newly compiled DLL.

);

}

}

Limitations

Treat all types (classes, structs, etc.) as having a fixed set of fields. You should not add, remove, or change fields, or convert fields to properties (and vice versa). This limitation exists because UnityHotReload preserves the existing runtime state by redirecting all active references to the original type definitions.

You can freely modify method bodies, add or remove methods, reorganize code, add whole new classes or structs, but the structure and identity of existing fields themselves must remain consistent.

Install & use Install: BepInEx plugin

  1. The archive from playbuff is the mod itself — usually a BepInEx plugin (a .dll or a plugin folder once unzipped).
  2. Recommended: use a community mod manager (such as r2modman) — pick this game, import the mod, and the manager sets up BepInEx and its dependencies for you.
  3. Manual route: install the BepInEx loader in the game folder, then drop the unzipped .dll or plugin folder into BepInEx/plugins/.
  4. Launch the game — the BepInEx console logs every plugin it loads; seeing this mod in the log means it is installed.

Mods with listed dependencies need those installed too, or they will not load. Options are usually changed in-game or in the plugin's config file.

File & checksum

Filename
UnityHotReload-1.0.1.zip
File size
21.0 KiB