Registrations and build checks
A reflect, the step that writes your staged edits to the source, can register assets with Addressables as it writes the sheet. Before every build, a hook checks that the baked data is fresh.
Registrations made by a reflect
In the Data Studio, you can drop an asset onto an AssetRef@Group cell, or pick one from the project. Either action may stage a change to the project as well as to the sheet:
- Adding the asset to the group.
- Moving the asset from another group.
- Creating the group.
Those registrations are part of the reflect. They run in a fixed place in the chain. The place is the same for a local folder, a Google sheet and a custom source provider.
The reflect chain
The chain runs four stages in order: pre-flight, the sheet write, the registrations and the cleanup. Two sections below cover the registrations stage: one for the items that run and one for the items the stage skips.
Pre-flight
Pre-flight validates the whole projected state, which is the baseline with your staged edits applied. It counts the staged registrations as present, so a cell that points at an asset that is not registered yet is not an error.
Sheet write
The sheet is written. Whether the registrations run next depends on how the write went.
| Reflect | Registrations |
|---|---|
| The write is cancelled or fails | Do not run. They stay staged for the next attempt |
| No tab could be written, because every touched tab was skipped | Do not run |
| Nothing to write to the sheet at all | Run, and the re-import follows |
When the write is cancelled or fails, nothing below runs. The Addressables settings are untouched.
Every touched tab is skipped when, for example, only xlsx-backed tabs were touched.
A reflect has nothing to write to the sheet when the only staged change is a registration. That pass commits no other staged edit, so any other staged edit stays undoable.
Registrations run
The registrations run in this order:
- Groups are created.
- Entries are added or moved, and given their address.
- The settings are saved once.
A new group gets the same schema types as the project's default group. A project that delivers through content directories therefore gets a content-directory group.
If the project has no Addressables settings asset yet, one is created for the purpose.
Skipped registrations
Each item is checked again immediately before it runs. It is skipped rather than forced in four cases:
- The asset has since been deleted.
- The address is now taken by a different asset in that group.
- The group could not be created or found.
- No cell references the address any more.
A registration never creates an entry that nothing points at. A group whose every entry was skipped is not created either.
Cleanup and re-import
The staged list is cleared, applied and skipped items alike. The automatic re-import follows, so the bake sees the new entries.
A skipped registration is therefore reported at that re-import, as UnknownAssetKey on the cell that needed it.
Console output
The Console carries one line per outcome, then a summary line.
| Outcome | Console line |
|---|---|
| Applied item | Addressables: 'address' → group 'Group' |
| Skipped item, as a warning | Addressables: skipped 'address' (reason) |
| Summary | Addressables: N registered, M skipped |
For a local folder source, the reflect's completion dialog ends with that same summary line.
Build freshness hook
A stale bake fails the build. Before every build, a pre-build hook checks each committed generated Database type. It judges each workbook on its own.
First, the hook looks for a mark on the workbook. Either of these stops the build at once, before any other check:
- A quarantine mark, left when the workbook's last import failed validation.
- A block, set while the workbook's references into another workbook are broken. The message names the workbook whose import broke them.
Then three conditions must hold:
- The baked ScriptableObject (SO) exists.
- Its schema fingerprint matches the baseline. This is compared only when a baseline exists.
- The workbook's delivery mode can deliver the database.
| Mode | What the third condition looks for |
|---|---|
| Addressables | An Addressables registration |
| Resources folder | A database file under the Resources folder |
| Scene catalogue | A catalogue entry |
The scene catalogue mode also refuses a build whose catalogue is missing.
A project that mixes modes passes when every workbook can deliver its tabs.
Any failure aborts the build with an actionable sentence. For a stale bake, the sentence tells you to open Tools ▸ SheetForge ▸ Data Studio, press ↓ Import, then build again.
This is what makes it safe to gitignore the baked SOs. A clone or a CI machine cannot ship an empty cache.
Next steps
- Asset and visual cells
Pick or drop an asset into a cell in the Data Studio.
- Undo and staged edits
How staged edits wait for the reflect.
- Several workbooks
Reflect slices per workbook, and references across workbooks.
- Export
Write baked values back into sheet files.