Scene loading
The LoomUI component creates a persistent UI overlay. It is meant to survive
scene loads so the UI does not flicker, reload, or reconnect every time the game
changes scenes.
Startup scene
Add LoomUI to a startup scene:
Loom -> Setup UI in Current Scene When Play starts, Loom creates its view and marks the Loom UI object persistent. Keep this startup path stable so every game flow initializes the UI once.
Per-scene drivers
Scene-specific GameObjects can drive bridge state when their scene loads:
public sealed class CombatUiDriver : MonoBehaviour
{
private void Start()
{
UIBridge.Instance.CurrentScreen = GameScreen.Hud;
}
} This keeps UI ownership clear:
- Loom owns the persistent overlay.
- Scenes own their gameplay objects.
- Per-scene drivers update bridge state for that scene.
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; Update it while your scene load runs. The UI can render progress immediately without needing a separate Unity UI loading layer.