Class SceneTransitionService
Inherited Members
Namespace: Microsoft.MixedReality.Toolkit.Extensions.SceneTransitions
Assembly: cs.temp.dll.dll
Syntax
public class SceneTransitionService : BaseExtensionService, ISceneTransitionService, IMixedRealityExtensionService, IMixedRealityService, IDisposable
Constructors
SceneTransitionService(IMixedRealityServiceRegistrar, String, UInt32, BaseMixedRealityProfile)
Declaration
public SceneTransitionService(IMixedRealityServiceRegistrar registrar, string name, uint priority, BaseMixedRealityProfile profile)
Parameters
Type | Name | Description |
---|---|---|
IMixedRealityServiceRegistrar | registrar | |
String | name | |
UInt32 | priority | |
BaseMixedRealityProfile | profile |
Properties
FadeColor
The color to use when fading out.
Declaration
public Color FadeColor { get; set; }
Property Value
Type | Description |
---|---|
Color |
FadeInTime
Time in seconds for fade in to complete.
Declaration
public float FadeInTime { get; set; }
Property Value
Type | Description |
---|---|
Single |
FadeOutTime
Time in seconds for fade out to complete.
Declaration
public float FadeOutTime { get; set; }
Property Value
Type | Description |
---|---|
Single |
FadeTargets
Which cameras to target when fading.
Declaration
public CameraFaderTargets FadeTargets { get; set; }
Property Value
Type | Description |
---|---|
CameraFaderTargets |
OnTransitionCompleted
Called when transition ends. This is called at the end of a transition, not at the end of a scene load. For scene load events, we recommend using IMixedRealitySceneSystem.
Declaration
public Action OnTransitionCompleted { get; set; }
Property Value
Type | Description |
---|---|
Action |
OnTransitionStarted
Called when transition starts. This is called at the beginning of a transition, not at the beginning of a scene load. For scene load events, we recommend using IMixedRealitySceneSystem.
Declaration
public Action OnTransitionStarted { get; set; }
Property Value
Type | Description |
---|---|
Action |
TransitionInProgress
True when a scene transition is in progress.
Declaration
public bool TransitionInProgress { get; set; }
Property Value
Type | Description |
---|---|
Boolean |
TransitionProgress
From 0 to 1
Declaration
public float TransitionProgress { get; set; }
Property Value
Type | Description |
---|---|
Single |
UseFadeColor
Whether to use a fade color during transitions.
Declaration
public bool UseFadeColor { get; set; }
Property Value
Type | Description |
---|---|
Boolean |
Methods
Destroy()
Optional Destroy function to perform cleanup of the service before the Mixed Reality Toolkit is destroyed.
Declaration
public override void Destroy()
Overrides
DoSceneTransition(IEnumerable<Func<Task>>, IProgressIndicator)
Fades out, enables progress indicator, execute scene operations in order, disables progress indicator, fades back in
Declaration
public Task DoSceneTransition(IEnumerable<Func<Task>> sceneOperations, IProgressIndicator progressIndicator = null)
Parameters
Type | Name | Description |
---|---|---|
IEnumerable<Func<Task>> | sceneOperations | A set of tasks from the Scene System. |
IProgressIndicator | progressIndicator | If null, default progress indicator prefab will be used (or none if default is disabled in profile) |
Returns
Type | Description |
---|---|
Task |
DoSceneTransition(Func<Task>, IProgressIndicator)
Fades out, enables progress indicator, execute scene operation, disables progress indicator, fades back in
Declaration
public Task DoSceneTransition(Func<Task> sceneOperation, IProgressIndicator progressIndicator = null)
Parameters
Type | Name | Description |
---|---|---|
Func<Task> | sceneOperation | |
IProgressIndicator | progressIndicator | If null, default progress indicator prefab will be used (or none if default is disabled in profile) |
Returns
Type | Description |
---|---|
Task |
DoSceneTransition(Func<Task>, Func<Task>, IProgressIndicator)
Fades out, enables progress indicator, executes scene op 1, executes scene op 2, disables progress indicator, fades back in
Declaration
public Task DoSceneTransition(Func<Task> sceneOp1, Func<Task> sceneOp2, IProgressIndicator progressIndicator = null)
Parameters
Type | Name | Description |
---|---|---|
Func<Task> | sceneOp1 | |
Func<Task> | sceneOp2 | |
IProgressIndicator | progressIndicator |
Returns
Type | Description |
---|---|
Task |
Enable()
Optional Enable function to enable / re-enable the service.
Declaration
public override void Enable()
Overrides
FadeIn()
Fades target cameras in. Instant fade-out will occur if fade state is not opaque. Can be used independently of scene transitions provided no transition is taking place.
Declaration
public Task FadeIn()
Returns
Type | Description |
---|---|
Task |
FadeOut()
Fades target cameras out to color. Can be used independently of scene transitions provided no transition is taking place.
Declaration
public Task FadeOut()
Returns
Type | Description |
---|---|
Task |
HideProgressIndicator()
Hides the default progress indicator. Task completes when hide animation is done. Can be used independently of scene transitions provided no transition is taking place.
Declaration
public Task HideProgressIndicator()
Returns
Type | Description |
---|---|
Task |
Initialize()
The initialize function is used to setup the service once created. This method is called once all services have been registered in the Mixed Reality Toolkit.
Declaration
public override void Initialize()
Overrides
SetCustomFadeTargetCameras(IEnumerable<Camera>)
If FadeTargets is set to custom, you will need to provide a custom set of cameras for fading using this function PRIOR to calling DoSceneTransition.
Declaration
public void SetCustomFadeTargetCameras(IEnumerable<Camera> customFadeTargetCameras)
Parameters
Type | Name | Description |
---|---|---|
IEnumerable<Camera> | customFadeTargetCameras |
SetProgressMessage(String)
Sets the message on displayed progress indicator. If no progress indicator exists, has no effect.
Declaration
public void SetProgressMessage(string message)
Parameters
Type | Name | Description |
---|---|---|
String | message |
SetProgressValue(Single)
Sets progress to value from 0-1. If no progress indicator exists, has no effect.
Declaration
public void SetProgressValue(float progress)
Parameters
Type | Name | Description |
---|---|---|
Single | progress |
ShowDefaultProgressIndicator()
Instantiates the default progress indicator and returns its main transform. Can be used independently of scene transitions provided no transition is taking place.
Declaration
public Transform ShowDefaultProgressIndicator()
Returns
Type | Description |
---|---|
Transform |