Düzenle

Aracılığıyla paylaş


IMixedRealitySceneSystem Interface

Definition

Interface for managing scenes in Unity. Scenes are divided into three categories: Manager, Lighting and Content.

The Manager scene is loaded first and remains loaded for the duration of the app. Only one Manager scene is ever loaded, and no scene operation will ever unload it.

The Lighting scene is a largely empty scene which controls lighting settings. Ambient lighting, skybox, sun direction, etc. A default lighting scene is loaded on initialization. After that the active lighting scene may be changed at any time via SetLightingScene. Only one lighting scene can ever be loaded at a time.

Content scenes are everything else. These can be loaded and unloaded at will in any combination.

The scene actions provided improve on unity's SceneManagement events by ensuring that scenes are considered valid before the action is invoked.

public interface class IMixedRealitySceneSystem : IDisposable, Microsoft::MixedReality::Toolkit::IMixedRealityEventSource, Microsoft::MixedReality::Toolkit::IMixedRealityEventSystem, System::Collections::IEqualityComparer
public interface IMixedRealitySceneSystem : IDisposable, Microsoft.MixedReality.Toolkit.IMixedRealityEventSource, Microsoft.MixedReality.Toolkit.IMixedRealityEventSystem, System.Collections.IEqualityComparer
type IMixedRealitySceneSystem = interface
    interface IMixedRealityEventSystem
    interface IMixedRealityService
    interface IDisposable
    interface IMixedRealityEventSource
    interface IEqualityComparer
Public Interface IMixedRealitySceneSystem
Implements IDisposable, IEqualityComparer, IMixedRealityEventSource, IMixedRealityEventSystem
Derived
Implements

Properties

ActiveLightingScene

Name of the currently loaded lighting scene. If a transition is in progress, this reports the target lighting scene we're transitioning to.

ConfigurationProfile

The configuration profile for the service.

(Inherited from IMixedRealityService)
ContentSceneNames

An array of content scenes available to load / unload. Order in array matches build order. Useful if you want to present an ordered list of options, or if you want to track which scenes are loaded via IsContentLoaded.

EventListeners

List of event listeners that are registered to this Event System.

(Inherited from IMixedRealityEventSystem)
LightingOperationInProgress

True if the scene system is transitioning from one lighting scene to another. Lighting operations will not impede other operations.

LightingOperationProgress

Progress of current lighting operation, from 0-1

Name

Optional Priority attribute if multiple services of the same type are required, enables targeting a service for action.

(Inherited from IMixedRealityService)
NextContentExists

Returns true if a content scene appears in build settings AFTER the latest loaded build index. Use to verify that LoadNextContent can be performed without wrapping.

OnContentLoaded

Called when a set of content scenes have been loaded, activated and are valid. Includes names of all scenes loaded.

OnContentUnloaded

Called after a set of content scenes have been completely unloaded. Includes names of all scenes about to be unloaded.

OnLightingLoaded

Called when a lighting scene has been loaded, activated and is valid. Includes scene name.

OnLightingUnloaded

Called after a lighting scene has been completely unloaded. Includes scene name.

OnSceneLoaded

Called when scene has been loaded, activated and is valid. Called for all scene types (content, lighting and manager) Includes scene name

OnSceneUnloaded

Called when scene has been unloaded Called for all scene types (content, lighting and manager) Includes scene name

OnWillLoadContent

Called just before a set of content scenes is loaded. Includes names of all scenes about to be loaded.

OnWillLoadLighting

Called just before a lighting scene is loaded. Includes name of scene.

OnWillLoadScene

Called just before a scene is loaded. Called for all scene types (content, lighting and manager) Includes scene name

OnWillUnloadContent

Called just before a set of content scenes will be unloaded. Includes names of all scenes about to be unloaded.

OnWillUnloadLighting

Called just before a lighting scene unload operation begins. Includes scene name.

OnWillUnloadScene

Called just before a scene will be unloaded Called for all scene types (content, lighting and manager) Includes scene name

PrevContentExists

Returns true if a content scene appears in build settings PRIOR to the latest loaded build index. Use to verify that LoadPrevContent can be performed without wrapping.

Priority

Optional Priority to reorder registered managers based on their respective priority, reduces the risk of race conditions by prioritizing the order in which managers are evaluated.

(Inherited from IMixedRealityService)
SceneOperationInProgress

