Interface IStage
Represents the stage that is streamed from a IDataStreamer. All actions that can be performed on the stage goes through this type.
Namespace: Unity.Cloud.DataStreaming.Runtime
Assembly: Unity.Cloud.DataStreaming.Runtime.dll
Syntax
public interface IStage
Remarks
This type is returned by IDataStreamer on events and Open(DataStreamerSettings).
Properties
InstanceModifiers
Collection of InstanceModifiers applied to the stage instances.
Declaration
IInstanceModifierCollection InstanceModifiers { get; }
Property Value
| Type | Description |
|---|---|
| IInstanceModifierCollection |
Models
Collection of models displayed on the IStage.
Declaration
IModelCollection Models { get; }
Property Value
| Type | Description |
|---|---|
| IModelCollection |
Observers
Collection of observers currently observing the stage.
Declaration
IStageObserverCollection Observers { get; }
Property Value
| Type | Description |
|---|---|
| IStageObserverCollection |
StreamingStateChanged
Event-like object to know when the streaming state changes.
Declaration
IObservableEvent<StreamingState> StreamingStateChanged { get; }
Property Value
| Type | Description |
|---|---|
| IObservableEvent<StreamingState> |
Transform
Returns an object to manipulate the stage transform.
Declaration
ITransformValuesAccessor Transform { get; }
Property Value
| Type | Description |
|---|---|
| ITransformValuesAccessor |
Methods
GetWorldBounds()
Gets the currently known world bounds.
Declaration
DoubleBounds GetWorldBounds()
Returns
| Type | Description |
|---|---|
| DoubleBounds | The currently known world bounds. The Bounds may have an empty volume if there is no model on the IStage, or if the bounds of the models are not known yet. |
Remarks
This method is useful to eventually get the total bounds of all models on the IStage without having to manage an asynchronous call. If deterministic result is desired based on when Add(Action<ModelConfigurator>) and Remove(IModelStream) are invoked, please use GetWorldBoundsAsync() instead.
GetWorldBoundsAsync()
Calculates and returns the world bounds of the stage, applying the current Transform to the final result.
Declaration
Task<DoubleBounds> GetWorldBoundsAsync()
Returns
| Type | Description |
|---|---|
| Task<DoubleBounds> | The world bounds. |
Remarks
This method is an alternative to GetWorldBounds() to be able to asynchronously get the world bounds. If you are in a synchronous context, GetWorldBounds() may be more appropriate.
RaycastAsync(DoubleRay, float)
Raycasts into the stage and returns info on the first object hit.
Declaration
Task<RaycastResult> RaycastAsync(DoubleRay ray, float maxDistance)
Parameters
| Type | Name | Description |
|---|---|---|
| DoubleRay | ray | The ray to cast into the scene. |
| float | maxDistance | The maximum distance of the raycast. |
Returns
| Type | Description |
|---|---|
| Task<RaycastResult> | A RaycastResult containing the hit object's ID. |
RaycastAsync(Ray, float)
Raycasts into the stage and returns info on the first object hit.
Declaration
Task<RaycastResult> RaycastAsync(Ray ray, float maxDistance)
Parameters
| Type | Name | Description |
|---|---|---|
| Ray | ray | The ray to cast into the scene. |
| float | maxDistance | The maximum distance of the raycast. |
Returns
| Type | Description |
|---|---|
| Task<RaycastResult> | A RaycastResult containing the hit object's ID. |
WaitUntilLoadedAsync()
Wait until all required files are loaded and no more are pending to be loaded / unloaded.
Declaration
Task WaitUntilLoadedAsync()
Returns
| Type | Description |
|---|---|
| Task | Returns the asynchronous task. |
Exceptions
| Type | Condition |
|---|---|
| InvalidOperationException | The object is in an invalid state to execute this method. |