PanoShard
360 Gigapixel Panorama Framework
Loading...
Searching...
No Matches
Reshardic.PanoShard.Managers.Panoshard Class Reference

Static entry point and controller for the PanoShard Unity asset. Provides centralized access to core functionalities like loading locations, setting URLs, and managing segments. Automatically finds and caches the main TileLoader and SphereSegmentGenerator instances from the scene when first needed. More...

Static Public Member Functions

static bool Initialize (bool force=false)
 Explicitly initializes the Panoshard system by finding components in the scene. Call this during scene initialization if you want to control when initialization occurs.
 
static void RegisterComponents (TileLoader tileLoader, SphereSegmentGenerator sphereGenerator=null, Controls.TourManager tourManager=null)
 Manually registers component references instead of relying on automatic scene discovery. Use this for explicit control over which components the Panoshard facade uses.
 
static void Reset ()
 Clears all cached component references and resets initialization state. Useful when transitioning between scenes or when components are destroyed.
 
static void SetCdnUrl (string url)
 Sets the base CDN URL for tile loading.
 
static void LoadLocation (Graph.LocationInfo location)
 Loads a specific location with optional delay.
 
static void CancelLoading ()
 Cancels any ongoing loading operations.
 
static void ClearTileCache ()
 Clears the tile cache, freeing up memory.
 
static void SetMaxLevel (int level)
 Sets the maximum zoom level for tiles.
 
static void SetMinLevel (int level)
 Sets the minimum zoom level for tiles.
 
static void SetQualityPreset (PanoShardQualityPreset preset)
 Sets the quality preset for rendering.
 
static void SetCachingEnabled (bool enable)
 Enables or disables caching.
 
static void SetMaxCacheSize (float sizeMB)
 Sets the maximum cache size in MB.
 
static void UpdateSphereMaxSegments (int newMaxDetailLevel)
 Updates the sphere's maximum detail level.
 
static Graph.LocationInfo GetCurrentLocation ()
 Gets the location that is currently loaded (fully streamed/shown). When TourManager is present this reflects the confirmed-loaded location; otherwise it falls back to the TileLoader's last completed location.
 
static int GetCurrentZoomLevel ()
 Gets the current zoom level.
 
static Vector3 GetHotspotPosition (Vector3 position)
 Converts a hotspot position from UV to world coordinates.
 
static TileLoader GetTileLoader ()
 Gets the main TileLoader instance.
 
static SphereSegmentGenerator GetSegmentGenerator ()
 Gets the main SphereSegmentGenerator instance.
 
static Controls.TourManager GetTourManager ()
 Gets the main TourManager instance.
 
static void SetHotspotsVisible (bool visible)
 Sets the visibility of all hotspots in the scene.
 
static bool AreHotspotsVisible ()
 Gets whether hotspots are currently visible.
 
static bool ToggleHotspotVisibility ()
 Toggles the visibility of all hotspots.
 
static void UpdateActiveSphereGenerator (SphereSegmentGenerator sphereGenerator)
 Updates the active SphereSegmentGenerator reference. Use this when switching spheres in scene streaming scenarios.
 

Properties

static bool IsInitialized [get]
 Gets whether the Panoshard system has been successfully initialized with all required components.
 

Detailed Description

Static entry point and controller for the PanoShard Unity asset. Provides centralized access to core functionalities like loading locations, setting URLs, and managing segments. Automatically finds and caches the main TileLoader and SphereSegmentGenerator instances from the scene when first needed.

This facade provides a simplified API for common PanoShard operations. Components are lazily initialized on first use. For multi-scene scenarios or manual control, use Initialize or RegisterComponents to explicitly set component references.

Member Function Documentation

◆ AreHotspotsVisible()

static bool Reshardic.PanoShard.Managers.Panoshard.AreHotspotsVisible ( )
inlinestatic

Gets whether hotspots are currently visible.

Returns
True if hotspots are visible, false otherwise or if TourManager is not available.

◆ CancelLoading()

static void Reshardic.PanoShard.Managers.Panoshard.CancelLoading ( )
inlinestatic

Cancels any ongoing loading operations.

◆ ClearTileCache()

static void Reshardic.PanoShard.Managers.Panoshard.ClearTileCache ( )
inlinestatic

Clears the tile cache, freeing up memory.

◆ GetCurrentLocation()

static Graph.LocationInfo Reshardic.PanoShard.Managers.Panoshard.GetCurrentLocation ( )
inlinestatic

Gets the location that is currently loaded (fully streamed/shown). When TourManager is present this reflects the confirmed-loaded location; otherwise it falls back to the TileLoader's last completed location.

Returns
The current Graph.LocationInfo, or null if no location has loaded yet.

◆ GetCurrentZoomLevel()

static int Reshardic.PanoShard.Managers.Panoshard.GetCurrentZoomLevel ( )
inlinestatic

Gets the current zoom level.

Returns
The current zoom level, or 0 if TileLoader is not available.

◆ GetHotspotPosition()

static Vector3 Reshardic.PanoShard.Managers.Panoshard.GetHotspotPosition ( Vector3 position)
inlinestatic

Converts a hotspot position from UV to world coordinates.

Parameters
positionThe UV position.
Returns
The world position, or Vector3.zero if TileLoader is not available.

◆ GetSegmentGenerator()

static SphereSegmentGenerator Reshardic.PanoShard.Managers.Panoshard.GetSegmentGenerator ( )
inlinestatic

Gets the main SphereSegmentGenerator instance.

Returns
The main SphereSegmentGenerator instance, or null if not found.