True if the scene system is loading or unloading content scenes. Manager and lighting scenes are ignored.

SceneOperationProgress

Progress of the current scene operation, from 0-1. A scene operation may include multiple concurrently loaded scenes.

SourceId

The unique source id of this event source.

(Inherited from IMixedRealityEventSource)
SourceName

The name of this event source.

(Inherited from IMixedRealityEventSource)
WaitingToProceed

True when content has been loaded with an activation token and AllowSceneActivation has not been set to true. Useful for existing entities that shouldn't act until a newly loaded scene is actually activated.

Methods

Destroy()

Optional Destroy function to perform cleanup of the service before the Mixed Reality Toolkit is destroyed.

(Inherited from IMixedRealityService)
Disable()

Optional Disable function to pause the service.

(Inherited from IMixedRealityService)
Enable()

Optional Enable function to enable / re-enable the service.

(Inherited from IMixedRealityService)
GetScene(String)

Returns a scene by name. Useful for processing events.

GetScenes(IEnumerable<String>)

Returns a set of scenes by name. Useful for processing events.

HandleEvent<T>(BaseEventData, ExecuteEvents.EventFunction<T>)

The main function for handling and forwarding all events to their intended recipients.

(Inherited from IMixedRealityEventSystem)
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.

(Inherited from IMixedRealityService)
IsContentLoaded(String)

Returns true if a content scene is fully loaded.

LateUpdate()

Optional LateUpdate function to that is called after Update has been called on all services.

(Inherited from IMixedRealityService)
LoadContent(IEnumerable<String>, LoadSceneMode, SceneActivationToken)

Async method to load the scenes by name. If a scene operation is in progress, no action will be taken.

LoadContent(String, LoadSceneMode, SceneActivationToken)

Async method to load a single scene by name. If a scene operation is in progress, no action will be taken.

LoadContentByTag(String, LoadSceneMode, SceneActivationToken)

Async method to load content scenes by tag. All scenes with the supplied tag will be loaded. If no scenes with this tag are found, no action will be taken. If a scene operation is in progress, no action will be taken.

LoadNextContent(Boolean, LoadSceneMode, SceneActivationToken)

Loads the next content scene according to build index. Uses the last-loaded content scene as previous build index. If no next content exists, and wrap is false, no action is taken. Use NextContentExists to verify that this operation is possible (if not using wrap).

LoadPrevContent(Boolean, LoadSceneMode, SceneActivationToken)

Loads the previous content scene according to build index. Uses the loaded content scene with the smallest build index as previous build index. If no previous content exists, and wrap is false, no action is taken. Use PrevContentExists to verify that this operation is possible (if not using wrap).

Register(GameObject)
Obsolete.

Registers a GameObject to listen for events from this Event System.

(Inherited from IMixedRealityEventSystem)
RegisterHandler<T>(IEventSystemHandler)

Registers the given handler as a global listener for all events handled via the T interface. T must be an interface type, not a class type, derived from IEventSystemHandler.

(Inherited from IMixedRealityEventSystem)
Reset()

Optional Reset function to perform that will Reset the service, for example, whenever there is a profile change.

(Inherited from IMixedRealityService)
SetLightingScene(String, LightingSceneTransitionType, Single)

Sets the current lighting scene. The lighting scene determines ambient light and skybox settings. It can optionally contain light objects. If the lighting scene is already loaded, no action will be taken. If a lighting scene transition is in progress, request will be queued and executed when the transition is complete.

UnloadContent(IEnumerable<String>)

Async method to unload scenes by name. If a scene is not loaded, it will be ignored. If a scene operation is in progress, no action will be taken.

UnloadContent(String)

Async method to unload a single scene by name. If the scene is not loaded, no action will be taken. If a scene operation is in progress, no action will be taken.

UnloadContentByTag(String)

Async method to unload scenes by name. If a scene is not loaded, it will be ignored. If a scene operation is in progress, no action will be taken.

Unregister(GameObject)
Obsolete.

Unregisters a GameObject from listening for events from this Event System.

(Inherited from IMixedRealityEventSystem)
UnregisterHandler<T>(IEventSystemHandler)

Unregisters the given handler as a global listener for all events handled via the T interface. T must be an interface type, not a class type, derived from IEventSystemHandler.

(Inherited from IMixedRealityEventSystem)
Update()

Optional Update function to perform per-frame updates of the service.

(Inherited from IMixedRealityService)

Applies to