Skip to main content
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, and respects fetched scenario IDs when the session has loaded server content (see Session loading & 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)

SectionFields
View modeBy module / By scenario / Filter buttons; default view mode enum.
Main panelRoot object for the home UI.
ContentScenario list container, module grid container, scenario list panel, module grid panel.
PrefabsScenario card, module card.
UIFilter panel (FilterPanelUI), module detail (ModuleDetailUI), scenario detail (ScenarioDetailUI).
AudioOptional 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:
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).
  • Empty list after loginFetchedScenarios 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 BGMbgmReference optional; check audio setup if assigned but silent.

Unity Editor

Home VR scene — canvas / HomeUIManager in Inspector.

Home VR Unity scene or HomeUIManager Inspector