UnityExplorer
An in-game UI for exploring, debugging and modifying IL2CPP and Mono Unity games.
Top Related Projects
Unity / XNA game patcher and plugin framework
.NET debugger and assembly editor
A library for patching, replacing and decorating .NET and Mono methods during runtime
The World's First Universal Mod Loader for Unity Games compatible with both Il2Cpp and Mono
Quick Overview
UnityExplorer is an in-game debugging and exploration tool for Unity games and applications. It provides a powerful runtime inspector and console, allowing developers and modders to inspect and manipulate game objects, components, and other Unity elements during runtime. UnityExplorer is particularly useful for reverse engineering and modding Unity games.
Pros
- Comprehensive runtime inspection and manipulation of Unity objects and components
- Powerful in-game console for executing C# code and Unity commands
- Supports multiple Unity versions and is compatible with various mod loaders
- Customizable UI and extensive feature set for debugging and exploration
Cons
- May impact game performance when active, especially in resource-intensive games
- Requires some knowledge of Unity and C# to fully utilize its capabilities
- Can potentially be used for cheating or exploiting games if misused
- May not work with all Unity games, especially those with strong anti-cheat measures
Code Examples
- Accessing and modifying a GameObject's position:
var player = GameObject.Find("Player");
player.transform.position = new Vector3(0, 10, 0);
- Listing all components on a GameObject:
var obj = Selection.activeGameObject;
foreach (var component in obj.GetComponents<Component>())
{
Debug.Log($"Component: {component.GetType().Name}");
}
- Invoking a method on a specific component:
var healthComponent = player.GetComponent<Health>();
healthComponent.SendMessage("Heal", 50);
- Creating a new GameObject with a custom component:
var newObj = new GameObject("CustomObject");
newObj.AddComponent<CustomBehavior>();
Getting Started
To use UnityExplorer in a Unity game:
- Download the latest release from the GitHub repository.
- Install a compatible mod loader for your game (e.g., BepInEx, MelonLoader).
- Place the UnityExplorer.dll file in the appropriate plugins folder of your mod loader.
- Launch the game and press the configured hotkey (default: F7) to open UnityExplorer.
- Use the various tabs and features to inspect and manipulate game objects and components.
Note: Ensure you have the necessary permissions and comply with the game's terms of service when using UnityExplorer.
Competitor Comparisons
Unity / XNA game patcher and plugin framework
Pros of BepInEx
- More versatile and can be used with a wider range of Unity games and applications
- Provides a robust plugin system for easy mod development and management
- Offers extensive documentation and a larger community for support
Cons of BepInEx
- Requires more setup and configuration compared to UnityExplorer
- May have a steeper learning curve for beginners
- Less focused on runtime inspection and debugging features
Code Comparison
UnityExplorer:
public static void Init()
{
UIManager.Init();
Inspector.Init();
ObjectExplorer.Init();
}
BepInEx:
[BepInPlugin("com.example.plugin", "Example Plugin", "1.0.0")]
public class ExamplePlugin : BaseUnityPlugin
{
private void Awake()
{
// Plugin startup logic
Logger.LogInfo($"Plugin {Info.Metadata.GUID} is loaded!");
}
}
UnityExplorer focuses on providing runtime inspection and debugging tools, while BepInEx offers a more comprehensive framework for mod development and plugin management. UnityExplorer's code snippet shows initialization of its core components, whereas BepInEx's example demonstrates the structure of a basic plugin using its framework.
.NET debugger and assembly editor
Pros of dnSpy
- More comprehensive .NET debugging and decompilation capabilities
- Supports a wider range of .NET applications beyond Unity
- Advanced features like editing and recompiling assemblies
Cons of dnSpy
- Not specifically tailored for Unity development
- May have a steeper learning curve for Unity-specific tasks
- Less integrated with Unity's runtime environment
Code Comparison
UnityExplorer:
public static void Init()
{
UIManager.Instance.ShowMenu();
SceneExplorer.Init();
ObjectExplorer.Init();
}
dnSpy:
public static void Initialize(StartupInfo startupInfo)
{
InitializeCore(startupInfo);
InitializeSettings();
InitializeUI();
}
Key Differences
UnityExplorer is specifically designed for Unity game development, offering features like runtime inspection and modification of Unity objects. It integrates seamlessly with Unity's ecosystem, making it more accessible for Unity developers.
dnSpy, on the other hand, is a general-purpose .NET debugger and decompiler. It provides more advanced features for .NET development but may require additional setup and knowledge to use effectively with Unity projects.
Choose UnityExplorer for Unity-specific tasks and quick runtime debugging, while dnSpy is better suited for in-depth .NET analysis and more complex debugging scenarios across various .NET applications.
A library for patching, replacing and decorating .NET and Mono methods during runtime
Pros of Harmony
- More focused on runtime patching and method manipulation
- Extensive documentation and community support
- Lightweight and efficient for specific modding tasks
Cons of Harmony
- Limited in-game debugging capabilities
- Less comprehensive Unity-specific features
- Steeper learning curve for beginners
Code Comparison
UnityExplorer:
// Inspecting a GameObject
var go = GameObject.Find("Player");
UnityExplorer.InspectorManager.Inspect(go);
Harmony:
// Patching a method
var harmony = new Harmony("com.example.patch");
var original = typeof(Enemy).GetMethod("TakeDamage");
var prefix = typeof(MyPatch).GetMethod("Prefix");
harmony.Patch(original, prefix: new HarmonyMethod(prefix));
Summary
UnityExplorer is a comprehensive in-game debugging and exploration tool for Unity, offering a wide range of features for runtime inspection and manipulation. Harmony, on the other hand, specializes in runtime method patching and is widely used for game modding. While UnityExplorer provides a more user-friendly interface for debugging, Harmony excels in efficient code manipulation. The choice between the two depends on the specific needs of the project, with UnityExplorer being more suitable for general Unity development and Harmony for targeted modding tasks.
The World's First Universal Mod Loader for Unity Games compatible with both Il2Cpp and Mono
Pros of MelonLoader
- More comprehensive modding framework for Unity games
- Supports a wider range of Unity versions and game types
- Offers a plugin system for extending functionality
Cons of MelonLoader
- Steeper learning curve for beginners
- Requires more setup and configuration
- May have a higher performance impact on some games
Code Comparison
MelonLoader:
[MelonInfo(typeof(MyMod), "MyMod", "1.0.0", "Author")]
public class MyMod : MelonMod
{
public override void OnApplicationStart()
{
// Mod initialization code
}
}
UnityExplorer:
public class MyPlugin : UnityExplorerPlugin
{
public override void OnInitialized()
{
// Plugin initialization code
}
}
MelonLoader provides a more structured approach for creating mods, with built-in attributes and lifecycle methods. UnityExplorer's plugin system is simpler but may offer less control over the modding process.
Both tools serve different purposes: MelonLoader is a full-fledged modding framework, while UnityExplorer is primarily a runtime inspection and debugging tool with some modding capabilities. The choice between them depends on the specific needs of the project and the developer's experience level.
Convert designs to code with AI
Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.
Try Visual CopilotREADME
ð An in-game UI for exploring, debugging and modifying Unity games.
âï¸ Supports most Unity versions from 5.2 to 2021+ (IL2CPP and Mono).
⨠Powered by UniverseLib
Releases
â¡ Thunderstore releases: BepInEx Mono | BepInEx IL2CPP | MelonLoader IL2CPP
Release schedule
Releases will be posted at most once per week, generally on weekends.
Nightly builds can be found here.
BepInEx
Release | IL2CPP | Mono |
---|---|---|
BIE 6.X | â link | â link |
BIE 6.X (CoreCLR) | â link | â |
BIE 5.X | âï¸ n/a | â link |
- Unzip the release file into a folder
- Take the
plugins/sinai-dev-UnityExplorer
folder and place it inBepInEx/plugins/
Note: BepInEx 6 is obtainable via builds.bepinex.dev
MelonLoader
Release | IL2CPP | Mono |
---|---|---|
ML 0.5 | â link | â link |
ML 0.6 | â link | âï¸ |
- Unzip the release file into a folder
- Copy the DLL inside the
Mods
folder into your MelonLoaderMods
folder - Copy all of the DLLs inside the
UserLibs
folder into your MelonLoaderUserLibs
folder
Standalone
IL2CPP | Mono |
---|---|
â link | â link |
The standalone release can be used with any injector or loader of your choice, but it requires you to load the dependencies manually.
- Ensure the required libs are loaded - UniverseLib, HarmonyX and MonoMod. Take them from the
UnityExplorer.Editor
release if you need them. - For IL2CPP, load Il2CppAssemblyUnhollower and start an Il2CppAssemblyUnhollower runtime
- Load the UnityExplorer DLL
- Create an instance of Unity Explorer with
UnityExplorer.ExplorerStandalone.CreateInstance();
- Optionally subscribe to the
ExplorerStandalone.OnLog
event to handle logging if you wish
Unity Editor
- Download the
UnityExplorer.Editor
release. - Install the package, either by using the Package Manager and importing the
package.json
file, or by manually dragging the folder into yourAssets
folder. - Drag the
Runtime/UnityExplorer
prefab into your scene, or create a GameObject and add theExplorer Editor Behaviour
script to it.
Common issues and solutions
Although UnityExplorer should work out of the box for most Unity games, in some cases you may need to tweak the settings for it to work properly.
To adjust the settings, open the config file:
- BepInEx:
BepInEx\config\com.sinai.unityexplorer.cfg
- MelonLoader:
UserData\MelonPreferences.cfg
- Standalone:
sinai-dev-UnityExplorer\config.cfg
Try adjusting the following settings and see if it fixes your issues:
Startup_Delay_Time
- increase to 5-10 seconds (or more as needed), can fix issues with UnityExplorer being destroyed or corrupted during startup.Disable_EventSystem_Override
- if input is not working properly, try setting this totrue
.
If these fixes do not work, please create an issue in this repo and I'll do my best to look into it.
Features
Inspector API
If you want to inspect an object or Type from outside the C# console, use the InspectorManager
class:
To inspect an object:
UnityExplorer.InspectorManager.Inspect(theObject);
To inspect a Type:
UnityExplorer.InspectorManager.Inspect(typeof(SomeClass));
Object Explorer
- Use the Scene Explorer tab to traverse the active scenes, as well as the DontDestroyOnLoad and HideAndDontSave objects.
- The "HideAndDontSave" scene contains objects with that flag, as well as Assets and Resources which are not in any scene but behave the same way.
- You can use the Scene Loader to easily load any of the scenes in the build (may not work for Unity 5.X games)
- Use the Object Search tab to search for Unity objects (including GameObjects, Components, etc), C# Singletons or Static Classes.
- Use the UnityObject search to look for any objects which derive from
UnityEngine.Object
, with optional filters - The singleton search will look for any classes with a typical "Instance" field, and check it for a current value. This may cause unexpected behaviour in some IL2CPP games as we cannot distinguish between true properties and field-properties, so some property accessors will be invoked.
- Use the UnityObject search to look for any objects which derive from
Inspector
The inspector is used to see detailed information on objects of any type and manipulate their values, as well as to inspect C# Classes with static reflection.
- The GameObject Inspector (tab prefix
[G]
) is used to inspect aGameObject
, and to see and manipulate its Transform and Components.- You can edit any of the input fields in the inspector (excluding readonly fields) and press Enter to apply your changes. You can also do this to the GameObject path as a way to change the GameObject's parent. Press the Escape key to cancel your edits.
- note: When inspecting a GameObject with a Canvas, the transform controls may be overridden by the RectTransform anchors.
- The Reflection Inspectors (tab prefix
[R]
and[S]
) are used for everything else- Automatic updating is not enabled by default, and you must press Apply for any changes you make to take effect.
- Press the
â¼
button to expand certain values such as strings, enums, lists, dictionaries, some structs, etc - Use the filters at the top to quickly find the members you are looking for
- For
Texture2D
,Image
,Sprite
andMaterial
objects, there is aView Texture
button at the top of the inspector which lets you view the Texture(s) and save them as a PNG file. - For
AudioClip
objects there is aShow Player
button which opens an audio player widget. For clips which are loaded asDecompressOnLoad
, there is also a button to save them to a.wav
file.
C# Console
- The C# Console uses the
Mono.CSharp.Evaluator
to define temporary classes or run immediate REPL code. - You can execute a script automatically on startup by naming it
startup.cs
and placing it in thesinai-dev-UnityExplorer\Scripts\
folder (this folder will be created where you placed the DLL file). - See the "Help" dropdown in the C# console menu for more detailed information.
Hook Manager
- The Hooks panel allows you to hook methods at the click of a button for debugging purposes.
- Simply enter any class and hook the methods you want from the menu.
- You can edit the source code of the generated hook with the "Edit Hook Source" button. Accepted method names are
Prefix
(which can returnbool
orvoid
),Postfix
,Finalizer
(which can returnException
orvoid
), andTranspiler
(which must returnIEnumerable<HarmonyLib.CodeInstruction>
). You can define multiple patches if you wish.
Mouse-Inspect
- The "Mouse Inspect" dropdown in the "Inspector" panel allows you to inspect objects under the mouse.
- World: uses Physics.Raycast to look for Colliders
- UI: uses GraphicRaycasters to find UI objects
Freecam
- UnityExplorer provides a basic Free Camera which you can control with your keyboard and mouse.
- Unlike all other features of UnityExplorer, you can still use Freecam while UnityExplorer's menu is hidden.
- Supports using the game's main Camera or a separate custom Camera.
- See the Freecam panel for further instructions and details.
Clipboard
- The "Clipboard" panel allows you to see your current paste value, or clear it (resets it to
null
)- Can copy the value from any member in a Reflection Inspector, Enumerable or Dictionary, and from the target of any Inspector tab
- Can paste values onto any member in a Reflection Inspector
- Non-parsable arguments in Method/Property Evaluators allow pasting values
- The C# Console has helper methods
Copy(obj)
andPaste()
for accessing the Clipboard
Settings
- You can change the settings via the "Options" tab of the menu, or directly from the config file.
- BepInEx:
BepInEx\config\com.sinai.unityexplorer.cfg
- MelonLoader:
UserData\MelonPreferences.cfg
- Standalone
{DLL_location}\sinai-dev-UnityExplorer\config.cfg
- BepInEx:
Building
- Run the
build.ps1
powershell script to build UnityExplorer. Releases are found in theRelease
folder.
Building individual configurations from your IDE is fine, though note that the intial build process builds into Release/<version>/...
instead of the subfolders that the powershell script uses. Batch building is not currently supported with the project.
Acknowledgments
- ManlyMarco for Runtime Unity Editor [license], the ScriptEvaluator from RUE's REPL console was used as the base for UnityExplorer's C# console.
- Geoffrey Horsington for mcs-unity [no license], used as the
Mono.CSharp
reference for the C# Console.
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.
Top Related Projects
Unity / XNA game patcher and plugin framework
.NET debugger and assembly editor
A library for patching, replacing and decorating .NET and Mono methods during runtime
The World's First Universal Mod Loader for Unity Games compatible with both Il2Cpp and Mono
Convert designs to code with AI
Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.
Try Visual Copilot