> ## Documentation Index
> Fetch the complete documentation index at: https://docs-unity.molca.id/llms.txt
> Use this file to discover all available pages before exploring further.

# Home UI

> HomeUIManager, scenario cards, modules, and leaderboard presentation.

**Folder:** `Assets/_MolcaSDK/_VR/Scripts/Scenario/Home/`\
**Namespace:** `MolcaSDK.VR.Scenario.Home`\
**Primary type:** **`HomeUIManager`**

Runs on the **home / simulation selection** screen: toggles **by module** vs **by scenario**, builds cards from [Scenario Data Config](/setup/scenario-data-config), and respects **fetched** scenario IDs when the session has loaded server content (see [Session loading & events](/vr/session-loading-and-events)).

## When to use

Use **`HomeUIManager`** when you need a **data-driven lobby** that lists org scenarios/collections after authentication, supports **filtering** (`FilterPanelUI`), and drills into **module** or **scenario** detail panels before launching training.

## Inspector setup (`HomeUIManager`)

| Section        | Fields                                                                                                              |
| -------------- | ------------------------------------------------------------------------------------------------------------------- |
| **View mode**  | **By module** / **By scenario** / **Filter** buttons; **default view mode** enum.                                   |
| **Main panel** | Root object for the home UI.                                                                                        |
| **Content**    | **Scenario list container**, **module grid container**, **scenario list panel**, **module grid panel**.             |
| **Prefabs**    | **Scenario card**, **module card**.                                                                                 |
| **UI**         | **Filter panel** (`FilterPanelUI`), **module detail** (`ModuleDetailUI`), **scenario detail** (`ScenarioDetailUI`). |
| **Audio**      | Optional **`AudioReference`** for lobby BGM (plays in `Start` if assigned).                                         |

**`Start`** awaits **`RuntimeManager.WaitForInitialization()`**, then **`LoadScenarioData()`** reads **`ScenarioDataConfig.GetInstance()`**. If **`FetchedScenarios`** is non-empty, only scenarios whose **`ScenarioId`** appears in fetched rows remain visible.

## Code

**Force a view mode from another UI controller:**

```csharp theme={null}
using MolcaSDK.VR.Scenario.Home;
using UnityEngine;

public class HomeShortcuts : MonoBehaviour
{
    [SerializeField] private HomeUIManager home;

    public void ShowModules() => home.SetViewMode(HomeViewMode.ByModule);
    public void ShowScenarios() => home.SetViewMode(HomeViewMode.ByScenario);
}
```

Ensure **`ScenarioDataConfig`** asset exists and session has populated **`FetchedScenarios`** before showing the home scene, or the list may be empty after filtering.

## Troubleshooting

* **`[HomeUIManager] ScenarioDataConfig not found!`** — Create/configure the config asset and ensure **`GetInstance()`** resolves in this scene ([Scenario Data Config](/setup/scenario-data-config)).
* **Empty list after login** — **`FetchedScenarios`** may filter out everything; verify API IDs match **`BaseScenarioData.ScenarioId`** in the config.
* **Buttons do nothing** — Assign **by module / by scenario / filter** references; **`SetViewMode`** only toggles panels when references are non-null.
* **No BGM** — **`bgmReference`** optional; check [audio](/shared/media-system) setup if assigned but silent.

## Related

* [Scenario Data Config](/setup/scenario-data-config) — collections, scenarios, fetched list
* [Session loading & events](/vr/session-loading-and-events) — content timing
* [Scenario session manager](/vr/session-authentication) — auth before home
* [Modal manager](/core/modal-manager) — shared modal patterns used in SDK flows

## Unity Editor

<Frame hint="Home VR scene — canvas / HomeUIManager in Inspector." caption="Home VR scene and HomeUIManager">
  <img src="https://mintlify.s3.us-west-1.amazonaws.com/ptmolcateknologinusantara/images/features/vr/home-vr-ui.png" alt="Home VR Unity scene or HomeUIManager Inspector" />
</Frame>
