This allows a Unity project to utilize most of BepInEx plugins inside the editor
Important
From testing, this does not seem to support preloader plugins that modify the Assembly-CSharp assembly, such as MMHOOK.
For plugins that require dll generation, or other unique behaviours, run them on the game build first and then copy them into the editor's bepinex folder, or in the editor, for usage!
- In-editor BepInEx usage
- Supports in-project plugins
- Supports local/game/custom BepInEx target directories
- Most plugins can be replaced in-place as long as they have no long lasting dll hooks
- And more
This project is bundled with the following packages:
- Minimum Unity 2020.3 afaik
- Still needs more testing with how to handle older Unity versions
- Git
- Unity Project Patcher
Important
These options require git to be installed!
Install with the package manager:
- Open the Package Manager from
Window > Package Manager
- Click the '+' button in the top-left of the window
- Click 'Add package from git URL'
- Provide the URL of the this git repository:
https://github.com/nomnomab/unity-project-patcher-bepinex.git
- If you are using a specific version, you can append it to the end of the git URL, such as
#v1.2.3
- Click the 'add' button
Install with the manifest.json:
- Open the manifest at
[PROJECT_NAME]\Packages\manifest.json
- Insert the following as an entry:
"com.nomnom.unity-project-patcher-bepinex": "https://github.com/nomnomab/unity-project-patcher-bepinex.git"
- If you are using a specific version, you can append it to the end of the git URL, such as
#v1.2.3
You can press the Enable BepInEx
button in the tool window
Otherwise:
Edit > Project Settings > Player > Other Settings > Scripting Define Symbols
- Add a new entry for
ENABLE_BEPINEX
- Press "Apply"
- Wait for scripts to recompile
You can press the Disable BepInEx
button in the tool window
Otherwise:
Edit > Project Settings > Player > Other Settings > Scripting Define Symbols
- Remove the entry for
ENABLE_BEPINEX
if it exists - Press "Apply"
- Wait for scripts to recompile
Note
Can be made via Create > Unity Project Patcher > BepInEx User Settings
One will be made for you in the project root, upon entering the game, if one doesn't exist.
This config is where the main BepInEx settings are applied. It can also show you possible project-side plugins that may get loaded, as well as external plugins found in the normal BepInEx plugins folder.
Enables or disables BepInEx usage entirely.
Enables or disables the usage of scanning for plugins within the project itself.
- Local:
[PROJECT_NAME]\[GAME_NAME]\BepInEx
- Game:
[GAME_PATH]\BepInEx
- Custom: A custom path to a
BepInEx
folder- Not fully tested yet
Note
Can be made via Create > Unity Project Patcher > Plugin Blocker User Settings
This lets you block plugins from running their Awake
functions. Useful for plugins that use things that aren't
imported into the project, such as Steam usage.
Each name has to be in the format of Namespace.TypeName
.