Prerequisites
- Scenario scene is in File → Build Settings (and/or Addressables, if you load by reference).
- RuntimeManager prefab variant matches your needs (offline vs session, tour if applicable).
- Scenario Data Config exists on Global Settings.
1. Create simulation scenario data
- Project window → Create → MolcaSDK → Scenario → Simulation Scenario Data (or equivalent menu for
SimulationScenarioData). - Name the asset (e.g.
Scenario_MyTraining). - In the Inspector, set:
- Ref Id — stable id (auto-generated if empty).
- Scenario name / description / tags / image — Home UI and metadata (
DynamicLocalizationentries are initialized fromRefIdinBaseScenarioData.Initialize()). - Time limit —
Time Limit Seconds;0= no limit.
- Scenario Activities — add
ScenarioActivityDataentries (each has Ref Id, titles, Activity Id / slug fields as defined on the type). These are the authoring records the runtime ScenarioActivity will match. - Scene loading — configure how this scenario loads:
Scene ReferenceonBaseScenarioData(Addressable) when used, or- On
SimulationScenarioData:sceneName(SharedString),singlePlayerSceneName/singlePlayerSceneReference, and optionallyroleSceneMappingsfor multiplayer splits.
2. Create and lay out the scenario scene
- Create or open the Unity scene referenced by the scenario asset.
- Add the
[VR Scenario]prefab (typical path:Assets/_MolcaSDK/_VR/Prefabs/Base/) — includes XR rig, scenario UI shell, and related objects (your project layout may vary). - Select
ScenarioManageron the prefab (or your scene root).
ScenarioManager (in scene)
| Field | Action |
|---|---|
| Scenario Data | Assign your SimulationScenarioData asset. |
| Auto Start | Enable for immediate start on load; disable if you start from script. |
| Activities | Assign in step 3 (ordered list of ScenarioActivity components). |
| Start All Activities Simultaneously | Parallel vs first-only sequential behavior. |
| Is Direct Complete When All Activity Complete | Auto-finish scenario when every activity completes. |
| Use Session Manager | Enable for connected session flows. |
| Pause Modal / Pause Input | Wire pause UX. |
3. Create activities in the scene
For eachScenarioActivityData on the asset:
- Create a GameObject (e.g. under an
Activitiesparent). - Add
ScenarioActivity— Unity addsSequenceControllerautomatically ([RequireComponent]). - Set
Activity IdonScenarioActivityto the same string as that row’sScenarioActivityData.RefId. At runtime, the component resolvesActivityDatawithFirstOrDefault(a => a.RefId == activityId); a mismatch logs a warning and breaks Home/session metadata binding. - Configure
autoAdvanceToNextif you want automatic progression to the next activity when the sequence completes. - Drag each activity GameObject into
ScenarioManager.Activitiesin the intended order (unless you rely entirely on simultaneous start — then order still matters for UI/progression).
4. Add steps under each activity
- Under each activity object, add child GameObjects and attach Step components (Grab, Valve, etc.).
SequenceControllerdiscovers Step children and runs them in hierarchy order; use ParallelStep or bridges when you need non-linear flow.- Wire SceneObjectReference / interactables: put ReferenceableComponent on targets and point steps at those Ref Ids.
- Optional: Auxiliaries on each step (scoring, haptics, controller hints — VR step auxiliaries).
5. Scoring (optional)
ScenarioScoringon theScenarioManagerobject (or as your prefab dictates).ActivityScoringperScenarioActivity.StepScoringAuxiliaryon steps that contribute points.
6. Register in ScenarioDataConfig
- Open the
ScenarioDataConfigSettingModule. - Under Scenario Collections, add or extend a collection.
- Add your
SimulationScenarioDataasset to the list so Home UI can list it (and so org/content flows can resolve it when connected).
7. Test
| Goal | Suggestion |
|---|---|
| Fast iteration | Disable Use Session Manager on ScenarioManager, enter Play Mode from the scenario scene with Auto Start on. |
| Full flow | Run Preload → Auth → Home, pick the scenario, and confirm session loading + scene name / Addressables match. |
Tour variant (short path)
- Create
TourScenarioData(Create → MolcaSDK → Scenario → Tour Scenario Data). - Fill metadata, spots, materials, and scene reference like the simulation asset.
- Open the tour scene; use
[VR Tour]fromAssets/_MolcaSDK/_VR/Prefabs/Tour/or[VR Scenario]withTourScenarioDataassigned — mode driver selects tour behavior. - Place
TourAreaManager,TourSpotController, etc., per your content (Tour area and spots). - Runtime prefab must include
TourSubsystemwhen using tour + session flows. - Register the asset in ScenarioDataConfig as above.
Unity Editor
Split: SimulationScenarioData Inspector + Hierarchy with ScenarioManager and Activities + one Step expanded.
