Commit 29de0c28 authored by BlackAngle233's avatar BlackAngle233
Browse files

10.19 learned

parent 912976bb
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
using Microsoft.MixedReality.Toolkit.Utilities;
using System;
using System.Collections.Generic;
namespace Microsoft.MixedReality.Toolkit
{
/// <summary>
/// Interface for Mixed Reality Toolkit service registration.
/// </summary>
public interface IMixedRealityServiceRegistrar
{
#region IMixedRealityService registration
/// <summary>
/// Registers a service of the specified type.
/// </summary>
/// <typeparam name="T">The interface type of the service to be registered (ex: IMixedRealityBoundarySystem).</typeparam>
/// <param name="serviceInstance">An instance of the service to be registered.</param>
bool RegisterService<T>(T serviceInstance) where T : IMixedRealityService;
/// <summary>
/// Registers a service of the specified type.
/// </summary>
/// <typeparam name="T">The interface type of the service to be registered (ex: IMixedRealityBoundarySystem).</typeparam>
/// <param name="concreteType">The concrete type to instantiate.</param>
/// <param name="supportedPlatforms">The platform(s) on which the service is supported.</param>
/// <param name="args">Optional arguments used when instantiating the concrete type.</param>
/// <returns>True if the service was successfully registered, false otherwise.</returns>
bool RegisterService<T>(
Type concreteType,
SupportedPlatforms supportedPlatforms = (SupportedPlatforms)(-1),
params object[] args) where T : IMixedRealityService;
/// <summary>
/// Unregisters a service of the specified type.
/// </summary>
/// <typeparam name="T">The interface type of the service to be unregistered (ex: IMixedRealityBoundarySystem).</typeparam>
/// <param name="name">The name of the service to unregister.</param>
/// <returns>True if the service was successfully unregistered, false otherwise.</returns>
/// <remarks>If the name argument is not specified, the first instance will be unregistered</remarks>
bool UnregisterService<T>(string name = null) where T : IMixedRealityService;
/// <summary>
/// Unregisters a service.
/// </summary>
/// <typeparam name="T">The interface type of the service to be unregistered (ex: IMixedRealityBoundarySystem).</typeparam>
/// <param name="service">The specific service instance to unregister.</param>
/// <returns>True if the service was successfully unregistered, false otherwise.</returns>
bool UnregisterService<T>(T serviceInstance) where T : IMixedRealityService;
/// <summary>
/// Checks to see if a service of the specified type has been registered.
/// </summary>
/// <typeparam name="T">The interface type of the service (ex: IMixedRealityBoundarySystem).</typeparam>
/// <param name="name">The name of the service.</param>
/// <returns>True if the service is registered, false otherwise.</returns>
bool IsServiceRegistered<T>(string name = null) where T : IMixedRealityService;
/// <summary>
/// Gets the instance of the registered service.
/// </summary>
/// <typeparam name="T">The interface type of the service (ex: IMixedRealityBoundarySystem).</typeparam>
/// <param name="name">The name of the service.</param>
/// <param name="showLogs">Indicates whether or not diagnostic logging should be performed in case of an error</param>
/// <returns>The registered service instance as the requested type.</returns>
T GetService<T>(string name = null, bool showLogs = true) where T : IMixedRealityService;
/// <summary>
/// Gets the collection of the registered service instances matching the requested type.
/// </summary>
/// <typeparam name="T">The interface type of the service (ex: IMixedRealityBoundarySystem).</typeparam>
/// <param name="name">Friendly name of the service.</param>
/// <returns>Read-only collection of the service instances, as the requested type.</returns>
IReadOnlyList<T> GetServices<T>(string name = null) where T : IMixedRealityService;
#endregion IMixedRealityServce registration
}
}
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
namespace Microsoft.MixedReality.Toolkit.Rendering
{
/// <summary>
/// Optional interface to use with objects which need to take ownership of <see cref="MaterialInstance"/>(s).
/// </summary>
public interface IMaterialInstanceOwner
{
/// <summary>
/// Method which is invoked by a <see cref="MaterialInstance"/> when an external material change is detected.
/// This normally occurs when materials are changed via <see href="https://docs.unity3d.com/ScriptReference/Renderer-material.html">Renderer.material</see>,
/// <see href="https://docs.unity3d.com/ScriptReference/Renderer-materials.html">Renderer.materials</see>, or via the editor.
/// </summary>
/// <param name="materialInstance">The material instance which contains the updated materials.</param>
void OnMaterialChanged(MaterialInstance materialInstance);
}
}
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using UnityEngine.SceneManagement;
namespace Microsoft.MixedReality.Toolkit.SceneSystem
{
/// <summary>
/// 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.
/// </summary>
public interface IMixedRealitySceneSystem : IMixedRealityEventSystem, IMixedRealityEventSource
{
#region Actions
/// <summary>
/// Called just before a set of content scenes is loaded.
/// Includes names of all scenes about to be loaded.
/// </summary>
Action<IEnumerable<string>> OnWillLoadContent { get; set; }
/// <summary>
/// Called when a set of content scenes have been loaded, activated and are valid.
/// Includes names of all scenes loaded.
/// </summary>
Action<IEnumerable<string>> OnContentLoaded { get; set; }
/// <summary>
/// Called just before a set of content scenes will be unloaded.
/// Includes names of all scenes about to be unloaded.
/// </summary>
Action<IEnumerable<string>> OnWillUnloadContent { get; set; }
/// <summary>
/// Called after a set of content scenes have been completely unloaded.
/// Includes names of all scenes about to be unloaded.
/// </summary>
Action<IEnumerable<string>> OnContentUnloaded { get; set; }
/// <summary>
/// Called just before a lighting scene is loaded.
/// Includes name of scene.
/// </summary>
Action<string> OnWillLoadLighting { get; set; }
/// <summary>
/// Called when a lighting scene has been loaded, activated and is valid.
/// Includes scene name.
/// </summary>
Action<string> OnLightingLoaded { get; set; }
/// <summary>
/// Called just before a lighting scene unload operation begins.
/// Includes scene name.
/// </summary>
Action<string> OnWillUnloadLighting { get; set; }
/// <summary>
/// Called after a lighting scene has been completely unloaded.
/// Includes scene name.
/// </summary>
Action<string> OnLightingUnloaded { get; set; }
/// <summary>
/// Called just before a scene is loaded.
/// Called for all scene types (content, lighting and manager)
/// Includes scene name
/// </summary>
Action<string> OnWillLoadScene { get; set; }
/// <summary>
/// Called when scene has been loaded, activated and is valid.
/// Called for all scene types (content, lighting and manager)
/// Includes scene name
/// </summary>
Action<string> OnSceneLoaded { get; set; }
/// <summary>
/// Called just before a scene will be unloaded
/// Called for all scene types (content, lighting and manager)
/// Includes scene name
/// </summary>
Action<string> OnWillUnloadScene { get; set; }
/// <summary>
/// Called when scene has been unloaded
/// Called for all scene types (content, lighting and manager)
/// Includes scene name
/// </summary>
Action<string> OnSceneUnloaded { get; set; }
#endregion
#region Properties
/// <summary>
/// True if the scene system is loading or unloading content scenes.
/// Manager and lighting scenes are ignored.
/// </summary>
bool SceneOperationInProgress { get; }
/// <summary>
/// Progress of the current scene operation, from 0-1.
/// A scene operation may include multiple concurrently loaded scenes.
/// </summary>
float SceneOperationProgress { get; }
/// <summary>
/// True if the scene system is transitioning from one lighting scene to another.
/// Lighting operations will not impede other operations.
/// </summary>
bool LightingOperationInProgress { get; }
/// <summary>
/// Progress of current lighting operation, from 0-1
/// </summary>
float LightingOperationProgress { get; }
/// <summary>
/// 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.
/// </summary>
bool WaitingToProceed { get; }
/// <summary>
/// Name of the currently loaded lighting scene.
/// If a transition is in progress, this reports the target lighting scene we're transitioning to.
/// </summary>
string ActiveLightingScene { get; }
/// <summary>
/// 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.
/// </summary>
bool PrevContentExists { get; }
/// <summary>
/// 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.
/// </summary>
bool NextContentExists { get; }
/// <summary>
/// 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.
/// </summary>
string[] ContentSceneNames { get; }
#endregion
#region Scene Operations
/// <summary>
/// Async method to load the scenes by name.
/// If a scene operation is in progress, no action will be taken.
/// </summary>
/// <param name="scenesToLoad">Names of content scenes to load. Invalid scenes will be ignored.</param>
/// <param name="mode">Additive mode will load the content additively. Single mode will first unload all loaded content scenes first.</param>
/// <param name="activationToken">
/// Optional token for manual scene activation. Useful for loading screens and multiplayer.
/// If not null, operation will wait until activationToken's AllowSceneActivation value is true before activating scene objects.
/// </param>
/// <returns>Task</returns>
Task LoadContent(IEnumerable<string> scenesToLoad, LoadSceneMode mode = LoadSceneMode.Additive, SceneActivationToken activationToken = null);
/// <summary>
/// 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.
/// </summary>
/// <returns>Task</returns>
Task UnloadContent(IEnumerable<string> scenesToUnload);
/// <summary>
/// Async method to load a single scene by name.
/// If a scene operation is in progress, no action will be taken.
/// </summary>
/// <param name="sceneToLoad">Name of content scene to load. Invalid scenes will be ignored.</param>
/// <param name="mode">Additive mode will load the content additively. Single mode will first unload all loaded content scenes first.</param>
/// <param name="activationToken">
/// Optional token for manual scene activation. Useful for loading screens and multiplayer.
/// If not null, operation will wait until activationToken's AllowSceneActivation value is true before activating scene objects.
/// </param>
/// <returns>Task</returns>
Task LoadContent(string sceneToLoad, LoadSceneMode mode = LoadSceneMode.Additive, SceneActivationToken activationToken = null);
/// <summary>
/// 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.
/// </summary>
/// <returns>Task</returns>
Task UnloadContent(string sceneToUnload);
/// <summary>
/// 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.
/// </summary>
/// <param name="tag">Scene tag.</param>
/// <param name="mode">Additive mode will load the content additively. Single mode will first unload all loaded content scenes first.</param>
/// <param name="activationToken">
/// Optional token for manual scene activation. Useful for loading screens and multiplayer.
/// If not null, operation will wait until activationToken's AllowSceneActivation value is true before activating scene objects.
/// </param>
/// <returns>Task</returns>
Task LoadContentByTag(string tag, LoadSceneMode mode = LoadSceneMode.Additive, SceneActivationToken activationToken = null);
/// <summary>
/// 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.
/// </summary>
/// <param name="tag">Scene tag</param>
/// <returns>Task</returns>
Task UnloadContentByTag(string tag);
/// <summary>
/// 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).
/// </summary>
/// <param name="wrap">If true, if the current scene is the LAST content scene, the FIRST content scene will be loaded.</param>
/// <param name="mode">Additive mode will load the content additively. Single mode will first unload all loaded content scenes first.</param>
/// <param name="activationToken">
/// Optional token for manual scene activation. Useful for loading screens and multiplayer.
/// If not null, operation will wait until activationToken's AllowSceneActivation value is true before activating scene objects.
/// </param>
/// <returns>Task</returns>
Task LoadNextContent(bool wrap = false, LoadSceneMode mode = LoadSceneMode.Single, SceneActivationToken activationToken = null);
/// <summary>
/// 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).
/// </summary>
/// <param name="wrap">If true, if the current scene is the FIRST content scene, the LAST content scene will be loaded.</param>
/// <param name="mode">Additive mode will load the content additively. Single mode will first unload all loaded content scenes first.</param>
/// <param name="activationToken">
/// Optional token for manual scene activation. Useful for loading screens and multiplayer.
/// If not null, operation will wait until activationToken's AllowSceneActivation value is true before activating scene objects.
/// </param>
/// <returns>Task</returns>
Task LoadPrevContent(bool wrap = false, LoadSceneMode mode = LoadSceneMode.Single, SceneActivationToken activationToken = null);
/// <summary>
/// Returns true if a content scene is fully loaded.
/// </summary>
bool IsContentLoaded(string sceneName);
/// <summary>
/// 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.
/// </summary>
/// <param name="lightingSceneName">The name of the lighting scene.</param>
/// <param name="transitionType">The transition type to use. See LightingSceneTransitionType for information about each transition type.</param>
/// <param name="transitionDuration">The duration of the transition (if not None).</param>
void SetLightingScene(string newLightingSceneName, LightingSceneTransitionType transitionType = LightingSceneTransitionType.None, float transitionDuration = 1f);
#endregion
#region Utilities
/// <summary>
/// Returns a set of scenes by name.
/// Useful for processing events.
/// </summary>
IEnumerable<Scene> GetScenes(IEnumerable<string> sceneNames);
/// <summary>
/// Returns a scene by name.
/// Useful for processing events.
/// </summary>
Scene GetScene(string sceneName);
#endregion
}
}
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
using System.Collections.Generic;
namespace Microsoft.MixedReality.Toolkit.SceneSystem
{
/// <summary>
/// Optional editor-only interface for use with facade inspectors.
/// If a scene system service does not implement this interface, the facade will not be rendered.
/// </summary>
public interface IMixedRealitySceneSystemEditor
{
#if UNITY_EDITOR
/// <summary>
/// Returns all content scene tags in the scene service profile.
/// </summary>
IEnumerable<string> ContentTags { get; }
/// <summary>
/// Returns the content scenes in the scene service profile.
/// </summary>
SceneInfo[] ContentScenes { get; }
/// <summary>
/// Returns the lighting scenes in the scene service profile.
/// </summary>
SceneInfo[] LightingScenes { get; }
/// <summary>
/// Loads the next content scene in-editor. Use instead of IMixedRealitySceneSystem.LoadNextContent while not in play mode.
/// </summary>
/// <param name="wrap">If true, if the current scene is the LAST content scene, the FIRST content scene will be loaded.</param>
void EditorLoadNextContent(bool wrap = false);
/// <summary>
/// Loads the prev content scene in-editor. Use instead of IMixedRealitySceneSystem.LoadPrevContent while not in play mode.
/// </summary>
/// <param name="wrap">If true, if the current scene is the FIRST content scene, the LAST content scene will be loaded.</param>
void EditorLoadPrevContent(bool wrap = false);
#endif
}
}
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
namespace Microsoft.MixedReality.Toolkit
{
public interface IMixedRealityCapabilityCheck
{
/// <summary>
/// Checks to see if one or more registered data providers supports the requested capability
/// on the current platform.
/// </summary>
/// <param name="capability">The capability to check.</param>
/// <returns>True if the capability is supported, false otherwise.</returns>
bool CheckCapability(MixedRealityCapability capability);
}
}
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
namespace Microsoft.MixedReality.Toolkit
{
/// <summary>
/// Required interface for all Mixed Reality data providers. Data providers are the components
/// that supply services with required information (ex: input controller state).
/// </summary>
public interface IMixedRealityDataProvider : IMixedRealityService
{
// Reserved for future use.
}
}
\ No newline at end of file
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
using System.Collections.Generic;
namespace Microsoft.MixedReality.Toolkit
{
/// <summary>
/// Allows systems to provide access to their managed data providers.
/// </summary>
public interface IMixedRealityDataProviderAccess
{
/// <summary>
/// Gets the collection of registered data providers.
/// </summary>
/// <returns>
/// Read only copy of the list of registered data providers.
/// </returns>
IReadOnlyList<IMixedRealityDataProvider> GetDataProviders();
/// <summary>
/// Get the collection of registered observers of the specified type.
/// </summary>
/// <typeparam name="T">The desired data provider type</typeparam>
/// <returns>
/// Read-only copy of the list of registered data providers that implement the specified type.
/// </returns>
IReadOnlyList<T> GetDataProviders<T>() where T : IMixedRealityDataProvider;
/// <summary>
/// Get the data provider that is registered under the specified name.
/// </summary>
/// <param name="name">The friendly name of the data provider.</param>
/// <returns>
/// The requested data provider, or null if one cannot be found.
/// </returns>
/// <remarks>
/// If more than one data provider is registered under the specified name, the first will be returned.
/// </remarks>
IMixedRealityDataProvider GetDataProvider(string name);
/// <summary>
/// Get the data provider that is registered under the specified name (optional) and matching the specified type.
/// </summary>
/// <typeparam name="T">The desired data provider type.</typeparam>
/// <param name="name">The friendly name of the data provider.</param>
/// <returns>
/// The requested data provider, or null if one cannot be found.
/// </returns>
/// <remarks>
/// If more than one data provider is registered under the specified name, the first will be returned.
/// </remarks>
T GetDataProvider<T>(string name = null) where T : IMixedRealityDataProvider;
}
}
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
namespace Microsoft.MixedReality.Toolkit
{
/// <summary>
/// Generic interface for all optional Mixed Reality systems, components, or features that can be added to the <see cref="MixedRealityServiceConfiguration"/>
/// </summary>
public interface IMixedRealityExtensionService : IMixedRealityService
{
// Empty for now, but it is used to filter out the valid class types in the inspector dropdown.
}
}
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
using System;
namespace Microsoft.MixedReality.Toolkit
{
/// <summary>
/// Generic interface for all Mixed Reality Services
/// </summary>
public interface IMixedRealityService : IDisposable
{
/// <summary>
/// Optional Priority attribute if multiple services of the same type are required, enables targeting a service for action.
/// </summary>
string Name { get; }
/// <summary>
/// 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.
/// </summary>
uint Priority { get; }
/// <summary>
/// The configuration profile for the service.
/// </summary>
/// <remarks>
/// Many services may wish to provide a typed version (ex: MixedRealityInputSystemProfile) that casts this value for ease of use in calling code.
/// </remarks>
BaseMixedRealityProfile ConfigurationProfile { get; }
/// <summary>
/// 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.
/// </summary>
void Initialize();
/// <summary>
/// Optional Reset function to perform that will Reset the service, for example, whenever there is a profile change.
/// </summary>
void Reset();
/// <summary>
/// Optional Enable function to enable / re-enable the service.
/// </summary>
void Enable();
/// <summary>
/// Optional Update function to perform per-frame updates of the service.
/// </summary>
void Update();
/// <summary>
/// Optional LateUpdate function to that is called after Update has been called on all services.
/// </summary>
void LateUpdate();
/// <summary>
/// Optional Disable function to pause the service.
/// </summary>
void Disable();
/// <summary>
/// Optional Destroy function to perform cleanup of the service before the Mixed Reality Toolkit is destroyed.
/// </summary>
void Destroy();
}
}
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
using UnityEngine.EventSystems;
namespace Microsoft.MixedReality.Toolkit.SpatialAwareness
{
public interface IMixedRealitySpatialAwarenessObservationHandler<T> : IEventSystemHandler
{
/// <summary>
/// Called when a spatial observer adds a new observation.
/// </summary>
/// <param name="eventData">Data describing the event.</param>
void OnObservationAdded(MixedRealitySpatialAwarenessEventData<T> eventData);
/// <summary>
/// Called when a spatial observer updates a previous observation.
/// </summary>
/// <param name="eventData">Data describing the event.</param>
void OnObservationUpdated(MixedRealitySpatialAwarenessEventData<T> eventData);
/// <summary>
/// Called when a spatial observer removes a previous observation.
/// </summary>
/// <param name="eventData">Data describing the event.</param>
void OnObservationRemoved(MixedRealitySpatialAwarenessEventData<T> eventData);
}
}
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
using UnityEngine;
namespace Microsoft.MixedReality.Toolkit.SpatialAwareness
{
public interface IMixedRealitySpatialAwarenessObject
{
/// <summary>
/// A unique ID identifying this spatial object.
/// </summary>
int Id { get; set; }
/// <summary>
/// The GameObject representing this spatial object in the scene.
/// </summary>
GameObject GameObject { get; set; }
/// <summary>
/// The MeshRenderer of this spatial object.
/// </summary>
MeshRenderer Renderer { get; set; }
///<summary>
/// Cleans up this spatial object.
/// </summary>
void CleanObject();
}
}
\ No newline at end of file
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
using System;
using System.Collections.Generic;
using UnityEngine;
namespace Microsoft.MixedReality.Toolkit.SpatialAwareness
{
public interface IMixedRealitySpatialAwarenessSystem : IMixedRealityEventSystem
{
/// <summary>
/// Gets the parent object to which all spatial awareness <see href="https://docs.unity3d.com/ScriptReference/GameObject.html">GameObject</see>s are to be parented.
/// </summary>
GameObject SpatialAwarenessObjectParent { get; }
/// <summary>
/// Creates the a parent, that is a child of the Spatial Awareness System parent so that the scene hierarchy does not get overly cluttered.
/// </summary>
/// <returns>
/// The <see href="https://docs.unity3d.com/ScriptReference/GameObject.html">GameObject</see> to which spatial awareness objects will be parented.
/// </returns>
/// <remarks>
/// This method is to be called by implementations of the <see cref="IMixedRealitySpatialAwarenessObserver"/> interface, not by application code. It
/// is used to enable observations to be grouped by observer.
/// </remarks>
GameObject CreateSpatialAwarenessObservationParent(string name);
/// <summary>
/// Generates a new source identifier for an <see cref="IMixedRealitySpatialAwarenessObserver"/> implementation.
/// </summary>
/// <returns>The source identifier to be used by the <see cref="IMixedRealitySpatialAwarenessObserver"/> implementation.</returns>
/// <remarks>
/// This method is to be called by implementations of the <see cref="IMixedRealitySpatialAwarenessObserver"/> interface, not by application code.
/// </remarks>
uint GenerateNewSourceId();
/// <summary>
/// Typed representation of the ConfigurationProfile property.
/// </summary>
MixedRealitySpatialAwarenessSystemProfile SpatialAwarenessSystemProfile { get; }
/// <summary>
/// Gets the collection of registered <see cref="IMixedRealitySpatialAwarenessObserver"/> data providers.
/// </summary>
/// <returns>
/// Read only copy of the list of registered observers.
/// </returns>
[Obsolete("GetObservers will be removed in a future release. Cast to IMixedRealityDataProviderAccess and call GetDataProviders instead")]
IReadOnlyList<IMixedRealitySpatialAwarenessObserver> GetObservers();
/// <summary>
/// Get the collection of registered observers of the specified type.
/// </summary>
/// <typeparam name="T">The desired spatial awareness observer type (ex: <see cref="IMixedRealitySpatialAwarenessMeshObserver"/>)</typeparam>
/// <returns>
/// Readonly copy of the list of registered observers that implement the specified type.
/// </returns>
[Obsolete("GetObservers<T> will be removed in a future release. Cast to IMixedRealityDataProviderAccess and call GetDataProviders<T> instead")]
IReadOnlyList<T> GetObservers<T>() where T : IMixedRealitySpatialAwarenessObserver;
/// <summary>
/// Get the <see cref="IMixedRealitySpatialAwarenessObserver"/> that is registered under the specified name.
/// </summary>
/// <param name="name">The friendly name of the observer.</param>
/// <returns>
/// The requested observer, or null if one cannot be found.
/// </returns>
/// <remarks>
/// If more than one observer is registered under the specified name, the first will be returned.
/// </remarks>
[Obsolete("GetObserver will be removed in a future release. Cast to IMixedRealityDataProviderAccess and call GetDataProvider instead")]
IMixedRealitySpatialAwarenessObserver GetObserver(string name);
/// <summary>
/// Get the observer that is registered under the specified name matching the specified type.
/// </summary>
/// <typeparam name="T">The desired spatial awareness observer type (ex: <see cref="IMixedRealitySpatialAwarenessMeshObserver"/>)</typeparam>
/// <param name="name">The friendly name of the observer.</param>
/// <returns>
/// The requested observer, or null if one cannot be found.
/// </returns>
/// <remarks>
/// If more than one observer is registered under the specified name, the first will be returned.
/// </remarks>
[Obsolete("GetObserver<T> will be removed in a future release. Cast to IMixedRealityDataProviderAccess and call GetDataProvider<T> instead")]
T GetObserver<T>(string name = null) where T : IMixedRealitySpatialAwarenessObserver;
/// <summary>
/// Starts / restarts all spatial observers of the specified type.
/// </summary>
void ResumeObservers();
/// <summary>
/// Starts / restarts all spatial observers of the specified type.
/// </summary>
/// <typeparam name="T">The desired spatial awareness observer type (ex: <see cref="IMixedRealitySpatialAwarenessMeshObserver"/>)</typeparam>
void ResumeObservers<T>() where T : IMixedRealitySpatialAwarenessObserver;
/// <summary>
/// Starts / restarts the spatial observer registered under the specified name matching the specified type.
/// </summary>
/// <typeparam name="T">The desired spatial awareness observer type (ex: <see cref="IMixedRealitySpatialAwarenessMeshObserver"/>)</typeparam>
/// <param name="name">The friendly name of the observer.</param>
void ResumeObserver<T>(string name) where T : IMixedRealitySpatialAwarenessObserver;
/// <summary>
/// Stops / pauses all spatial observers.
/// </summary>
void SuspendObservers();
/// <summary>
/// Stops / pauses all spatial observers of the specified type.
/// </summary>
void SuspendObservers<T>() where T : IMixedRealitySpatialAwarenessObserver;
/// <summary>
/// Stops / pauses the spatial observer registered under the specified name matching the specified type.
/// </summary>
/// <typeparam name="T">The desired spatial awareness observer type (ex: <see cref="IMixedRealitySpatialAwarenessMeshObserver"/>)</typeparam>
/// <param name="name">The friendly name of the observer.</param>
void SuspendObserver<T>(string name) where T : IMixedRealitySpatialAwarenessObserver;
/// <summary>
/// Clears all registered observers' observations.
/// </summary>
void ClearObservations();
/// <summary>
/// Clears the observations of the specified observer.
/// </summary>
/// <typeparam name="T">The observer type.</typeparam>
/// <param name="name">The name of the observer.</param>
void ClearObservations<T>(string name = null) where T : IMixedRealitySpatialAwarenessObserver;
}
}
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
using System.Collections.Generic;
using UnityEngine;
namespace Microsoft.MixedReality.Toolkit.SpatialAwareness
{
/// <summary>
/// The interface for defining an <see cref="IMixedRealitySpatialAwarenessObserver"/> which provides mesh data.
/// </summary>
public interface IMixedRealitySpatialAwarenessMeshObserver : IMixedRealitySpatialAwarenessObserver
{
/// <summary>
/// Gets or sets a value indicating how the mesh subsystem is to display surface meshes within the application.
/// </summary>
/// <remarks>
/// Applications that wish to process the <see href="https://docs.unity3d.com/ScriptReference/Mesh.html">Mesh</see>es should set this value to None.
/// </remarks>
SpatialAwarenessMeshDisplayOptions DisplayOption { get; set; }
/// <summary>
/// Gets or sets the level of detail, as a MixedRealitySpatialAwarenessMeshLevelOfDetail value, for the returned spatial mesh.
/// Setting this value to Custom, implies that the developer is specifying a custom value for MeshTrianglesPerCubicMeter.
/// </summary>
/// <remarks>
/// Specifying any other value will cause <see cref="TrianglesPerCubicMeter"/> to be overwritten.
/// </remarks>
SpatialAwarenessMeshLevelOfDetail LevelOfDetail { get; set; }
/// <summary>
/// Gets the collection of <see cref="Microsoft.MixedReality.Toolkit.SpatialAwareness.SpatialAwarenessMeshObject"/>s being managed by the observer.
/// </summary>
IReadOnlyDictionary<int, SpatialAwarenessMeshObject> Meshes { get; }
/// <summary>
/// Get or sets the desired Unity Physics Layer on which to set the spatial mesh.
/// </summary>
/// <remarks>
/// If not explicitly set, it is recommended that implementations return <see cref="IMixedRealitySpatialAwarenessObserver.DefaultPhysicsLayer"/>.
/// </remarks>
int MeshPhysicsLayer { get; set; }
/// <summary>
/// Gets the bit mask that corresponds to the value specified in <see cref="MeshPhysicsLayer"/>.
/// </summary>
int MeshPhysicsLayerMask { get; }
/// <summary>
/// Indicates whether or not mesh normals should be recalculated by the observer.
/// </summary>
bool RecalculateNormals { get; set; }
/// <summary>
/// Gets or sets the level of detail, in triangles per cubic meter, for the returned spatial mesh.
/// </summary>
/// <remarks>
/// When specifying a <see cref="LevelOfDetail"/> other than Custom, this value will be automatically overwritten with system default values.
/// </remarks>
int TrianglesPerCubicMeter { get; set; }
/// <summary>
/// Gets or sets the <see href="https://docs.unity3d.com/ScriptReference/Material.html">Material</see> to be used when spatial <see href="https://docs.unity3d.com/ScriptReference/Mesh.html">Mesh</see>es should occlude other objects.
/// </summary>
Material OcclusionMaterial { get; set; }
/// <summary>
/// Gets or sets the <see href="https://docs.unity3d.com/ScriptReference/Material.html">Material</see> to be used when displaying <see href="https://docs.unity3d.com/ScriptReference/Mesh.html">Mesh</see>es.
/// </summary>
Material VisibleMaterial { get; set; }
}
}
\ No newline at end of file
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
using Microsoft.MixedReality.Toolkit.Utilities;
using UnityEngine;
namespace Microsoft.MixedReality.Toolkit.SpatialAwareness
{
public interface IMixedRealitySpatialAwarenessObserver : IMixedRealityDataProvider, IMixedRealityEventSource
{
/// <summary>
/// Indicates the developer's intended startup behavior.
/// </summary>
AutoStartBehavior StartupBehavior { get; set; }
/// <summary>
/// Get or sets the default Unity Physics Layer on which to set the spatial object.
/// </summary>
int DefaultPhysicsLayer { get; }
/// <summary>
/// Is the observer running (actively accumulating spatial data)?
/// </summary>
bool IsRunning { get; }
/// <summary>
/// Should the observer remain stationary in the scene?
/// </summary>
/// <remarks>
/// Set IsStationaryObserver to false to move the volume with the user.
/// If set to true, the origin will be 0,0,0 or the last known location.
/// </remarks>
bool IsStationaryObserver { get; set; }
/// <summary>
/// Gets or sets the type of volume the observer should operate in.
/// </summary>
VolumeType ObserverVolumeType { get; set; }
/// <summary>
/// Gets or sets the extents( 1/2 size) of the volume, in meters per axis, from which individual observations will be made.
/// </summary>
/// <remarks>
/// When used when <see cref="ObserverVolumeType"/> is set to <see cref="Microsoft.MixedReality.Toolkit.Utilities.VolumeType.Sphere"/> the X value of the extents will be
/// used as the radius.
/// </remarks>
Vector3 ObservationExtents { get; set; }
/// <summary>
/// Gets or sets the orientation of the volume in World Space.
/// </summary>
/// <remarks>
/// This is only used when <see cref="ObserverVolumeType"/> is set to <see cref="Microsoft.MixedReality.Toolkit.Utilities.VolumeType.UserAlignedCube"/>
/// </remarks>
Quaternion ObserverRotation { get; set; }
/// <summary>
/// Gets or sets the origin, in World Space, of the observer.
/// </summary>
/// <remarks>
/// Moving the observer origin allows the spatial awareness system to locate and discard meshes as the user
/// navigates the environment.
/// </remarks>
Vector3 ObserverOrigin { get; set; }
/// <summary>
/// Gets or sets the frequency, in seconds, at which the spatial observer should update.
/// </summary>
float UpdateInterval { get; set; }
/// <summary>
/// Start | resume the observer.
/// </summary>
void Resume();
/// <summary>
/// Stop | pause the observer
/// </summary>
void Suspend();
/// <summary>
/// Clears the observer's collection of observations.
/// </summary>
/// <remarks>
/// If the observer is currently running, calling ClearObservations will suspend it.
/// </remarks>
void ClearObservations();
}
}
\ No newline at end of file
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
using System.Collections.Generic;
using UnityEngine;
namespace Microsoft.MixedReality.Toolkit.SpatialAwareness
{
/// <summary>
/// The interface for defining an <see cref="ISpatialAwarenessPhysicsProperties"/> which provides physical materials
/// </summary>
public interface ISpatialAwarenessPhysicsProperties
{
/// <summary>
/// Gets or sets the <see href="https://docs.unity3d.com/ScriptReference/PhysicMaterial.html">PhysicMaterial</see> to be used when displaying <see href="https://docs.unity3d.com/ScriptReference/Mesh.html">Mesh</see>es.
/// </summary>
PhysicMaterial PhysicsMaterial { get; set; }
}
}
\ No newline at end of file
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
using UnityEngine.EventSystems;
namespace Microsoft.MixedReality.Toolkit.Teleport
{
/// <summary>
/// Interface to implement for teleport events.
/// </summary>
public interface IMixedRealityTeleportHandler : IEventSystemHandler
{
/// <summary>
/// Raised when a pointer requests a teleport target, but no teleport has begun.
/// </summary>
void OnTeleportRequest(TeleportEventData eventData);
/// <summary>
/// Raised when a teleport has started.
/// </summary>
void OnTeleportStarted(TeleportEventData eventData);
/// <summary>
/// Raised when a teleport has successfully completed.
/// </summary>
void OnTeleportCompleted(TeleportEventData eventData);
/// <summary>
/// Raised when a teleport request has been canceled.
/// </summary>
void OnTeleportCanceled(TeleportEventData eventData);
}
}
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
using UnityEngine;
namespace Microsoft.MixedReality.Toolkit.Teleport
{
public interface IMixedRealityTeleportHotSpot
{
/// <summary>
/// The position the teleport will end at.
/// </summary>
Vector3 Position { get; }
/// <summary>
/// The normal of the teleport raycast.
/// </summary>
Vector3 Normal { get; }
/// <summary>
/// Is the teleport target active?
/// </summary>
bool IsActive { get; }
/// <summary>
/// Should the target orientation be overridden?
/// </summary>
bool OverrideTargetOrientation { get; }
/// <summary>
/// Should the destination orientation be overridden?
/// Useful when you want to orient the user in a specific direction when they teleport to this position.
/// </summary>
/// <remarks>
/// Override orientation is the transform forward of the GameObject this component is attached to.
/// </remarks>
float TargetOrientation { get; }
/// <summary>
/// Returns the <see href="https://docs.unity3d.com/ScriptReference/GameObject.html">GameObject</see> reference for this teleport target.
/// </summary>
GameObject GameObjectReference { get; }
}
}
\ No newline at end of file
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
using Microsoft.MixedReality.Toolkit.Input;
namespace Microsoft.MixedReality.Toolkit.Teleport
{
/// <summary>
/// Manager interface for a Teleport system in the Mixed Reality Toolkit
/// All replacement systems for providing Teleportation functionality should derive from this interface
/// </summary>
public interface IMixedRealityTeleportSystem : IMixedRealityEventSystem
{
/// <summary>
/// The duration of the teleport in seconds.
/// </summary>
float TeleportDuration { get; set; }
/// <summary>
/// Raise a teleportation request event.
/// </summary>
/// <param name="pointer">The pointer that raised the event.</param>
/// <param name="hotSpot">The teleport target</param>
void RaiseTeleportRequest(IMixedRealityPointer pointer, IMixedRealityTeleportHotSpot hotSpot);
/// <summary>
/// Raise a teleportation started event.
/// </summary>
/// <param name="pointer">The pointer that raised the event.</param>
/// <param name="hotSpot">The teleport target</param>
void RaiseTeleportStarted(IMixedRealityPointer pointer, IMixedRealityTeleportHotSpot hotSpot);
/// <summary>
/// Raise a teleportation canceled event.
/// </summary>
/// <param name="pointer">The pointer that raised the event.</param>
/// <param name="hotSpot">The teleport target</param>
void RaiseTeleportCanceled(IMixedRealityPointer pointer, IMixedRealityTeleportHotSpot hotSpot);
}
}
Copyright (c) Microsoft Corporation.
MIT License
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
\ No newline at end of file
{
"name": "Microsoft.MixedReality.Toolkit",
"references": [
"Microsoft.MixedReality.Toolkit.Async",
"Microsoft.MixedReality.Toolkit.Editor.Utilities"
],
"optionalUnityReferences": [],
"includePlatforms": [],
"excludePlatforms": [],
"allowUnsafeCode": false,
"overrideReferences": false,
"precompiledReferences": [],
"autoReferenced": true,
"defineConstraints": []
}
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment