General
3 min read

TourManager Runtime Modes

TourManager (Assets/Plugins/Revoid/GigaSphere/Scripts/Runtime/Managers/TourManager.cs) coordinates either tile-based streaming or scene-based loading depending on the selected runtimeMode.

Tile Streaming Mode

  • When used: Default workflow for high-resolution panoramas hosted in StreamingAssets or a CDN.
  • How it works:
    • runtimeMode remains TileStreaming and TileLoader must be assigned.
    • LoadLocation calls TileLoader.LoadLocation, which streams tiles using the active sphere generator and fades between levels.
    • Camera settings (rotation, FOV, pitch) are applied immediately via ApplyCameraSettings so the viewer does not see the previous orientation while tiles load.
    • Hotspots are instantiated through LoadHotspots, which fetches prefabs from Resources/Runtime/Hotspots/<Type> and scales them against the active sphere radius.
    • TileLoader.OnPanoramaLoadingComplete optionally re-applies camera settings when asynchronous loading finishes.
  • Configure: Assign tourGraph and loader in the inspector. Optionally subscribe to OnHotspotSpawned/OnHotspotDestroyed for runtime UI reactions.

Scene Streaming Mode

  • When used: Each location has a bespoke Unity scene (for bespoke geometry, lighting, or authored hotspots) instead of shared tile streaming.
  • How it works:
    • Set runtimeMode to SceneStreaming and provide a TourSceneManifest via the sceneManifest field; OR, use Tools/GigaSphere/Scenes/From Graph to build everything automatically from existing Tour Graph.
    • LoadLocation starts the coroutine LoadLocationSceneRoutine, which resolves the additive scene path from the manifest and loads it via SceneManager.LoadSceneAsync.
    • When the scene finishes loading, a LocationSceneDescriptor in that scene must call TourManager.OnLocationSceneLoaded. The descriptor supplies the location reference and a SphereSegmentGenerator that becomes the new target for TileLoader.
    • TourManager disables the previous sphere (and the bootstrapper sphere) before binding the new one, updates detail levels, and then triggers tile loading plus hotspot spawning after one frame through DelayedHotspotSpawn.
    • Optional unloading: enable unloadPreviousScene to tear down the prior additive scene before activating the new one.
  • Manifests: Maintain mappings inside TourSceneManifest.SetEntries. The loader prioritizes lookups by LocationInfo.tilesFolder, then falls back to asset keys, instance IDs, and titles. Keep entries synchronized with your tour graph when adding or renaming locations.

Operational Notes

  • Reload reevaluates the start location for both modes. When using scene streaming, ensure the manifest covers every start candidate; missing entries will log errors and abort loading.
  • Scene streaming still relies on TileLoader for panoramic content once the descriptor binds the sphere. Keep the loader active even if the initial bootstrapper sphere is hidden.
  • Hotspot prefabs and data work the same in both modes. In scene streaming you can place additional hotspots directly inside the additive scene and call TourManager.RegisterSceneHotspot from their OnEnable logic if needed.