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.

File: Assets/_MolcaSDK/_VR/Scripts/Scenario/Tour/TourSubsystem.cs
Namespace: MolcaSDK.VR.Scenario.Tour
Type: RuntimeSubsystem on RuntimeManager

Role

  • Loads / unloads tour areas (often additive scenes)
  • Teleports between spots
  • SharedString home scene for returning to lobby
  • Optional keep-loaded radius when leaving an area (reduces reload churn)
Works with Tour area and spots and the Tour scenario mode driver.

Runtime flow (simplified)

Code

Resolve from anywhere after init:
using Molca;
using MolcaSDK.VR.Scenario.Tour;

public static class TourApi
{
    public static TourSubsystem Subsystem => RuntimeManager.GetSubsystem<TourSubsystem>();

    public static async Awaitable<bool> GoToArea(TourScenarioData data) =>
        await Subsystem.TransitionToAreaAsync(data);

    public static void Jump(TourSpotController spot) => Subsystem.TeleportToSpot(spot);

    public static async Awaitable<bool> ExitToLobby() => await Subsystem.EndTourAndGoHomeAsync();
}
homeScene (SharedString) names the scene EndTourAndGoHomeAsync loads. maxDistanceToKeepAreaLoaded keeps an unloaded area’s additive scene in memory if the player remains within range of that area’s spots. TeleportToSpot, SetInitialArea, LoadAreaSceneAdditivelyAsync, UnloadDistantInactiveAreaScenesAsync cover advanced flow; OnAreaChanged, OnSpotTeleported, OnError are UnityEvent hooks.

Troubleshooting

  • Transition failsTourScenarioData null or Addressables / scene name mismatch; check OnError and console for [TourSubsystem] messages.
  • Teleport does nothingTourSpotController needs TeleportationAnchor; ensure XRI teleport provider is active.
  • Home scene wrong — Set SharedString on the subsystem so value matches a Build Settings scene name (or your loader contract).
  • Memory / load churn — Tune maxDistanceToKeepAreaLoaded or call UnloadDistantInactiveAreaScenesAsync after teleports if you manage areas manually.

Unity Editor

RuntimeManager prefab → TourSubsystem with home SharedString and distance fields.

TourSubsystem in Unity Inspector