Add and remove runtime cells
What this teaches
This scene distinguishes the authored board from its live cells. Built-in actions mutate the GridBoardState in Play Mode without rewriting the 3 × 3 source asset.
Open and run
Menu path: Tools > Lost Lily > Grid Toolkit > Samples > Open > Tutorials > Add and Remove Cells.
Enter Play Mode. Hover a live cell or a plus slot around the board, click to toggle that coordinate, and use Reset to rebuild the authored nine cells.
Try it
- Click an empty plus slot on the left, right, top, and bottom expansion ring.
- Click one newly added cell to remove it.
- Try to remove the occupied center cell and read the rejection.
- Add another edge cell, then press Reset.
Checkpoint
Successful clicks commit one cell change and the retained renderer updates immediately. The occupied center is rejected without mutation. Reset restores exactly the original nine authored cells.
How it works
| Scene part | Public system | Responsibility |
|---|---|---|
| Authored 3 × 3 setup | Board definition | Remains the reset source. |
| Live cell toggle | GridActions | Creates add or remove cell actions. |
| Transaction runner | GridActionRunner | Applies occupancy policy atomically. |
| Retained view | GridBoardView | Adds or removes visible nodes after commit. |
Try another variation
Change the authored rectangle or place structures on other cells, then test removal in a duplicated scene.
Troubleshooting
| Symptom | Fix |
|---|---|
| A cell cannot be removed. | Check the HUD for occupancy or policy diagnostics. |
| A plus slot is not clickable. | Move the pointer to a highlighted expansion slot while in Play Mode. |
Related
- Definitions and state
- Add and remove runtime cells
- GridBoardState
- GridActions
- GridActionRunner
- GridBoardView
Next sample
Continue with Save and restore a basic board.