Scene loading
Keep the UI running across scene loads and update screens from scene scripts.
LoomUI persists across scene loads. The UI stays loaded while the game
changes scenes.
Startup scene
Add LoomUI to a startup scene:
Tools > Loom > Setup UI in Current Scene
Start the game through this scene so Loom is initialized before other scenes try to use the bridge.
Per-scene drivers
A script in the loaded scene can update bridge state in Start():
public sealed class CombatUiDriver : MonoBehaviour
{
private void Start()
{
UIBridge.Instance.CurrentScreen = GameScreen.Hud;
}
}
Returning to menus
When loading a menu scene, set screen state the same way:
UIBridge.Instance.CurrentScreen = GameScreen.MainMenu;
Avoid destroying the Loom UI object just to change UI screens. Use bridge state and Solid rendering instead.
Loading progress
For loading screens, expose progress as bridge state:
public float LoadingProgress { get; set; }
public GameScreen CurrentScreen { get; set; } = GameScreen.Loading;
Assign LoadingProgress as the scene loads. The Solid loading screen can
read that property to update its progress bar.