Edit

Share via


MixedRealitySceneSystem Class

Definition

The default implementation of the IMixedRealitySceneSystem Because so much of this service's functionality is editor-only, it has been split into a partial class. This part handles the runtime parts of the service.

public ref class MixedRealitySceneSystem : Microsoft::MixedReality::Toolkit::BaseCoreSystem, IDisposable, Microsoft::MixedReality::Toolkit::SceneSystem::IMixedRealitySceneSystem, Microsoft::MixedReality::Toolkit::SceneSystem::IMixedRealitySceneSystemEditor, System::Collections::IEqualityComparer
[UnityEngine.HelpURL("https://docs.microsoft.com/windows/mixed-reality/mrtk-unity/features/scene-system/scene-system-getting-started")]
public class MixedRealitySceneSystem : Microsoft.MixedReality.Toolkit.BaseCoreSystem, IDisposable, Microsoft.MixedReality.Toolkit.SceneSystem.IMixedRealitySceneSystem, Microsoft.MixedReality.Toolkit.SceneSystem.IMixedRealitySceneSystemEditor, System.Collections.IEqualityComparer
[<UnityEngine.HelpURL("https://docs.microsoft.com/windows/mixed-reality/mrtk-unity/features/scene-system/scene-system-getting-started")>]
type MixedRealitySceneSystem = class
    inherit BaseCoreSystem
    interface IMixedRealitySceneSystem
    interface IMixedRealityEventSystem
    interface IMixedRealityService
    interface IDisposable
    interface IMixedRealityEventSource
    interface IEqualityComparer
    interface IMixedRealitySceneSystemEditor
Public Class MixedRealitySceneSystem
Inherits BaseCoreSystem
Implements IDisposable, IEqualityComparer, IMixedRealitySceneSystem, IMixedRealitySceneSystemEditor
Inheritance
Attributes
UnityEngine.HelpURLAttribute
Implements

Constructors

MixedRealitySceneSystem(IMixedRealityServiceRegistrar, MixedRealitySceneSystemProfile)
Obsolete.

Constructor.

MixedRealitySceneSystem(MixedRealitySceneSystemProfile)

Constructor.

Fields

DefaultPriority (Inherited from BaseService)
disposed

Value indicating if the object has completed disposal.

(Inherited from BaseService)

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 BaseService)
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.

ContentScenes

Returns all content scenes found in profile.

ContentTags

Returns all content tags found in profile scenes.

EventHandlersByType

List of all event handlers grouped by type that are registered to this Event System.

(Inherited from BaseEventSystem)
EventListeners

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

(Inherited from BaseEventSystem)
IsEnabled

Indicates whether or not the service is currently enabled.

(Inherited from BaseService)
IsInitialized

Indicates whether or not the service has been initialized.

(Inherited from BaseService)
IsMarkedDestroyed

Indicates whether or not the Destroy method been called on this service.

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

LightingScenes

Returns all lighting scenes found in profile.

ManagerScene

Returns the manager scene found in profile.

Name

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

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 BaseService)
Registrar
Obsolete.

The service registrar instance that registered this service.

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

SourceName

The name of this event source.

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.

Disable()

Optional Disable function to pause the service.

Dispose()

Cleanup resources used by this object.

(Inherited from BaseService)
Dispose(Boolean)

Cleanup resources used by the object

(Inherited from BaseService)
EditorLoadNextContent(Boolean)

Singly loads next content scene (if available) and unloads all other content scenes. Useful for inspectors.

EditorLoadPrevContent(Boolean)

Singly loads previous content scene (if available) and unloads all other content scenes. Useful for inspectors.

Enable()

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

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 BaseEventSystem)
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.

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 BaseService)
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)

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

(Inherited from BaseEventSystem)
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 BaseEventSystem)
Reset()

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

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

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

(Inherited from BaseEventSystem)
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 BaseEventSystem)
Update()

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

Explicit Interface Implementations

IEqualityComparer.Equals(Object, Object)

Determines whether the specified objects are equal.

IEqualityComparer.GetHashCode(Object)

Returns a hash code for the specified object.

Applies to