M3: Hierarchy panel — click a GameObject to select it
HierarchyPanel walks IWorld.Roots/GameObject.Children recursively as ImGui tree nodes, clicking one sets EditorState.Selected — the shared selection the not-yet-built Inspector panel will read from the same instance. PushID(go.GetHashCode()) scopes each node's ID by object identity rather than name, since nothing stops two sibling GameObjects sharing a Name and ImGui's default label-based IDs would otherwise merge their open/selected state. Also gives samples/WindowDemo/scene.json a child GameObject (offset, half-scale, parented under Quad) — the existing scene only had one root, nothing to show a tree with. Verified by screenshot: both quads render at their correct composed WorldMatrix (the child visibly smaller and offset, confirming parent/child composition is still correct through this change), and Hierarchy lists "Quad" as a collapsible node. Full suite still green: 65 tests. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01N1qPfzq8TDCUMFMV3UwV5N
This commit is contained in:
@@ -9,6 +9,19 @@
|
||||
"components": [
|
||||
{ "type": "Engine.Render.Contracts.QuadRenderer, Engine.Render.Contracts", "data": {} }
|
||||
],
|
||||
"children": []
|
||||
"children": [
|
||||
{
|
||||
"name": "ChildQuad",
|
||||
"transform": {
|
||||
"position": [1.5, 0, 0],
|
||||
"rotation": [0, 0, 0, 1],
|
||||
"scale": [0.5, 0.5, 1]
|
||||
},
|
||||
"components": [
|
||||
{ "type": "Engine.Render.Contracts.QuadRenderer, Engine.Render.Contracts", "data": {} }
|
||||
],
|
||||
"children": []
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
|
||||
Reference in New Issue
Block a user