Unity Explorer Tree Snapshooter
A mod that captures GameObject hierarchy and component state to text files. Useful for Debugging with AI.
模組介紹 作者原文
UnityExplorer Tree Snapshooter
A mod that captures GameObject hierarchy and component state to text files. Useful for Debugging with AI.
Preview
Dependencies
This mod requires:
- UnityExplorer - Required for the Inspector panel
- UniverseLib - UI framework used by UnityExplorer
How It Works
- Harmony Patch - Patches InspectorPanel.ConstructPanelContent to add a "Snapshot" button in UnityExplorer's Inspector title bar
- UI Panel - Opens SnapShooterPanel with:
- Current selection name and instance ID
- Save path input field (editable, retains custom path on selection change)
- "Snapshot Selection" button
- Log output area
- Snapshot Process - When clicking "Snapshot Selection":
- Gets the currently inspected GameObject from UnityExplorer's InspectorManager
- Builds the parent chain (path from scene root to selected object)
- Builds the children hierarchy (all descendants with instance IDs)
- Reads all component state via reflection for each GameObject
- Formats and saves to text file
- F7 Integration - The Snapshooter panel follows UnityExplorer's visibility toggle:
- When UnityExplorer is hidden (F7), the panel hides with it
- When UnityExplorer is shown (F7), the panel restores if it was open before
- Manually closing the panel (X) prevents it from reopening on F7 toggle
How to Use
- Install UnityExplorer and this mod in Game/BepInEx/plugins/
- Open UnityExplorer (default key: F7)
- Select a GameObject in the Inspector panel
- Click the "Snapshot" button in the Inspector title bar
- Edit the save path if desired, or use the default location
- Click "Snapshot Selection" to save
Snapshot Details
The snapshot output includes:
- Parent Hierarchy
=== PARENT HIERARCHY ===
Root (InstanceID: 100)
Level1 (InstanceID: 200)
Player (InstanceID: 300)
- Children Hierarchy
=== CHILDREN HIERARCHY ===
[0] Player (InstanceID: 300)
[1] Child1 (InstanceID: 301)
[1] Child2 (InstanceID: 302)
- Components
=== COMPONENTS ===
Transform (InstanceID: 456)
Rigidbody (InstanceID: 789)
- Reflection State
=== GAME OBJECT REFLECTION (ALL CHILDREN) ---
--- Player (InstanceID: 300) [SELECTED] ---
Transform (InstanceID: 456):
property m_LocalPosition: (0, 0, 0)
property m_LocalRotation: (0, 0, 0, 1)
Rigidbody (InstanceID: 789):
property mass: 1
--- Child1 (InstanceID: 301) ---
Transform (InstanceID: 1001):
property m_LocalPosition: (1, 2, 3)
- Outside References
When a field references a GameObject outside the selection, it's marked:
field m_Parent: [OUTSIDE_REFERENCE: InstanceID=999, Type=Transform] ParentName
Default Snapshot Location
By default, snapshots are saved to:
{Mod Location}/Snapshots/TreeSnapShooter_{GameObjectName}_{yyyy-MM-dd_HH-mm-ss}.txt
Example:
Game/BepInEx/plugins/UnityExplorerTreeSnapShooter/Snapshots/TreeSnapShooter_Player_2026-03-27_10-30-00.txt
Users can override the save path by entering a custom directory or file path in the input field.
How to set up
To manually set up, do the following
- Create the directory: Game\BepInEx\plugins\UnityExplorerTreeSnapShooter\.
- Extract the archive into any directory(recommend empty).
- Move the contents of the plugins\ directory from the archive into the BepInEx\plugins\UnityExplorerTreeSnapShooter\ directory you created.
- It should look like Game\BepInEx\plugins\UnityExplorerTreeSnapShooter\UnityExplorerTreeSnapShooter.dll
Launch the game.
If you liked the mod leave a star on GitHub it's free
安裝與使用 安裝:BepInEx 外掛
- 本站下載的壓縮包就是模組本體,通常是 BepInEx 外掛(解壓後得到 .dll 或外掛資料夾)。
- 建議流程:用社群模組管理器(如 r2modman)選中本遊戲後匯入該模組,管理器會自動裝好 BepInEx 前置並處理依賴。
- 手動流程:先在遊戲目錄裝好 BepInEx 載入器,再把解壓出的 .dll 或外掛資料夾放進 BepInEx/plugins/。
- 啟動遊戲,BepInEx 控制台會列印載入日誌;確認這個模組出現在日誌裡即為安裝成功。
帶「前置依賴」的模組需要一併安裝,否則不會載入。功能開關通常在遊戲內或外掛自帶的設定檔裡調整。
下面這些內容需要先安裝,否則該模組不會生效: