// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using Microsoft.MixedReality.Toolkit.Boundary; using Microsoft.MixedReality.Toolkit.CameraSystem; using Microsoft.MixedReality.Toolkit.Diagnostics; using Microsoft.MixedReality.Toolkit.Input; using Microsoft.MixedReality.Toolkit.SceneSystem; using Microsoft.MixedReality.Toolkit.SpatialAwareness; using Microsoft.MixedReality.Toolkit.Teleport; using Microsoft.MixedReality.Toolkit.Utilities; using System; using UnityEngine; using UnityEngine.Serialization; namespace Microsoft.MixedReality.Toolkit { /// /// Configuration profile settings for the Mixed Reality Toolkit. /// [CreateAssetMenu(menuName = "Mixed Reality/Toolkit/Profiles/Mixed Reality Toolkit Configuration Profile", fileName = "MixedRealityToolkitConfigurationProfile", order = (int)CreateProfileMenuItemIndices.Configuration)] [HelpURL("https://docs.microsoft.com/windows/mixed-reality/mrtk-unity/configuration/mixed-reality-configuration-guide")] public class MixedRealityToolkitConfigurationProfile : BaseMixedRealityProfile { #region Mixed Reality Toolkit configurable properties [SerializeField] [Tooltip("Experience Settings profile.")] private MixedRealityExperienceSettingsProfile experienceSettingsProfile; /// /// Profile for configuring the experience settings of your project. /// Determines whether your project targers AR/VR, the scale of your experience, and the height of the user where applicable /// public MixedRealityExperienceSettingsProfile ExperienceSettingsProfile { get { return experienceSettingsProfile; } internal set { experienceSettingsProfile = value; } } [SerializeField] [Tooltip("The scale of the Mixed Reality experience.")] private ExperienceScale targetExperienceScale = ExperienceScale.Room; /// /// The desired the scale of the experience. /// Profile for configuring the experience settings of your project. /// Determines whether your project targers AR/VR, the scale of your experience, and the height of the user where applicable /// /// /// The target experience scale is now configured via ExperienceSettingsProfile /// [Obsolete("The target experience scale is now configured via ExperienceSettingsProfile, please use the ExperienceSettingsProfile.TargetExperienceScale instead")] public ExperienceScale TargetExperienceScale { get { return targetExperienceScale; } set { targetExperienceScale = value; } } [SerializeField] [FormerlySerializedAs("enableCameraProfile")] [Tooltip("Enable the Camera System on Startup.")] private bool enableCameraSystem = false; /// /// Enable and configure the Camera Profile for the Mixed Reality Toolkit /// public bool IsCameraSystemEnabled { get { return CameraProfile != null && cameraSystemType != null && cameraSystemType.Type != null && enableCameraSystem; } internal set { enableCameraSystem = value; } } [SerializeField] [Tooltip("Camera profile.")] private MixedRealityCameraProfile cameraProfile; /// /// Profile for customizing your camera and quality settings based on if your /// head mounted display (HMD) is a transparent device or an occluded device. /// public MixedRealityCameraProfile CameraProfile { get { return cameraProfile; } internal set { cameraProfile = value; } } /// /// Camera System class to instantiate at runtime. /// public SystemType CameraSystemType { get { return cameraSystemType; } internal set { cameraSystemType = value; } } [SerializeField] [Tooltip("Camera System Class to instantiate at runtime.")] [Implements(typeof(IMixedRealityCameraSystem), TypeGrouping.ByNamespaceFlat)] private SystemType cameraSystemType; [SerializeField] [Tooltip("Enable the Input System on Startup.")] private bool enableInputSystem = false; /// /// Enable and configure the Input System component for the Mixed Reality Toolkit /// public bool IsInputSystemEnabled { get { return inputSystemProfile != null && inputSystemType != null && inputSystemType.Type != null && enableInputSystem; } internal set { enableInputSystem = value; } } [SerializeField] [Tooltip("Input System profile for setting wiring up events and actions to input devices.")] private MixedRealityInputSystemProfile inputSystemProfile; /// /// Input System profile for configuring events and actions to input devices. /// public MixedRealityInputSystemProfile InputSystemProfile { get { return inputSystemProfile; } internal set { inputSystemProfile = value; } } [SerializeField] [Tooltip("Input System class to instantiate at runtime.")] [Implements(typeof(IMixedRealityInputSystem), TypeGrouping.ByNamespaceFlat)] private SystemType inputSystemType; /// /// Input System class to instantiate at runtime. /// public SystemType InputSystemType { get { return inputSystemType; } internal set { inputSystemType = value; } } [SerializeField] [Tooltip("Enable the Boundary on Startup")] private bool enableBoundarySystem = false; /// /// Enable and configure the boundary system. /// public bool IsBoundarySystemEnabled { get { return BoundarySystemSystemType != null && BoundarySystemSystemType.Type != null && enableBoundarySystem && boundaryVisualizationProfile != null; } internal set { enableBoundarySystem = value; } } [SerializeField] [Tooltip("Boundary system class to instantiate at runtime for legacy XR.")] [Implements(typeof(IMixedRealityBoundarySystem), TypeGrouping.ByNamespaceFlat)] private SystemType boundarySystemType = null; [SerializeField] [Tooltip("Boundary system class to instantiate at runtime for XR SDK.")] [Implements(typeof(IMixedRealityBoundarySystem), TypeGrouping.ByNamespaceFlat)] private SystemType xrsdkBoundarySystemType = null; /// /// Boundary system class to instantiate at runtime. /// public SystemType BoundarySystemSystemType => (XRSettingsUtilities.XRSDKEnabled && xrsdkBoundarySystemType?.Type != null) ? xrsdkBoundarySystemType : boundarySystemType; [SerializeField] [Tooltip("Profile for wiring up boundary visualization assets.")] private MixedRealityBoundaryVisualizationProfile boundaryVisualizationProfile; /// /// Active profile for boundary visualization. /// public MixedRealityBoundaryVisualizationProfile BoundaryVisualizationProfile { get { return boundaryVisualizationProfile; } internal set { boundaryVisualizationProfile = value; } } [SerializeField] [Tooltip("Enable the Teleport System on Startup")] private bool enableTeleportSystem = false; /// /// Enable and configure the teleport system. /// public bool IsTeleportSystemEnabled { get { return teleportSystemType != null && teleportSystemType.Type != null && enableTeleportSystem; } internal set { enableTeleportSystem = value; } } [SerializeField] [Tooltip("Boundary System Class to instantiate at runtime.")] [Implements(typeof(IMixedRealityTeleportSystem), TypeGrouping.ByNamespaceFlat)] private SystemType teleportSystemType; /// /// Teleport System class to instantiate at runtime. /// public SystemType TeleportSystemSystemType { get { return teleportSystemType; } internal set { teleportSystemType = value; } } [SerializeField] [Tooltip("Enable the Spatial Awareness system on startup")] private bool enableSpatialAwarenessSystem = false; /// /// Enable and configure the spatial awareness system. /// public bool IsSpatialAwarenessSystemEnabled { get { return spatialAwarenessSystemType != null && spatialAwarenessSystemType.Type != null && enableSpatialAwarenessSystem; } internal set { enableSpatialAwarenessSystem = value; } } [SerializeField] [Tooltip("Spatial Awareness System Class to instantiate at runtime.")] [Implements(typeof(IMixedRealitySpatialAwarenessSystem), TypeGrouping.ByNamespaceFlat)] private SystemType spatialAwarenessSystemType; /// /// Spatial Awareness System class to instantiate at runtime. /// public SystemType SpatialAwarenessSystemSystemType { get { return spatialAwarenessSystemType; } internal set { spatialAwarenessSystemType = value; } } [SerializeField] [Tooltip("Profile for configuring the spatial awareness system.")] private MixedRealitySpatialAwarenessSystemProfile spatialAwarenessSystemProfile; /// /// Active profile for spatial awareness system /// public MixedRealitySpatialAwarenessSystemProfile SpatialAwarenessSystemProfile { get { return spatialAwarenessSystemProfile; } internal set { spatialAwarenessSystemProfile = value; } } [SerializeField] [Tooltip("Profile for configuring diagnostic components.")] private MixedRealityDiagnosticsProfile diagnosticsSystemProfile; /// /// Active profile for diagnostic configuration /// public MixedRealityDiagnosticsProfile DiagnosticsSystemProfile { get { return diagnosticsSystemProfile; } internal set { diagnosticsSystemProfile = value; } } [SerializeField] [Tooltip("Enable diagnostic system")] private bool enableDiagnosticsSystem = false; /// /// Is the Diagnostics System enabled? /// public bool IsDiagnosticsSystemEnabled { get { return enableDiagnosticsSystem && DiagnosticsSystemSystemType?.Type != null && diagnosticsSystemProfile != null; } internal set { enableDiagnosticsSystem = value; } } [SerializeField] [Tooltip("Diagnostics System class to instantiate at runtime.")] [Implements(typeof(IMixedRealityDiagnosticsSystem), TypeGrouping.ByNamespaceFlat)] private SystemType diagnosticsSystemType; /// /// Diagnostics System Script File to instantiate at runtime /// public SystemType DiagnosticsSystemSystemType { get { return diagnosticsSystemType; } internal set { diagnosticsSystemType = value; } } [SerializeField] [Tooltip("Profile for configuring scene system components.")] private MixedRealitySceneSystemProfile sceneSystemProfile; /// /// Active profile for scene configuration /// public MixedRealitySceneSystemProfile SceneSystemProfile { get { return sceneSystemProfile; } internal set { sceneSystemProfile = value; } } [SerializeField] [Tooltip("Enable scene system")] private bool enableSceneSystem = false; /// /// Is the Scene System enabled? /// public bool IsSceneSystemEnabled { get { return enableSceneSystem && SceneSystemSystemType?.Type != null && sceneSystemProfile != null; } internal set { enableSceneSystem = value; } } [SerializeField] [Tooltip("Scene System class to instantiate at runtime.")] [Implements(typeof(IMixedRealitySceneSystem), TypeGrouping.ByNamespaceFlat)] private SystemType sceneSystemType; /// /// Scene System Script File to instantiate at runtime /// public SystemType SceneSystemSystemType { get { return sceneSystemType; } internal set { sceneSystemType = value; } } [SerializeField] [Tooltip("All the additional non-required services registered with the Mixed Reality Toolkit.")] private MixedRealityRegisteredServiceProvidersProfile registeredServiceProvidersProfile = null; /// /// All the additional non-required systems, features, and managers registered with the Mixed Reality Toolkit. /// public MixedRealityRegisteredServiceProvidersProfile RegisteredServiceProvidersProfile => registeredServiceProvidersProfile; /// /// If true, MRTK will generate components that let you to view the state of running services. These objects will not be generated at runtime. /// [Obsolete("Service inspectors will be removed in an upcoming release")] public bool UseServiceInspectors { get { return useServiceInspectors; } } [Obsolete("Service inspectors will be removed in an upcoming release")] [SerializeField] [Tooltip("Deprecated: If true, MRTK will generate components that let you to view the state of running services. These objects will not be generated at runtime.")] private bool useServiceInspectors = false; /// /// If true, MRTK will render the depth buffer as color. Only valid in editor. /// public bool RenderDepthBuffer { get { return renderDepthBuffer; } } [SerializeField] [Tooltip("If true, MRTK will render the depth buffer as color. Only valid in editor.")] private bool renderDepthBuffer = false; /// /// If true, verbose logging will be enabled for MRTK components. /// public bool EnableVerboseLogging { get { return enableVerboseLogging; } set { enableVerboseLogging = value; } } [SerializeField] [Tooltip("If true, verbose logging will be enabled for MRTK components.")] private bool enableVerboseLogging = false; #endregion Mixed Reality Toolkit configurable properties } }