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

10.19 learned

parent 912976bb
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
namespace Microsoft.MixedReality.Toolkit
{
/// <summary>
/// Defines how to calculate the line's rotation at any given point.
/// </summary>
public enum LineRotationMode
{
/// <summary>
/// Don't rotate
/// </summary>
None = 0,
/// <summary>
/// Use velocity to calculate the line's rotation
/// </summary>
Velocity,
/// <summary>
/// Rotate relative to direction from origin point
/// </summary>
RelativeToOrigin,
}
}
\ No newline at end of file
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
namespace Microsoft.MixedReality.Toolkit
{
/// <summary>
/// Defines how to get an interpolated point along a line
/// </summary>
public enum PointDistributionMode
{
/// <summary>
/// Don't adjust placement
/// </summary>
None = 0,
/// <summary>
/// Adjust placement automatically (default)
/// </summary>
Auto,
/// <summary>
/// Place based on distance
/// </summary>
DistanceSingleValue,
/// <summary>
/// Place based on curve
/// </summary>
DistanceCurveValue,
}
}
\ No newline at end of file
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
namespace Microsoft.MixedReality.Toolkit
{
/// <summary>
/// Defines how to generate points in a line renderer
/// </summary>
public enum StepMode
{
/// <summary>
/// Draw points based on LineStepCount
/// </summary>
Interpolated = 0,
/// <summary>
/// Draw only the points available in the source - use this for hard edges
/// </summary>
FromSource,
}
}
\ No newline at end of file
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
using Microsoft.MixedReality.Toolkit.Utilities;
using System;
using UnityEngine;
namespace Microsoft.MixedReality.Toolkit.Input
{
[Serializable]
public struct MixedRealityInputDataProviderConfiguration : IMixedRealityServiceConfiguration
{
[SerializeField]
[Implements(typeof(IMixedRealityInputDeviceManager), TypeGrouping.ByNamespaceFlat)]
private SystemType componentType;
/// <inheritdoc />
public SystemType ComponentType => componentType;
[SerializeField]
private string componentName;
/// <inheritdoc />
public string ComponentName => componentName;
[SerializeField]
private uint priority;
/// <inheritdoc />
public uint Priority => priority;
[SerializeField]
[EnumFlags]
private SupportedPlatforms runtimePlatform;
/// <inheritdoc />
public SupportedPlatforms RuntimePlatform => runtimePlatform;
[SerializeField]
private BaseMixedRealityProfile deviceManagerProfile;
/// <inheritdoc />
public BaseMixedRealityProfile Profile => deviceManagerProfile;
/// <summary>
/// Device manager specific configuration profile.
/// </summary>
public BaseMixedRealityProfile DeviceManagerProfile => deviceManagerProfile;
/// <summary>
/// Constructor.
/// </summary>
/// <param name="componentType">The <see cref="Microsoft.MixedReality.Toolkit.Utilities.SystemType"/> of the data provider.</param>
/// <param name="componentName">The friendly name of the data provider.</param>
/// <param name="priority">The load priority of the data provider.</param>
/// <param name="runtimePlatform">The runtime platform(s) supported by the data provider.</param>
/// <param name="profile">The configuration profile for the data provider.</param>
public MixedRealityInputDataProviderConfiguration(
SystemType componentType,
string componentName,
uint priority,
SupportedPlatforms runtimePlatform,
BaseMixedRealityProfile profile)
{
this.componentType = componentType;
this.componentName = componentName;
this.priority = priority;
this.runtimePlatform = runtimePlatform;
deviceManagerProfile = profile;
}
}
}
\ 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
{
[CreateAssetMenu(menuName = "Mixed Reality Toolkit/Profiles/Mixed Reality Registered Service Providers Profile", fileName = "MixedRealityRegisteredServiceProvidersProfile", order = (int)CreateProfileMenuItemIndices.RegisteredServiceProviders)]
public class MixedRealityRegisteredServiceProvidersProfile : BaseMixedRealityProfile
{
[SerializeField]
private MixedRealityServiceConfiguration[] configurations = null;
/// <summary>
/// Currently registered system and manager configurations.
/// </summary>
public MixedRealityServiceConfiguration[] Configurations => configurations;
}
}
\ No newline at end of file
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
using Microsoft.MixedReality.Toolkit.Utilities;
using System;
using UnityEngine;
namespace Microsoft.MixedReality.Toolkit
{
/// <summary>
/// Defines a system, feature, or manager to be registered with as a <see cref="IMixedRealityExtensionService"/> on startup.
/// </summary>
[Serializable]
public struct MixedRealityServiceConfiguration : IMixedRealityServiceConfiguration
{
/// <summary>
/// Constructor.
/// </summary>
/// <param name="componentType">The concrete type for the system, feature or manager.</param>
/// <param name="componentName">The simple, human readable name for the system, feature, or manager.</param>
/// <param name="priority">The priority this system, feature, or manager will be initialized in.</param>
/// <param name="runtimePlatform">The runtime platform(s) to run this system, feature, or manager on.</param>
/// <param name="configurationProfile">The configuration profile for the service.</param>
public MixedRealityServiceConfiguration(
SystemType componentType,
string componentName,
uint priority,
SupportedPlatforms runtimePlatform,
BaseMixedRealityProfile configurationProfile)
{
this.componentType = componentType;
this.componentName = componentName;
this.priority = priority;
this.runtimePlatform = runtimePlatform;
this.configurationProfile = configurationProfile;
}
[SerializeField]
[Implements(typeof(IMixedRealityExtensionService), TypeGrouping.ByNamespaceFlat)]
private SystemType componentType;
/// <inheritdoc />
public SystemType ComponentType => componentType;
[SerializeField]
private string componentName;
/// <inheritdoc />
public string ComponentName => componentName;
[SerializeField]
private uint priority;
/// <inheritdoc />
public uint Priority => priority;
[EnumFlags]
[SerializeField]
private SupportedPlatforms runtimePlatform;
/// <inheritdoc />
public SupportedPlatforms RuntimePlatform => runtimePlatform;
[SerializeField]
private BaseMixedRealityProfile configurationProfile;
/// <inheritdoc />
public BaseMixedRealityProfile Profile => configurationProfile;
/// <summary>
/// The configuration profile for the service.
/// </summary>
[Obsolete("Use Profile property instead")]
public BaseMixedRealityProfile ConfigurationProfile => configurationProfile;
}
}
\ No newline at end of file
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
using Microsoft.MixedReality.Toolkit.Utilities;
using System;
using UnityEngine;
namespace Microsoft.MixedReality.Toolkit.SpatialAwareness
{
[Serializable]
public struct MixedRealitySpatialObserverConfiguration : IMixedRealityServiceConfiguration
{
[SerializeField]
[Implements(typeof(IMixedRealitySpatialAwarenessObserver), TypeGrouping.ByNamespaceFlat)]
private SystemType componentType;
/// <inheritdoc />
public SystemType ComponentType => componentType;
[SerializeField]
private string componentName;
/// <inheritdoc />
public string ComponentName => componentName;
[SerializeField]
private uint priority;
/// <inheritdoc />
public uint Priority => priority;
[SerializeField]
[EnumFlags]
private SupportedPlatforms runtimePlatform;
/// <inheritdoc />
public SupportedPlatforms RuntimePlatform => runtimePlatform;
[SerializeField]
private BaseSpatialAwarenessObserverProfile observerProfile;
/// <inheritdoc />
public BaseMixedRealityProfile Profile => observerProfile;
/// <summary>
/// Spatial Observer specific configuration profile.
/// </summary>
public BaseSpatialAwarenessObserverProfile ObserverProfile => observerProfile;
/// <summary>
/// Constructor.
/// </summary>
/// <param name="componentType">The <see cref="Microsoft.MixedReality.Toolkit.Utilities.SystemType"/> of the observer.</param>
/// <param name="componentName">The friendly name of the observer.</param>
/// <param name="priority">The load priority of the observer.</param>
/// <param name="runtimePlatform">The runtime platform(s) supported by the observer.</param>
/// <param name="configurationProfile">The configuration profile for the observer.</param>
public MixedRealitySpatialObserverConfiguration(
SystemType componentType,
string componentName,
uint priority,
SupportedPlatforms runtimePlatform,
BaseSpatialAwarenessObserverProfile configurationProfile)
{
this.componentType = componentType;
this.componentName = componentName;
this.priority = priority;
this.runtimePlatform = runtimePlatform;
this.observerProfile = configurationProfile;
}
}
}
// 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 System.Runtime.CompilerServices;
using UnityEngine;
using UnityEngine.Serialization;
[assembly: InternalsVisibleTo("Microsoft.MixedReality.Toolkit.Tests.EditModeTests")]
[assembly: InternalsVisibleTo("Microsoft.MixedReality.Toolkit.Tests.PlayModeTests")]
namespace Microsoft.MixedReality.Toolkit
{
/// <summary>
/// Configuration profile settings for the Mixed Reality Toolkit.
/// </summary>
[CreateAssetMenu(menuName = "Mixed Reality Toolkit/Profiles/Mixed Reality Toolkit Configuration Profile", fileName = "MixedRealityToolkitConfigurationProfile", order = (int)CreateProfileMenuItemIndices.Configuration)]
[HelpURL("https://microsoft.github.io/MixedRealityToolkit-Unity/Documentation/MixedRealityConfigurationGuide.html")]
public class MixedRealityToolkitConfigurationProfile : BaseMixedRealityProfile
{
#region Mixed Reality Toolkit configurable properties
[SerializeField]
[Tooltip("The scale of the Mixed Reality experience.")]
private ExperienceScale targetExperienceScale = ExperienceScale.Room;
/// <summary>
/// The desired the scale of the experience.
/// </summary>
public ExperienceScale TargetExperienceScale
{
get { return targetExperienceScale; }
set { targetExperienceScale = value; }
}
[SerializeField]
[FormerlySerializedAs("enableCameraProfile")]
[Tooltip("Enable the Camera System on Startup.")]
private bool enableCameraSystem = false;
/// <summary>
/// Enable and configure the Camera Profile for the Mixed Reality Toolkit
/// </summary>
public bool IsCameraSystemEnabled
{
get { return CameraProfile != null && cameraSystemType != null && cameraSystemType.Type != null && enableCameraSystem; }
internal set { enableCameraSystem = value; }
}
[SerializeField]
[Tooltip("Camera profile.")]
private MixedRealityCameraProfile cameraProfile;
/// <summary>
/// Profile for customizing your camera and quality settings based on if your
/// head mounted display (HMD) is a transparent device or an occluded device.
/// </summary>
public MixedRealityCameraProfile CameraProfile
{
get { return cameraProfile; }
internal set { cameraProfile = value; }
}
/// <summary>
/// Camera System class to instantiate at runtime.
/// </summary>
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;
/// <summary>
/// Enable and configure the Input System component for the Mixed Reality Toolkit
/// </summary>
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;
/// <summary>
/// Input System profile for configuring events and actions to input devices.
/// </summary>
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;
/// <summary>
/// Input System class to instantiate at runtime.
/// </summary>
public SystemType InputSystemType
{
get { return inputSystemType; }
internal set { inputSystemType = value; }
}
[SerializeField]
[Tooltip("Enable the Boundary on Startup")]
private bool enableBoundarySystem = false;
/// <summary>
/// Enable and configure the boundary system.
/// </summary>
public bool IsBoundarySystemEnabled
{
get { return boundarySystemType != null && boundarySystemType.Type != null && enableBoundarySystem && boundaryVisualizationProfile != null; }
internal set { enableBoundarySystem = value; }
}
[SerializeField]
[Tooltip("Boundary System class to instantiate at runtime.")]
[Implements(typeof(IMixedRealityBoundarySystem), TypeGrouping.ByNamespaceFlat)]
private SystemType boundarySystemType;
/// <summary>
/// Boundary System class to instantiate at runtime.
/// </summary>
public SystemType BoundarySystemSystemType
{
get { return boundarySystemType; }
internal set { boundarySystemType = value; }
}
[SerializeField]
[Tooltip("Profile for wiring up boundary visualization assets.")]
private MixedRealityBoundaryVisualizationProfile boundaryVisualizationProfile;
/// <summary>
/// Active profile for boundary visualization
/// </summary>
public MixedRealityBoundaryVisualizationProfile BoundaryVisualizationProfile
{
get { return boundaryVisualizationProfile; }
internal set { boundaryVisualizationProfile = value; }
}
[SerializeField]
[Tooltip("Enable the Teleport System on Startup")]
private bool enableTeleportSystem = false;
/// <summary>
/// Enable and configure the teleport system.
/// </summary>
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;
/// <summary>
/// Teleport System class to instantiate at runtime.
/// </summary>
public SystemType TeleportSystemSystemType
{
get { return teleportSystemType; }
internal set { teleportSystemType = value; }
}
[SerializeField]
[Tooltip("Enable the Spatial Awareness system on startup")]
private bool enableSpatialAwarenessSystem = false;
/// <summary>
/// Enable and configure the spatial awareness system.
/// </summary>
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;
/// <summary>
/// Spatial Awareness System class to instantiate at runtime.
/// </summary>
public SystemType SpatialAwarenessSystemSystemType
{
get { return spatialAwarenessSystemType; }
internal set { spatialAwarenessSystemType = value; }
}
[SerializeField]
[Tooltip("Profile for configuring the spatial awareness system.")]
private MixedRealitySpatialAwarenessSystemProfile spatialAwarenessSystemProfile;
/// <summary>
/// Active profile for spatial awareness system
/// </summary>
public MixedRealitySpatialAwarenessSystemProfile SpatialAwarenessSystemProfile
{
get { return spatialAwarenessSystemProfile; }
internal set { spatialAwarenessSystemProfile = value; }
}
[SerializeField]
[Tooltip("Profile for configuring diagnostic components.")]
private MixedRealityDiagnosticsProfile diagnosticsSystemProfile;
/// <summary>
/// Active profile for diagnostic configuration
/// </summary>
public MixedRealityDiagnosticsProfile DiagnosticsSystemProfile
{
get { return diagnosticsSystemProfile; }
internal set { diagnosticsSystemProfile = value; }
}
[SerializeField]
[Tooltip("Enable diagnostic system")]
private bool enableDiagnosticsSystem = false;
/// <summary>
/// Is the Diagnostics System enabled?
/// </summary>
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;
/// <summary>
/// Diagnostics System Script File to instantiate at runtime
/// </summary>
public SystemType DiagnosticsSystemSystemType
{
get { return diagnosticsSystemType; }
internal set { diagnosticsSystemType = value; }
}
[SerializeField]
[Tooltip("Profile for configuring scene system components.")]
private MixedRealitySceneSystemProfile sceneSystemProfile;
/// <summary>
/// Active profile for scene configuration
/// </summary>
public MixedRealitySceneSystemProfile SceneSystemProfile
{
get { return sceneSystemProfile; }
internal set { sceneSystemProfile = value; }
}
[SerializeField]
[Tooltip("Enable scene system")]
private bool enableSceneSystem = false;
/// <summary>
/// Is the Scene System enabled?
/// </summary>
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;
/// <summary>
/// Scene System Script File to instantiate at runtime
/// </summary>
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;
/// <summary>
/// All the additional non-required systems, features, and managers registered with the Mixed Reality Toolkit.
/// </summary>
public MixedRealityRegisteredServiceProvidersProfile RegisteredServiceProvidersProfile => registeredServiceProvidersProfile;
/// <summary>
/// If true, MRTK will generate components that let you to view the state of running services. These objects will not be generated at runtime.
/// </summary>
[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;
/// <summary>
/// If true, MRTK will render the depth buffer as color. Only valid in editor.
/// </summary>
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;
/// <summary>
/// If true, verbose logging will be enabled for MRTK components.
/// </summary>
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
}
}
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
using UnityEngine.EventSystems;
namespace Microsoft.MixedReality.Toolkit.Physics
{
public struct ComparableRaycastResult
{
public readonly int LayerMaskIndex;
public readonly RaycastResult RaycastResult;
public ComparableRaycastResult(RaycastResult raycastResult, int layerMaskIndex = 0)
{
RaycastResult = raycastResult;
LayerMaskIndex = layerMaskIndex;
}
}
}
\ No newline at end of file
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
using Microsoft.MixedReality.Toolkit.Input;
using UnityEngine;
using UnityEngine.EventSystems;
namespace Microsoft.MixedReality.Toolkit.Physics
{
/// <summary>
/// Contains information about which game object has the focus currently.
/// Also contains information about the normal of that point.
/// </summary>
public struct FocusDetails
{
/// <summary>
/// Distance along the ray until a hit, or until the end of the ray if no hit
/// </summary>
public float RayDistance { get; set; }
/// <summary>
/// The hit point of the raycast.
/// </summary>
public Vector3 Point { get; set; }
/// <summary>
/// The normal of the raycast.
/// </summary>
public Vector3 Normal { get; set; }
/// <summary>
/// The object hit by the last raycast.
/// </summary>
public GameObject Object { get; set; }
/// <summary>
/// The last raycast hit info.
/// </summary>
public MixedRealityRaycastHit LastRaycastHit { get; set; }
/// <summary>
/// The last raycast hit info for graphic raycast
/// </summary>
public RaycastResult LastGraphicsRaycastResult { get; set; }
public Vector3 PointLocalSpace { get; set; }
public Vector3 NormalLocalSpace { get; set; }
}
}
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
using System;
using UnityEngine;
namespace Microsoft.MixedReality.Toolkit.Physics
{
[Serializable]
public struct RayStep
{
// Re-use static space to avoid additional allocation
private static Vector3 dist;
private static Vector3 dir;
private static Vector3 pos;
public RayStep(Vector3 origin, Vector3 terminus) : this()
{
UpdateRayStep(ref origin, ref terminus);
epsilon = 0.01f;
}
public Vector3 Origin { get; private set; }
public Vector3 Terminus { get; private set; }
public Vector3 Direction { get; private set; }
public float Length { get; private set; }
private readonly float epsilon;
public Vector3 GetPoint(float distance)
{
if (Length <= distance || Length == 0f)
{
return Origin;
}
pos.x = Origin.x + Direction.x * distance;
pos.y = Origin.y + Direction.y * distance;
pos.z = Origin.z + Direction.z * distance;
return pos;
}
/// <summary>
/// Update current raystep with new origin and terminus points.
/// Pass by ref to avoid unnecessary struct copy into function since values will be copied anyways locally
/// </summary>
/// <param name="origin">beginning of raystep origin</param>
/// <param name="terminus">end of raystep</param>
public void UpdateRayStep(ref Vector3 origin, ref Vector3 terminus)
{
Origin = origin;
Terminus = terminus;
dist.x = Terminus.x - Origin.x;
dist.y = Terminus.y - Origin.y;
dist.z = Terminus.z - Origin.z;
Length = Mathf.Sqrt((dist.x * dist.x) + (dist.y * dist.y) + (dist.z * dist.z));
if (Length > 0)
{
dir.x = dist.x / Length;
dir.y = dist.y / Length;
dir.z = dist.z / Length;
}
else
{
dir = dist;
}
Direction = dir;
}
public void CopyRay(Ray ray, float rayLength)
{
Length = rayLength;
Origin = ray.origin;
Direction = ray.direction;
pos.x = Origin.x + Direction.x * Length;
pos.y = Origin.y + Direction.y * Length;
pos.z = Origin.z + Direction.z * Length;
Terminus = pos;
}
public bool Contains(Vector3 point)
{
dist.x = Origin.x - point.x;
dist.y = Origin.y - point.y;
dist.z = Origin.z - point.z;
float sqrMagOriginPoint = (dist.x * dist.x) + (dist.y * dist.y) + (dist.z * dist.z);
dist.x = point.x - Terminus.x;
dist.y = point.y - Terminus.y;
dist.z = point.z - Terminus.z;
float sqrMagPointTerminus = (dist.x * dist.x) + (dist.y * dist.y) + (dist.z * dist.z);
float sqrLength = Length * Length;
float sqrEpsilon = epsilon * epsilon;
return (sqrMagOriginPoint + sqrMagPointTerminus) - sqrLength > sqrEpsilon;
}
public static implicit operator Ray(RayStep r)
{
return new Ray(r.Origin, r.Direction);
}
#region static utility functions
/// <summary>
/// Returns a point along an array of RaySteps by distance
/// </summary>
public static Vector3 GetPointByDistance(RayStep[] steps, float distance)
{
Debug.Assert(steps != null);
Debug.Assert(steps.Length > 0);
float remainingDistance = 0;
RayStep rayStep = GetStepByDistance(steps, distance, ref remainingDistance);
if (remainingDistance > 0)
{
return Vector3.Lerp(rayStep.Origin, rayStep.Terminus, remainingDistance / rayStep.Length);
}
else
{
return rayStep.Terminus;
}
}
/// <summary>
/// Returns a RayStep along an array of RaySteps by distance
/// </summary>
public static RayStep GetStepByDistance(RayStep[] steps, float distance, ref float remainingDistance)
{
Debug.Assert(steps != null && steps.Length > 0);
float traveledDistance = 0;
float stepLength = 0;
RayStep currentStep = new RayStep();
foreach (var step in steps)
{
currentStep = step;
stepLength = step.Length;
if (distance > traveledDistance + stepLength)
{
traveledDistance += stepLength;
}
else
{
remainingDistance = Mathf.Clamp(distance - traveledDistance, 0f, stepLength);
return currentStep;
}
}
remainingDistance = 0;
return currentStep;
}
/// <summary>
/// Returns a direction along an array of RaySteps by distance
/// </summary>
public static Vector3 GetDirectionByDistance(RayStep[] steps, float distance)
{
Debug.Assert(steps != null);
Debug.Assert(steps.Length > 0);
float traveledDistance = 0;
return GetStepByDistance(steps, distance, ref traveledDistance).Direction;
}
#endregion
}
}
\ No newline at end of file
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
namespace Microsoft.MixedReality.Toolkit.Physics
{
/// <summary>
/// Defines the different scene query types. Mostly used by pointers.
/// </summary>
public enum SceneQueryType
{
/// <summary>
/// Use a simple raycast from a single point in a given direction.
/// </summary>
SimpleRaycast,
/// <summary>
/// Complex raycast from multiple points using a box collider.
/// </summary>
BoxRaycast,
/// <summary>
/// Use Sphere cast.
/// </summary>
SphereCast,
/// <summary>
/// Check for colliders within a specific radius.
/// </summary>
SphereOverlap
}
}
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
using System;
namespace Microsoft.MixedReality.Toolkit.Physics
{
[Serializable]
public enum TeleportSurfaceResult
{
None = 0,
Valid,
Invalid,
HotSpot,
}
}
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
namespace Microsoft.MixedReality.Toolkit.SceneSystem
{
/// <summary>
/// Used by scene service to control how to transition from one lighting scene to another.
/// </summary>
public enum LightingSceneTransitionType
{
None, // Previous lighting scene is unloaded, new lighting scene is loaded. No transition.
FadeToBlack, // Previous lighting scene fades out to black. New lighting scene is loaded, then faded up from black. Useful for smooth transitions between locations.
CrossFade, // Previous lighting scene fades out as new lighting scene fades in. Useful for smooth transitions between lighting setups in the same location. NOTE: This will not work with different skyboxes.
}
}
\ No newline at end of file
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
using Microsoft.MixedReality.Toolkit.Utilities;
using System;
using System.Collections.Generic;
using System.Linq;
#if UNITY_EDITOR
using UnityEditor;
#endif
using UnityEngine;
namespace Microsoft.MixedReality.Toolkit.SceneSystem
{
/// <summary>
/// Configuration profile settings for setting up scene system.
/// </summary>
[CreateAssetMenu(menuName = "Mixed Reality Toolkit/Profiles/Mixed Reality Scene System Profile", fileName = "MixedRealitySceneSystemProfile", order = (int)CreateProfileMenuItemIndices.SceneSystem)]
[MixedRealityServiceProfile(typeof(IMixedRealitySceneSystem))]
[HelpURL("https://microsoft.github.io/MixedRealityToolkit-Unity/Documentation/SceneSystem/SceneSystemGettingStarted.html")]
public class MixedRealitySceneSystemProfile : BaseMixedRealityProfile
{
/// <summary>
/// Internal class used to cache lighting settings associated with a scene.
/// </summary>
[Serializable]
internal sealed class CachedLightingSettings
{
public string SceneName;
public RuntimeRenderSettings RenderSettings;
public RuntimeLightingSettings LightingSettings;
public RuntimeSunlightSettings SunlightSettings;
public DateTime TimeStamp;
}
public bool UseManagerScene { get { return useManagerScene && !managerScene.IsEmpty; } }
public bool UseLightingScene { get { return useLightingScene && lightingScenes.Count > 0; } }
public SceneInfo ManagerScene => managerScene;
public SceneInfo DefaultLightingScene { get { return lightingScenes[defaultLightingSceneIndex]; } }
public IEnumerable<SceneInfo> LightingScenes { get { return lightingScenes; } }
public IEnumerable<SceneInfo> ContentScenes { get { return contentScenes; } }
public IEnumerable<string> ContentTags { get { return contentTags; } }
public int NumLightingScenes { get { return lightingScenes.Count; } }
public int NumContentScenes { get { return contentScenes.Count; } }
public IEnumerable<Type> PermittedLightingSceneComponentTypes
{
get
{
foreach (SystemType systemType in permittedLightingSceneComponentTypes) { yield return systemType.Type; }
}
}
#if UNITY_EDITOR
public bool EditorManageBuildSettings => editorManageBuildSettings;
public bool EditorManageLoadedScenes => editorManageLoadedScenes;
public bool EditorEnforceSceneOrder => editorEnforceSceneOrder;
public bool EditorEnforceLightingSceneTypes => editorEnforceLightingSceneTypes;
public bool EditorLightingCacheOutOfDate => editorLightingCacheOutOfDate;
public bool EditorLightingCacheUpdateRequested { get; set; }
#endif
[SerializeField]
private bool useManagerScene = true;
[SerializeField]
private SceneInfo managerScene = default(SceneInfo);
[SerializeField]
private bool useLightingScene = true;
[SerializeField]
private int defaultLightingSceneIndex = 0;
[SerializeField]
private List<SceneInfo> lightingScenes = new List<SceneInfo>();
[SerializeField]
private List<SceneInfo> contentScenes = new List<SceneInfo>();
[SerializeField]
private SystemType[] permittedLightingSceneComponentTypes = new SystemType[] {
new SystemType(typeof(Transform)),
new SystemType(typeof(GameObject)),
new SystemType(typeof(Light)),
new SystemType(typeof(ReflectionProbe)),
new SystemType(typeof(LightProbeGroup)),
new SystemType(typeof(LightProbeProxyVolume)),
};
// These will be hidden by the default inspector.
[SerializeField]
[Tooltip("Cached content tags found in your content scenes")]
private List<string> contentTags = new List<string>();
// These will be hidden by the default inspector.
[SerializeField]
[Tooltip("Cached lighting settings from your lighting scenes")]
private List<CachedLightingSettings> cachedLightingSettings = new List<CachedLightingSettings>();
#region editor settings
// CS414 is disabled during this section because these properties are being used in the editor
// scenario - when this file is build for player scenario, these serialized fields still exist
// but are not used.
#pragma warning disable 414
[SerializeField]
[Tooltip("If true, the service will update your build settings automatically, ensuring that all manager, lighting and content scenes are added. Disable this if you want total control over build settings.")]
private bool editorManageBuildSettings = true;
[SerializeField]
[Tooltip("If true, the service will ensure manager scene is displayed first in scene hierarchy, followed by lighting and then content. Disable this if you want total control over scene hierarchy.")]
private bool editorEnforceSceneOrder = true;
[SerializeField]
[Tooltip("If true, service will ensure that manager scenes and lighting scenes are always loaded. Disable if you want total control over which scenes are loaded in editor.")]
private bool editorManageLoadedScenes = true;
[SerializeField]
[Tooltip("If true, service will ensure that only lighting-related components are allowed in lighting scenes. Disable if you want total control over the content of lighting scenes.")]
private bool editorEnforceLightingSceneTypes = true;
[SerializeField]
private bool editorLightingCacheOutOfDate = false;
#pragma warning restore 414
#endregion
public bool GetLightingSceneSettings(
string lightingSceneName,
out SceneInfo lightingScene,
out RuntimeLightingSettings lightingSettings,
out RuntimeRenderSettings renderSettings,
out RuntimeSunlightSettings sunlightSettings)
{
lightingSettings = default(RuntimeLightingSettings);
renderSettings = default(RuntimeRenderSettings);
sunlightSettings = default(RuntimeSunlightSettings);
lightingScene = SceneInfo.Empty;
for (int i = 0; i < lightingScenes.Count; i++)
{
if (lightingScenes[i].Name == lightingSceneName)
{
lightingScene = lightingScenes[i];
break;
}
}
if (lightingScene.IsEmpty)
{ // If we didn't find a lighting scene, don't bother looking for a cache
return false;
}
bool foundCache = false;
for (int i = 0; i < cachedLightingSettings.Count; i++)
{
CachedLightingSettings cache = cachedLightingSettings[i];
if (cache.SceneName == lightingSceneName)
{
lightingSettings = cache.LightingSettings;
renderSettings = cache.RenderSettings;
sunlightSettings = cache.SunlightSettings;
foundCache = true;
break;
}
}
return foundCache;
}
public IEnumerable<string> GetContentSceneNamesByTag(string tag)
{
foreach (SceneInfo contentScene in contentScenes)
{
if (contentScene.Tag == tag)
yield return contentScene.Name;
}
}
#if UNITY_EDITOR
#region validation
private void OnValidate()
{
if (Application.isPlaying || EditorApplication.isCompiling)
{
return;
}
bool saveChanges = false;
// Remove any duplicate entries from our lighting and content scene lists
saveChanges |= (RemoveOrClearDuplicateEntries(lightingScenes) || RemoveOrClearDuplicateEntries(contentScenes));
// Ensure that manager scenes are not contained in content or lighting scenes
saveChanges |= (UseManagerScene && (RemoveScene(lightingScenes, managerScene) || RemoveScene(contentScenes, managerScene)));
// Ensure that content scenes are not included in lighting scenes
saveChanges |= (UseLightingScene && RemoveScenes(lightingScenes, contentScenes));
// Build our content tags
List<string> newContentTags = new List<string>();
foreach (SceneInfo contentScene in contentScenes)
{
if (string.IsNullOrEmpty(contentScene.Tag))
{
continue;
}
if (contentScene.Tag == "Untagged")
{
continue;
}
if (!newContentTags.Contains(contentScene.Tag))
{
newContentTags.Add(contentScene.Tag);
}
}
// See if our content tags have changed
if (!contentTags.SequenceEqual(newContentTags))
{
contentTags = newContentTags;
saveChanges = true;
}
defaultLightingSceneIndex = Mathf.Clamp(defaultLightingSceneIndex, 0, lightingScenes.Count - 1);
if (saveChanges)
{ // We need to tie this directly to lighting scenes somehow
editorLightingCacheOutOfDate = true;
// Make sure our changes are saved to disk!
AssetDatabase.Refresh();
EditorUtility.SetDirty(this);
AssetDatabase.SaveAssets();
}
}
/// <summary>
/// Clears cached lighting settings.
/// Used to ensure we don't end up with 'dead' cached data.
/// </summary>
public void ClearLightingCache()
{
cachedLightingSettings.Clear();
}
/// <summary>
/// Used to update the cached lighting / render settings.
/// Since extracting them is complex and requires scene loading, I thought it best to avoid having the profile do it.
/// </summary>
/// <param name="sceneInfo">The scene these settings belong to.</param>
public void SetLightingCache(SceneInfo sceneInfo, RuntimeLightingSettings lightingSettings, RuntimeRenderSettings renderSettings, RuntimeSunlightSettings sunlightSettings)
{
CachedLightingSettings settings = new CachedLightingSettings();
settings.SceneName = sceneInfo.Name;
settings.LightingSettings = lightingSettings;
settings.RenderSettings = renderSettings;
settings.SunlightSettings = sunlightSettings;
settings.TimeStamp = DateTime.Now;
cachedLightingSettings.Add(settings);
editorLightingCacheOutOfDate = false;
}
/// <summary>
/// Sets editorLightingCacheOutOfDate to true and saves the profile.
/// </summary>
public void SetLightingCacheDirty()
{
editorLightingCacheOutOfDate = true;
AssetDatabase.Refresh();
EditorUtility.SetDirty(this);
AssetDatabase.SaveAssets();
}
public DateTime GetEarliestLightingCacheTimestamp()
{
if (cachedLightingSettings.Count <= 0)
{
return DateTime.MinValue;
}
DateTime earliestTimeStamp = DateTime.MaxValue;
foreach (CachedLightingSettings settings in cachedLightingSettings)
{
if (settings.TimeStamp < earliestTimeStamp)
{
earliestTimeStamp = settings.TimeStamp;
}
}
return earliestTimeStamp;
}
private static bool RemoveScenes(List<SceneInfo> sceneList, List<SceneInfo> scenesToRemove)
{
bool changed = false;
for (int i = sceneList.Count - 1; i >= 0; i--)
{
if (sceneList[i].IsEmpty)
{
continue;
}
foreach (SceneInfo sceneToRemove in scenesToRemove)
{
if (sceneToRemove.IsEmpty)
{
continue;
}
if (sceneList[i].Asset == sceneToRemove.Asset)
{
Debug.LogWarning("Removing scene " + sceneToRemove.Name + " from scene list.");
sceneList[i] = SceneInfo.Empty;
changed = true;
break;
}
}
}
return changed;
}
private static bool RemoveScene(List<SceneInfo> sceneList, SceneInfo sceneToRemove)
{
bool changed = false;
for (int i = sceneList.Count - 1; i >= 0; i--)
{
if (sceneList[i].IsEmpty)
{
continue;
}
if (sceneList[i].Asset == sceneToRemove.Asset)
{
Debug.LogWarning("Removing manager scene " + sceneToRemove.Name + " from scene list.");
sceneList[i] = SceneInfo.Empty;
changed = true;
}
}
return changed;
}
private static bool RemoveOrClearDuplicateEntries(List<SceneInfo> sceneList)
{
HashSet<string> scenePaths = new HashSet<string>();
bool changed = false;
for (int i = 0; i < sceneList.Count; i++)
{
if (sceneList[i].IsEmpty)
{
continue;
}
if (!scenePaths.Add(sceneList[i].Path))
{ // If we encounter a duplicate, just set it to empty.
// This will ensure we don't get duplicates when we add new elements to the array.
Debug.LogWarning("Found duplicate entry in scene list at " + i + ", removing");
sceneList[i] = SceneInfo.Empty;
changed = true;
}
}
return changed;
}
#endregion
#endif
}
}
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
using System;
using UnityEngine;
namespace Microsoft.MixedReality.Toolkit.SceneSystem
{
/// <summary>
/// A struct that mimics the lighting settings stored in a scene.
/// Used to store, retrieve and interpolate lighting settings.
/// Omits any editor-only settings.
/// </summary>
[Serializable]
public struct RuntimeLightingSettings
{
public float BounceScale;
public float IndirectOutputScale;
public float AlbedoBoost;
public MixedLightingMode EnvironmentLightingMode;
public bool EnableBakedLightmaps;
public bool EnabledRealtimeLightmaps;
/// <summary>
/// Lerps between two settings
/// </summary>
/// <param name="t">Value from 0 to 1</param>
public static RuntimeLightingSettings Lerp(RuntimeLightingSettings from, RuntimeLightingSettings to, float t)
{
bool notStarted = t <= 0;
to.AlbedoBoost = Mathf.Lerp(from.AlbedoBoost, to.AlbedoBoost, t);
to.BounceScale = Mathf.Lerp(from.BounceScale, to.BounceScale, t);
to.EnableBakedLightmaps = notStarted ? from.EnableBakedLightmaps : to.EnableBakedLightmaps;
to.EnabledRealtimeLightmaps = notStarted ? from.EnabledRealtimeLightmaps : to.EnabledRealtimeLightmaps;
to.EnvironmentLightingMode = notStarted ? from.EnvironmentLightingMode : to.EnvironmentLightingMode;
to.IndirectOutputScale = Mathf.Lerp(from.IndirectOutputScale, to.IndirectOutputScale, t);
return to;
}
/// <summary>
/// Sets continuous settings to 'black' without changing any discrete features.
/// </summary>
public static RuntimeLightingSettings Black(RuntimeLightingSettings source)
{
source.AlbedoBoost = 0;
source.BounceScale = 0;
source.IndirectOutputScale = 0;
return source;
}
}
}
\ No newline at end of file
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
using System;
using UnityEngine;
using UnityEngine.Rendering;
namespace Microsoft.MixedReality.Toolkit.SceneSystem
{
/// <summary>
/// A struct that mimics the render settings stored in a scene.
/// Used to store, retrieve and interpolate render settings.
/// Omits any editor-only settings, as well as some settings that are seldom used.
/// </summary>
[Serializable]
public struct RuntimeRenderSettings
{
public bool Fog;
public Color FogColor;
public FogMode FogMode;
public float FogDensity;
public float LinearFogStart;
public float LinearFogEnd;
public Color AmbientSkyColor;
public Color AmbientEquatorColor;
public Color AmbientGroundColor;
public Color AmbientLight;
public float AmbientIntensity;
public int AmbientMode;
public Color SubtractiveShadowColor;
public Material SkyboxMaterial;
public DefaultReflectionMode DefaultReflectionMode;
public int DefaultReflectionResolution;
public int ReflectionBounces;
public float ReflectionIntensity;
public Cubemap CustomReflection;
public bool UseRadianceAmbientProbe;
/// <summary>
/// Lerps between two settings
/// </summary>
/// <param name="t">Value from 0 to 1</param>
public static RuntimeRenderSettings Lerp(RuntimeRenderSettings from, RuntimeRenderSettings to, float t)
{
bool notStarted = t <= 0;
to.AmbientEquatorColor = Color.Lerp(from.AmbientEquatorColor, to.AmbientEquatorColor, t);
to.AmbientGroundColor = Color.Lerp(from.AmbientGroundColor, to.AmbientGroundColor, t);
to.AmbientIntensity = Mathf.Lerp(from.AmbientIntensity, to.AmbientIntensity, t);
to.AmbientLight = Color.Lerp(from.AmbientLight, to.AmbientLight, t);
to.AmbientMode = notStarted ? from.AmbientMode : to.AmbientMode;
to.AmbientSkyColor = Color.Lerp(from.AmbientSkyColor, to.AmbientSkyColor, t);
to.CustomReflection = notStarted ? from.CustomReflection : to.CustomReflection;
to.DefaultReflectionMode = notStarted ? from.DefaultReflectionMode : to.DefaultReflectionMode;
to.DefaultReflectionResolution = notStarted ? from.DefaultReflectionResolution : to.DefaultReflectionResolution;
to.Fog = notStarted ? from.Fog : to.Fog;
to.FogColor = Color.Lerp(from.FogColor, to.FogColor, t);
to.FogDensity = Mathf.Lerp(from.FogDensity, to.FogDensity, t);
to.FogMode = notStarted ? from.FogMode : to.FogMode;
to.LinearFogEnd = Mathf.Lerp(from.LinearFogEnd, to.LinearFogEnd, t);
to.LinearFogStart = Mathf.Lerp(from.LinearFogStart, to.LinearFogStart, t);
to.ReflectionBounces = notStarted ? from.ReflectionBounces : to.ReflectionBounces;
to.ReflectionIntensity = Mathf.Lerp(from.ReflectionIntensity, to.ReflectionIntensity, t);
to.SkyboxMaterial = notStarted ? from.SkyboxMaterial : to.SkyboxMaterial;
to.SubtractiveShadowColor = Color.Lerp(from.SubtractiveShadowColor, to.SubtractiveShadowColor, t);
to.UseRadianceAmbientProbe = notStarted ? from.UseRadianceAmbientProbe : to.UseRadianceAmbientProbe;
return to;
}
/// <summary>
/// Sets continuous settings to 'black' without changing any discrete features.
/// </summary>
public static RuntimeRenderSettings Black(RuntimeRenderSettings source)
{
source.AmbientEquatorColor = Color.clear;
source.AmbientGroundColor = Color.clear;
source.AmbientIntensity = 0;
source.AmbientLight = Color.clear;
source.AmbientSkyColor = Color.clear;
source.FogColor = Color.clear;
source.FogDensity = 0;
source.LinearFogEnd = 0;
source.LinearFogStart = 0;
source.ReflectionIntensity = 0;
source.SubtractiveShadowColor = Color.clear;
return source;
}
}
}
\ No newline at end of file
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
using System;
using UnityEngine;
namespace Microsoft.MixedReality.Toolkit.SceneSystem
{
/// <summary>
/// Struct for storing directional sunlight settings stored in a scene.
/// </summary>
[Serializable]
public struct RuntimeSunlightSettings
{
public bool UseSunlight;
public Color Color;
public float Intensity;
public float XRotation;
public float YRotation;
public float ZRotation;
/// <summary>
/// Lerps between two settings
/// </summary>
/// <param name="t">Value from 0 to 1</param>
public static RuntimeSunlightSettings Lerp(RuntimeSunlightSettings from, RuntimeSunlightSettings to, float t)
{
bool notStarted = t <= 0;
to.Color = Color.Lerp(from.Color, to.Color, t);
to.Intensity = Mathf.Lerp(from.Intensity, to.Intensity, t);
to.XRotation = Mathf.Lerp(from.XRotation, to.XRotation, t);
to.YRotation = Mathf.Lerp(from.YRotation, to.YRotation, t);
to.ZRotation = Mathf.Lerp(from.ZRotation, to.ZRotation, t);
to.UseSunlight = notStarted ? from.UseSunlight : to.UseSunlight;
return to;
}
/// <summary>
/// Sets continuous settings to 'black' without changing any discrete features.
/// </summary>
public static RuntimeSunlightSettings Black(RuntimeSunlightSettings source)
{
source.Color = Color.clear;
source.Intensity = 0;
return source;
}
}
}
\ No newline at end of file
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
using System;
namespace Microsoft.MixedReality.Toolkit.SceneSystem
{
/// <summary>
/// Used by scene system to control when newly loaded scenes are activated.
/// </summary>
public class SceneActivationToken
{
/// <summary>
/// When true, the operation is waiting on AllowSceneActivation to be set to true before proceeding.
/// </summary>
public bool ReadyToProceed { get; private set; } = false;
/// <summary>
/// Setting this to true grants permission for scene operation to activate loaded scenes.
/// </summary>
public bool AllowSceneActivation { get; set; } = false;
/// <summary>
/// Sets ReadyToProceed value
/// </summary>
public void SetReadyToProceed(bool readyToProceed)
{
ReadyToProceed = readyToProceed;
}
}
}
\ No newline at end of file
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
using System;
namespace Microsoft.MixedReality.Toolkit.SceneSystem
{
[Serializable]
public struct SceneInfo
{
public static SceneInfo Empty { get { return empty; } }
private static SceneInfo empty = default(SceneInfo);
/// <summary>
/// Scene asset is not set.
/// </summary>
public bool IsEmpty
{
get
{
return Asset == null;
}
}
/// <summary>
/// Returns true if the asset is not null and if the scene has a valid build index. Doesn't respect whether scene is enabled in build settings.
/// </summary>
public bool IsInBuildSettings
{
get
{
return Asset != null && Included;
}
}
public bool IsEnabled
{
get
{
return IsInBuildSettings & BuildIndex >= 0;
}
}
/// <summary>
/// Name of the scene. Set by the property drawer.
/// </summary>
public string Name;
/// <summary>
/// Path of the scene. Set by the property drawer.
/// </summary>
public string Path;
/// <summary>
/// True if scene is included in build (NOT necessarily enabled)
/// </summary>
public bool Included;
/// <summary>
/// Build index of the scene. If included in build settings and enabled, this will be a value greater than zero.
/// If not included or disabled, this will be -1
/// </summary>
public int BuildIndex;
/// <summary>
/// Optional tag used to load and unload scenes in groups.
/// </summary>
#if UNITY_EDITOR
[TagProperty]
#endif
public string Tag;
#if UNITY_EDITOR
[SceneAssetReference]
#endif
/// <summary>
/// SceneAsset reference. Since SceneAsset is an editor-only asset, we store an object reference instead.
/// </summary>
public UnityEngine.Object Asset;
}
}
\ 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