◆ GetTileLoader()

static TileLoader Reshardic.PanoShard.Managers.Panoshard.GetTileLoader ( )
inlinestatic

Gets the main TileLoader instance.

Returns
The main TileLoader instance, or null if not found.

◆ GetTourManager()

static Controls.TourManager Reshardic.PanoShard.Managers.Panoshard.GetTourManager ( )
inlinestatic

Gets the main TourManager instance.

Returns
The main TourManager instance, or null if not found.

◆ Initialize()

static bool Reshardic.PanoShard.Managers.Panoshard.Initialize ( bool force = false)
inlinestatic

Explicitly initializes the Panoshard system by finding components in the scene. Call this during scene initialization if you want to control when initialization occurs.

Parameters
forceIf true, forces re-initialization even if already initialized.
Returns
True if initialization was successful and all required components were found.

◆ LoadLocation()

static void Reshardic.PanoShard.Managers.Panoshard.LoadLocation ( Graph.LocationInfo location)
inlinestatic

Loads a specific location with optional delay.

Parameters
locationThe location info to load.
delayDelay in seconds before loading (must be non-negative).
Exceptions
ArgumentNullExceptionThrown if location is null.
ArgumentOutOfRangeExceptionThrown if delay is negative.
InvalidOperationExceptionThrown in development builds if TileLoader is not available.

◆ RegisterComponents()

static void Reshardic.PanoShard.Managers.Panoshard.RegisterComponents ( TileLoader tileLoader,
SphereSegmentGenerator sphereGenerator = null,
Controls.TourManager tourManager = null )
inlinestatic

Manually registers component references instead of relying on automatic scene discovery. Use this for explicit control over which components the Panoshard facade uses.

Parameters
tileLoaderThe TileLoader instance to use (required).
sphereGeneratorThe SphereSegmentGenerator instance to use (optional).
tourManagerThe TourManager instance to use (optional).

◆ Reset()

static void Reshardic.PanoShard.Managers.Panoshard.Reset ( )
inlinestatic

Clears all cached component references and resets initialization state. Useful when transitioning between scenes or when components are destroyed.

◆ SetCachingEnabled()

static void Reshardic.PanoShard.Managers.Panoshard.SetCachingEnabled ( bool enable)
inlinestatic

Enables or disables caching.

Parameters
enableTrue to enable caching.

◆ SetCdnUrl()

static void Reshardic.PanoShard.Managers.Panoshard.SetCdnUrl ( string url)
inlinestatic

Sets the base CDN URL for tile loading.

Parameters
urlThe CDN URL string. Pass null or empty to clear external URL and use StreamingAssets.
Exceptions
InvalidOperationExceptionThrown in development builds if TileLoader is not available.

◆ SetHotspotsVisible()

static void Reshardic.PanoShard.Managers.Panoshard.SetHotspotsVisible ( bool visible)
inlinestatic

Sets the visibility of all hotspots in the scene.

Parameters
visibleTrue to show hotspots, false to hide them.

◆ SetMaxCacheSize()

static void Reshardic.PanoShard.Managers.Panoshard.SetMaxCacheSize ( float sizeMB)
inlinestatic

Sets the maximum cache size in MB.

Parameters
sizeMBCache size in MB (must be positive).
Exceptions
ArgumentOutOfRangeExceptionThrown if sizeMB is not positive.

◆ SetMaxLevel()

static void Reshardic.PanoShard.Managers.Panoshard.SetMaxLevel ( int level)
inlinestatic

Sets the maximum zoom level for tiles.

Parameters
levelThe max level (typically 0-6).
Exceptions
ArgumentOutOfRangeExceptionThrown if level is negative.

◆ SetMinLevel()

static void Reshardic.PanoShard.Managers.Panoshard.SetMinLevel ( int level)
inlinestatic

Sets the minimum zoom level for tiles.

Parameters
levelThe min level (typically 0-6).
Exceptions
ArgumentOutOfRangeExceptionThrown if level is negative.

◆ SetQualityPreset()

static void Reshardic.PanoShard.Managers.Panoshard.SetQualityPreset ( PanoShardQualityPreset preset)
inlinestatic

Sets the quality preset for rendering.

Parameters
presetThe quality preset.
Exceptions
ArgumentNullExceptionThrown if preset is null.

◆ ToggleHotspotVisibility()

static bool Reshardic.PanoShard.Managers.Panoshard.ToggleHotspotVisibility ( )
inlinestatic

Toggles the visibility of all hotspots.

Returns
The new visibility state, or false if TourManager is not available.

◆ UpdateActiveSphereGenerator()

static void Reshardic.PanoShard.Managers.Panoshard.UpdateActiveSphereGenerator ( SphereSegmentGenerator sphereGenerator)
inlinestatic

Updates the active SphereSegmentGenerator reference. Use this when switching spheres in scene streaming scenarios.

Parameters
sphereGeneratorThe new SphereSegmentGenerator to use.

◆ UpdateSphereMaxSegments()

static void Reshardic.PanoShard.Managers.Panoshard.UpdateSphereMaxSegments ( int newMaxDetailLevel)
inlinestatic

Updates the sphere's maximum detail level.

Parameters
newMaxDetailLevelThe new max detail level (must be non-negative).
Exceptions
ArgumentOutOfRangeExceptionThrown if newMaxDetailLevel is negative.

Property Documentation

◆ IsInitialized

bool Reshardic.PanoShard.Managers.Panoshard.IsInitialized
staticget

Gets whether the Panoshard system has been successfully initialized with all required components.


The documentation for this class was generated from the following file: