- A prefab placed in a Unity scene (dragged from the Project pane or double-clicked) is saved as an instance of it, as Unity would: a PrefabInstance with the prefab as its source, its parent in
m_TransformParent, a stripped placeholder for its root Transform in its parent's children (or the PrefabInstance in SceneRoots), and what differs from the prefab (where it stands, its name, any field changed before saving) as overrides. Opened again, it is an instance like the file's others, so later edits are overrides too. - How: placing registers the copy (
{"editor_link_prefab"}: the root's editor id, the prefab's snapshot ids to the copy's), and the prefab export now gives each snapshot id's file IDs in the prefab. Saving a scene with such copies runs in two steps: the scene without them, plus a PrefabInstance and placeholder for each; then, the file holding real instances, the copies against their prefabs (keysinstance ^ source, as the import flattens them) through the writer's override path, with the lists that hold them rewritten. Copies inside an instance or another placed copy stay plain objects. - Checked in Unity: Unity 6000.2 opened the saved Coin Dash level with no warnings and reports both placed coins (one renamed and moved, one under Ground) as instances of Coin.prefab. Tests: the saved file has two new instances with the rename and position as overrides and no plain copy; opened again they are there; saving again changes nothing. MCP's e2e tests (which save Unity scenes) pass.
- Not yet: placed copies inside an instance (Unity's added objects on the outer instance); handles and grid drawn over objects; box selection in the Scene view.
Phase 4 · Slice 20 ·