Lost Lily/Grid ToolkitDocs 1.0
Table of Contents

Connect a board view to state

When to use

Connect a GridBoardView when a renderer must refresh retained presentation after board commits. The view observes state; it does not create, own, mutate, or dispose the board.

Before you start

Start with a ready board owner and one configured renderer stack. Prefer an IGridBoardStateSource when authored state can be rebuilt or replaced. Use direct state binding only when the state lifetime is fixed and owned elsewhere.

Binding Use it when State ownership
State source The owner may rebuild or replace the board. The source keeps ownership; the view follows replacements.
Fixed state The same state remains valid for the whole binding. Project code keeps ownership and disposes the state.

Procedure

1. Connect the state

Select the GameObject containing GridBoardView, then choose one binding:

  • Assign the neighboring state-source component or call SetStateSource(source) when the view should follow replacements.
  • Call Bind(state) for a fixed state and keep disposal in the component that owns that state.

2. Assign the renderer

Assign exactly one renderer through the Inspector or SetBoardRendererComponent. Confirm that it has a compatible layout and the node builders needed for the content you want to display.

3. Check readiness

In the GridBoardView Inspector, confirm that Status is Ready. If it is not, read the reported diagnostic before enabling input or publishing visual feedback.

Result

The view refreshes after committed event batches and after visual-state changes. Rebuilding an authored owner replaces the observed state without transferring ownership to the view.

Troubleshooting

Symptom Check
The view is unbound The state source has not built a state or the fixed state was never assigned.
The view keeps an old state Use state-source binding when the owner can rebuild or replace its state.
Status reports a missing renderer or layout Assign one renderer and a compatible layout provider.
Cells appear but structures do not Add a structure node builder and its required library or visual source.