Skip to main content

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.

Folder: Assets/_MolcaSDK/_VR/Scripts/Scenario/UI/
Namespace: MolcaSDK.VR.Scenario.UI
Primary documented completion surface: ScenarioCompletionUI — listens to ScenarioManager completion / timeout / fail events, shows header + mascot, local player stats, and fetches leaderboard rows via ScenarioSessionManager. Other HUD or modal helpers may live in the same folder or under Modals; search Scenario/UI in the SDK.

Step task list (titles from StepInfo)

The in-scenario task or checklist UI (names vary by prefab) lists training steps for the current activity. Each row’s title (and sometimes description) usually comes from the StepInfo StepAuxiliary on that step:
  • Active / completed styling is driven by Step status from the SequenceController.
  • Copy is driven by StepInfo on each step — use localization on the same fields modals use so the list matches Popup step and other UIs.
  • Subclasses of StepInfo can add fields for custom HUD or CSV-imported data (CSV Step Importer); the standard list typically displays the base title from the auxiliary.
See VR step auxiliaries for adding StepInfo and derived types.

When to use

Use ScenarioCompletionUI when a scenario scene needs an end screen: success vs timeout vs failure copy, score and duration from ScenarioManager, and a leaderboard for the current org scenario.

Inspector setup (ScenarioCompletionUI)

SectionFields
ReferencesScenarioManager — must be set or OnEnable subscriptions never fire.
PanelsCompletion panel, header TMP / Image, mascot image.
Completion indicatorSuccess / failed colors; success/fail sprites.
Player statsName, score %, duration, change scenario / play again buttons.
LeaderboardContainer transform, entry prefab, row colors, rank 1–3 icons.
EventsonChangeScenario, onPlayAgain — wire to session navigation or reload.
On Awake, completion panel starts inactive. OnEnable registers OnScenarioComplete, OnScenarioTimeout, OnScenarioFail on ScenarioManager.

Code

Dispatch UnityEvents from the Inspector — no code required for basic flow. To trigger navigation in script, listen on your bootstrap:
using MolcaSDK.VR.Scenario.UI;
using UnityEngine;

public class CompletionFlow : MonoBehaviour
{
    [SerializeField] private ScenarioCompletionUI ui;

    private void OnEnable()
    {
        ui.onChangeScenario.AddListener(GoHome);
        ui.onPlayAgain.AddListener(ReloadScenario);
    }

    private void OnDisable()
    {
        ui.onChangeScenario.RemoveListener(GoHome);
        ui.onPlayAgain.RemoveListener(ReloadScenario);
    }

    private void GoHome() { /* load home / request session */ }
    private void ReloadScenario() { /* reload current scenario scene */ }
}
Show resolves ScenarioSessionManager via RuntimeManager.GetSubsystem for leaderboard API calls.

Troubleshooting

  • Nothing appears on completionscenarioManager reference is null (error logged) or ScenarioManager never raises completion events.
  • Leaderboard empty / warning — Session not ready, missing bearer context, or scenarioData.OrgScenarioId invalid; check network logs and Scenario network config.
  • Wrong player name — Pulled from SessionInfo.user.name; verify session payload after login.
  • Double subscriptions — Avoid enabling/disabling the component repeatedly without matching OnDisable; use a single active instance.

Unity Editor

Scenario completion canvas in Scene view or ScenarioCompletionUI Inspector.

Scenario completion UI in Unity