UI Bindings and Hosts
This page explains how PlayMaker maps data fields to UI targets.
The binding system is intentionally host-agnostic. UI bindings do not know where data comes from. Host components provide the schema and values, and bindings describe how fields map to UI targets.
Binding Model
Hosts supply:
- The schema as a
DataDefinition - The value source as cells
Bindings supply:
- The mapping from fields to UI targets
DataUIBindings
DataUIBindings is the serialized container for UI binding configuration.
It contains:
AutoBindfor editor-time auto bindingList<DataFieldBinding>
It does not contain a DataDefinition. The schema is always provided by the host component.
DataFieldBinding
DataFieldBinding maps one schema field to one UI target.
IDataFieldTarget
UI targets implement IDataFieldTarget to receive values from the binding system.
Built-in examples include:
TextTargetToggleTargetSliderTargetImageSpriteTarget
You can implement custom targets to support additional UI components.
DataItemUI
DataItemUI is a MonoBehaviour used by collection widgets such as tables and grids.
It owns:
DataDefinitionfor the item prefab schemaDataUIBindingsfor UI mapping
It also provides runtime context for UI actions:
ItemIdItemKeyIDataUIActionHost
It is used by:
DataTableWidgetDataGridWidget(planned)
DataComponentUI
DataComponentUI is a MonoBehaviour used by single-record UI, such as HUD panels and inspect panels.
It owns:
DataUIBindings
It gets its schema and values from the attached DataRecordComponent.
It automatically refreshes when DataRecordComponent.Changed fires.
DataComponentUI does not currently process actions.