Called once, after the state's built-in UI is fully constructed and before its VisualElement is attached to the state machine view.
This is the recommended entry point for allocating custom UI and adding it to
IStateView.Root. It fires exactly once per view instance, so any element allocated
here can be safely cached in a field.
If the state is culled and later revealed, the contents of IStateView.Root are
cleared; re-add your cached elements from StateView<T0>.OnCullingChanged (when
cullingEnabled is false). Prefer this pattern over allocating a fresh element each
time.
Label m_Label;
public override void OnViewBuilt() { m_Label = new Label($"State: {State.Title}"); View.Root.Add(m_Label); }