Code Monkey home page Code Monkey logo

unityexplorer's Introduction

๐Ÿ” An in-game UI for exploring, debugging and modifying Unity games.

โœ”๏ธ Supports most Unity versions from 5.2 to 2021+ (IL2CPP and Mono).

โšก UnityExplorer is on Thunderstore! (and as IL2CPP)

Releases

BepInEx

Release IL2CPP Mono
BIE 6.X โœ… link โœ… link
BIE 5.X โœ–๏ธ n/a โœ… link
  1. Take the UnityExplorer.BIE.[version].dll file and put it in BepInEx\plugins\
  2. In IL2CPP, you will need to download the Unity libs for the game's Unity version, create a folder BepInEx\unity-libs\, then extract the Unity libs into this folder.

Note: BepInEx 6 is obtainable via BepisBuilds

MelonLoader

Release IL2CPP Mono
ML 0.4+ โœ… link โœ… link
  1. Take the UnityExplorer.ML.[version].dll file and put it in the Mods\ folder created by MelonLoader.

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: HarmonyX, and the IL2CPP version also requires that you set up an Il2CppAssemblyUnhollower runtime.

  1. Load the required libs - HarmonyX, and Il2CppAssemblyUnhollower if IL2CPP
  2. Load the UnityExplorer DLL
  3. Create an instance of Unity Explorer with UnityExplorer.ExplorerStandalone.CreateInstance();
  4. Optionally subscribe to the ExplorerStandalone.OnLog event to handle logging if you wish

Known issues

C# Console completions are inaccurate or incomplete

[IL2CPP] List or Dictionary fails to enumerate

[MelonLoader] Game classes do not load / all non-Unity components show up as "UnityEngine.Component"

  • Unsure of the cause of this issue. Try with BepInEx, or create a mod which uses a class from Assembly-CSharp and load it alongside UnityExplorer. Seems to be an issue with MelonLoader not being able to do Assembly.Load on the unhollowed Assembly-CSharp for some reason, despite the fact that referencing the assembly from a mod and loading it that way works fine.

Features

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.

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 a GameObject, 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 objects, there is a View Texture button at the top of the inspector which lets you view it and save it as a PNG file. Currently there are no other similar helpers yet, but I may add more at some point for Mesh, Sprite, Material, etc

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 the 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.

Mouse-Inspect

  • The "Mouse Inspect" dropdown on the main UnityExplorer navbar allows you to inspect objects under the mouse.
    • World: uses Physics.Raycast to look for Colliders
    • UI: uses GraphicRaycasters to find UI objects

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}\UnityExplorer\config.ini

Building

If you fork the repository on GitHub you can build using the dotnet workflow:

  1. Click on the Actions tab and enable workflows in your repository
  2. Click on the "Build UnityExplorer" workflow, then click "Run Workflow" and run it manually, or make a new commit to trigger the workflow.
  3. Take the artifact from the completed run.

For Visual Studio:

  1. Clone the repository and run git submodule update --init --recursive to get the submodules.
  2. Open the src\UnityExplorer.sln project.
  3. Build mcs (Release/AnyCPU, you may need to run nuget restore mcs.sln), and if using IL2CPP then build Il2CppAssemblyUnhollower (Release/AnyCPU) as well.
  4. Build the UnityExplorer release(s) you want to use, either by selecting the config as the Active Config, or batch-building.

Acknowledgments

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.

unityexplorer's People

Contributors

herpderpinstine avatar js6pak avatar sinai-dev avatar smaeditor avatar tanamichi avatar

Stargazers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.