Skip to content

Keep UI connected to the selected context

Use one Canvas to control the active environment without disabling it when presentations switch.

  1. Configure a valid context switcher with detached presentation roots.
  2. Place the Canvas, TunalUIRuntimeController, TunalUguiContext, and binding script outside all managed roots.
  3. Use the complete SwitcherUiBinding.cs example in UI context switching; assign switcher, command controller, and view context.
  4. Bind the context-list view with TunalUguiContextSwitcher.SetSwitcher where needed.
  5. Enter Play Mode, change selection, then verify both time controls and cloud/presentation controls target the newly selected entry.

The binder sets both the command context and the active presentation group. Searching only inside the context cannot find an unrelated detached presentation rig. Do not also wire a competing binder through persistent UnityEvents.

Test enabling the UI after the switcher's startup: the example reads current selection in addition to subscribing. Saving in Whole World mode still targets world registration, not just the currently visible context.

Related: runtime UI component roles, switch contexts.