* Huge restructure/rewrite. No real changes to any functionality, just a cleaner and more manageable project.
An in-game explorer and a suite of debugging tools for IL2CPP and Mono Unity games, to aid with modding development.
Releases
Mod Loader | IL2CPP | Mono |
---|---|---|
BepInEx 6.X | ✅ link | ❔* link |
BepInEx 5.X | ❌ n/a | ✅ link |
MelonLoader 0.3 | ✅ link | ✅ link |
Standalone | ✅ link | ✅ link |
* BepInEx 6.X Mono release may not work on all games yet.
How to install
BepInEx
- Install BepInEx for your game. For IL2CPP you should use BepInEx 6 (Bleeding Edge), for Mono you should use BepInEx 5 (until Mono support stabilizes in BepInEx 6).
- Download the UnityExplorer release for BepInEx IL2CPP or Mono above.
- Take the
UnityExplorer.BIE.___.dll
file and put it in[GameFolder]\BepInEx\plugins\
- In IL2CPP, you will need to download the Unity libs for the game's Unity version and put them in the
BepInEx\unity-libs\
folder.
MelonLoader
- Install MelonLoader 0.3+ for your game. Version 0.3 is currently in pre-release, so you must "Enable ALPHA Releases" in your MelonLoader Installer settings to see the option for it.
- Download the UnityExplorer release for MelonLoader IL2CPP or Mono above.
- Take the
UnityExplorer.ML.___.dll
file and put it in the[GameFolder]\Mods\
folder.
Standalone
The standalone release is based on the BepInEx build, so it requires Harmony 2.0 (or HarmonyX) to function properly.
- Load the DLL from your mod or inject it. You must also make sure
0Harmony.dll
is loaded, andUnhollowerBaseLib.dll
for IL2CPP as well. - Create an instance of Unity Explorer with
UnityExplorer.ExplorerStandalone.CreateInstance();
- Optionally subscribe to the
ExplorerStandalone.OnLog
event to handle logging if you wish.
Features
- Scene Explorer: Simple menu to traverse the Transform heirarchy of the scene.
- GameObject Inspector: Various helpful tools to see and manipulate the GameObject, similar to what you can do in the Editor.
- Reflection Inspector: Inspect Properties and Fields. Can also set primitive values and evaluate primitive methods.
- Search: Search for UnityEngine.Objects with various filters, or use the helpers for static Instances and Classes.
- C# Console: Interactive console for evaluating C# methods on the fly, with some basic helpers.
- Inspect-under-mouse: Hover over an object with a collider and inspect it by clicking on it. There's also a UI mode to inspect UI objects.
C# Console Tips
The C# Console can be used to define temporary classes and methods, or it can be used to evaluate an expression, but you cannot do both at the same time.
For example, you could run this code to define a temporary class (it will be visible within the console until you run Reset();
).
public class MyClass
{
public static void Method()
{
UnityExplorer.ExplorerCore.Log("hello");
}
}
You could then delete or comment out the class and run the following expression to run that method:
MyClass.Method();
However, you cannot define a class and run it both at the same time. You must either define class(es) and run that, or define an expression and run that.
You can also make use of the helper methods in the console to simplify some tasks, which you can see listed when the console has nothing entered for input. These methods are not accessible within any temporary classes you define, they can only be used in the expression context.
Logging
Explorer saves all logs to disk (only keeps the most recent 10 logs). They can be found in a "UnityExplorer" folder in the same place as where you put the DLL file.
These logs are also visible in the Debug Console part of the UI.
Settings
You can change the settings via the "Options" page of the main menu, or directly from the config file (generated after first launch). The config file will be found either inside a "UnityExplorer" folder in the same directory as where you put the DLL file, or for BepInEx it will be at BepInEx\config\UnityExplorer\
.
Main Menu Toggle
(KeyCode)
- Default:
F7
- See this article for a full list of all accepted KeyCodes.
Force Unlock Mouse
(bool)
- Default:
true
- Forces the cursor to be unlocked and visible while the UnityExplorer menu is open, and prevents anything else taking control.
Default Page Limit
(int)
- Default:
25
- Sets the default items per page when viewing lists or search results.
- Requires a restart to take effect, apart from Reflection Inspector tabs.
Default Output Path
(string)
- Default:
Mods\UnityExplorer
- Where output is generated to, by default (for Texture PNG saving, etc).
Log Unity Debug
(bool)
- Default:
false
- Listens for Unity
Debug.Log
messages and prints them to UnityExplorer's log.
Hide on Startup
(bool)
- Default:
false
- If true, UnityExplorer will be hidden when you start the game, you must open it via the keybind.
Building
If you'd like to build this yourself, all you need to do is download this repository and build from Visual Studio.
- Open the
src\UnityExplorer.sln
project. - Select
Solution 'UnityExplorer' (1 of 1 project)
in the Solution Explorer panel, and set the Active config property to the version you want to build, then build it. Alternatively, use "Batch Build" and select all releases. - The DLLs are built to the
Release\
folder in the root of the repository. - If ILRepack complains about an error, just change the Active config to a different release and then back again. This sometimes happens for the first time you build the project.
The references are all inside the lib\
folder, if you need to change them for some reason then you can replace them there.
Acknowledgments
- ManlyMarco for Runtime Unity Editor (GPL), snippets from the REPL Console were used for UnityExplorer's C# Console.
- denikson (aka Horse) for mcs-unity (MIT), used as the
Mono.CSharp
reference for the C# Console. - HerpDerpenstine for MelonCoroutines (Apache), they were included for standalone Il2CPP coroutine support.
- InGameCodeEditor (Apache) was used as the base for the syntax highlighting for UnityExplorer's C# console (
UnityExplorer.UI.Main.CSConsole.Lexer
).
Disclaimer
UnityExplorer is in no way associated with Unity Technologies. "Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere.