Skip to main content
File: Packages/com.molca.core/Runtime/Modals/ModalManager.cs
Type: RuntimeSubsystem (child of RuntimeManager prefab)

When to use

Use ModalManager for built-in modal types (message toasts, confirmation dialogs, loading overlays). For product-specific or complex modals (text input, selection, progress with custom UI), see Shared modals.

Role

Shows informational messages, confirmations, loading overlays, and typed modals by key. Prefabs and canvas wiring are assigned on the subsystem component in the Inspector via ModalEntry[] keyed entries.

Code

Use ModalManager.Instance only after RuntimeManager has created the subsystem (e.g. after await RuntimeManager.WaitForInitialization()).

API Reference

Messages

Loading overlays

Modals

Confirmations

Troubleshooting

  • Modal does not appear: confirm ModalManager.Instance is not null — the subsystem must exist on the RuntimeManager prefab and runtime must be initialized.
  • Modal appears behind other UI: check canvas sort order; ModalManager typically uses a high-priority canvas.
  • ShowModal(string modalKey) returns null: ensure a ModalEntry with the matching key exists in the ModalManager component’s modalPrefabs list in the Inspector.
  • Loading overlay persists: call RemoveLoading(title) or HideFullScreenLoading() explicitly — overlays are not auto-removed.

Unity Editor

Modal Manager Inspector

ModalManager — modal prefabs and settings