* Fix `Hide on Startup` not working * Fix for cases when we try to `scene.GetRootGameObjects()` but the scene has not yet fully loaded. * MelonLoader releases will no longer spam "Preferences Saved!" constantly in the Console log * Fix mistake with UI Event System setting/releasing * Fix some UI elements not having correct Color transition values
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 |
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.
Issues and contributions
Both issue reports and PR contributions are welcome in this repository.
Issue reporting
To report an issue with UnityExplorer, please use the following template (as well as any other information / images you can provide).
Please upload the required log files on Pastebin and include a link to your paste:
- All reports: Unity's
output_log.txt
orPlayer.log
, should be found at%userprofile%\AppData\LocalLow\[Company]\[Game]\
unless redirected. - BepInEx:
BepInEx\LogOutput.log
- MelonLoader:
MelonLoader\Latest.log
Template:
* OS Platform:
* Display resolution:
* Game(s) tested on:
* UnityExplorer version(s) tested:
* Description of issue:
* Unity log pastebin link:
* Mod Loader log pastebin link:
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.
Depending on the release you are using, the config file will be found at:
- BepInEx:
BepInEx\config\com.sinai.unityexplorer.cfg
- MelonLoader:
UserData\MelonPreferences.cfg
- Standalone
{DLL_location}\UnityExplorer\config.ini
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
Building the project should be straight-forward, the references are all inside the lib\
folder.
- Open the
src\UnityExplorer.sln
project in Visual Studio. - 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.
Acknowledgments
- ManlyMarco for Runtime Unity Editor, snippets from the REPL Console were used for UnityExplorer's C# Console.
- denikson (aka Horse) for mcs-unity, used as the
Mono.CSharp
reference for the C# Console. - HerpDerpenstine for MelonCoroutines, they were included for standalone IL2CPP coroutine support.
- InGameCodeEditor 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.