Switch between independent environments¶
Use a switcher when the player should select an environment with its own clock and profiles while other simulations remain enabled.
- Create two ordinary context instances; do not use the singleton foundation for both.
- Configure each with valid profiles and different simulated times.
- Put each visual rig in a separate
TunalPresentationGrouproot, outside both simulation roots. - Add
TunalContextSwitcheron an always-active GameObject. Add entries assigning Context, Presentation, and a clear Display Name. - Add optional Scene Roots for each environment's props, keeping them separate from simulation and presentation roots.
- Enter Play Mode and use the Inspector's selection controls. Bind a Button to
NextContextorPreviousContextfor a simple runtime selector.
Expected result: only the selected presentation/content is active. Enabled simulations continue according to their own clock settings. Switching does not transfer ownership of arbitrary objects or pause the other clock.
If validation fails, check for nested/overlapping roots, a context inside a managed root, a disabled presentation-group component, or the switcher inside a root it manages. For API selection, check SwitchToContext(index)'s boolean result; indices are zero-based.
Continue with context-aware UI and the full ownership and switching guide.