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 System.Collections.Generic;
namespace Microsoft.MixedReality.Toolkit.Utilities.Editor.Search
{
/// <summary>
/// Struct for pairing profiles with a set of search results
/// </summary>
public class ProfileSearchResult
{
public int ProfileMatchStrength;
public bool IsCustomProfile;
public UnityEngine.Object Profile;
public List<FieldSearchResult> Fields = new List<FieldSearchResult>();
}
}
\ No newline at end of file
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
using System.Collections.Generic;
namespace Microsoft.MixedReality.Toolkit.Utilities.Editor.Search
{
/// <summary>
/// Struct for configuring a search.
/// </summary>
public struct SearchConfig
{
public string SearchFieldString;
public bool RequireAllKeywords;
public bool SearchTooltips;
public bool SearchFieldContent;
public HashSet<string> Keywords;
}
}
\ No newline at end of file
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
using UnityEditor;
using UnityEngine;
namespace Microsoft.MixedReality.Toolkit.Editor
{
/// <summary>
/// A custom shader inspector for the "Mixed Reality Toolkit/TextShader3D".
/// </summary>
public class Text3DShaderGUI : ShaderGUI
{
protected bool firstTimeApply = true;
protected MaterialProperty cullMode;
public override void OnGUI(MaterialEditor matEditor, MaterialProperty[] props)
{
// Make sure that needed setup (i.e. keywords/renderqueue) are set up if we're switching from an existing material.
// Do this before any GUI code has been issued to prevent layout issues in subsequent GUILayout statements (case 780071)
if (firstTimeApply)
{
firstTimeApply = false;
}
EditorGUIUtility.labelWidth = 0f;
EditorGUI.BeginChangeCheck();
{
base.OnGUI(matEditor, props);
}
}
protected static class Styles
{
public static GUIContent cullMode = new GUIContent("Culling Mode", "Type of culling to apply to polygons - typically this is set to backfacing");
}
}
}
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
using UnityEngine;
namespace Microsoft.MixedReality.Toolkit.Audio
{
/// <summary>
/// Interface that should be implemented by any class that wishes to influence how an audio source sounds.
/// </summary>
public interface IAudioInfluencer
{
/// <summary>
/// Applies an audio effect.
/// </summary>
/// <param name="soundEmittingObject">The GameObject on which the effect is to be applied.</param>
void ApplyEffect(GameObject soundEmittingObject);
/// <summary>
/// Removes a previously applied audio effect.
/// </summary>
/// <param name="soundEmittingObject">The GameObject from which the effect is to be removed.</param>
void RemoveEffect(GameObject soundEmittingObject);
}
}
\ No newline at end of file
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
using UnityEngine.EventSystems;
namespace Microsoft.MixedReality.Toolkit.Boundary
{
public interface IMixedRealityBoundaryHandler : IEventSystemHandler
{
/// <summary>
/// Raised when the boundary visualization has changed.
/// </summary>
void OnBoundaryVisualizationChanged(BoundaryEventData eventData);
}
}
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
using Microsoft.MixedReality.Toolkit.Utilities;
using UnityEngine;
namespace Microsoft.MixedReality.Toolkit.Boundary
{
/// <summary>
/// Manager interface for a Boundary system in the Mixed Reality Toolkit
/// All replacement systems for providing Boundary functionality should derive from this interface
/// </summary>
public interface IMixedRealityBoundarySystem : IMixedRealityEventSystem, IMixedRealityEventSource
{
/// <summary>
/// Typed representation of the ConfigurationProfile property.
/// </summary>
MixedRealityBoundaryVisualizationProfile BoundaryVisualizationProfile { get; }
/// <summary>
/// The scale (ex: World Scale) of the experience.
/// </summary>
ExperienceScale Scale { get; set; }
/// <summary>
/// The height of the play space, in meters.
/// </summary>
/// <remarks>
/// This is used to create a three dimensional boundary volume.
/// </remarks>
float BoundaryHeight { get; set; }
/// <summary>
/// Enable / disable floor rendering.
/// </summary>
bool ShowFloor { get; set; }
/// <summary>
/// The physics layer that the generated floor is assigned to.
/// </summary>
int FloorPhysicsLayer { get; set; }
/// <summary>
/// Enable / disable play area rendering.
/// </summary>
bool ShowPlayArea { get; set; }
/// <summary>
/// The physics layer that the generated play area is assigned to.
/// </summary>
int PlayAreaPhysicsLayer { get; set; }
/// <summary>
/// Enable / disable tracked area rendering.
/// </summary>
bool ShowTrackedArea { get; set; }
/// <summary>
/// The physics layer that the generated tracked area is assigned to.
/// </summary>
int TrackedAreaPhysicsLayer { get; set; }
/// <summary>
/// Enable / disable boundary wall rendering.
/// </summary>
bool ShowBoundaryWalls { get; set; }
/// <summary>
/// The physics layer that the generated boundary walls are assigned to.
/// </summary>
int BoundaryWallsPhysicsLayer { get; set; }
/// <summary>
/// Enable / disable ceiling rendering.
/// </summary>
/// <remarks>
/// The ceiling is defined as a <see href="https://docs.unity3d.com/ScriptReference/GameObject.html">GameObject</see> positioned <see cref="BoundaryHeight"/> above the floor.
/// </remarks>
bool ShowBoundaryCeiling { get; set; }
/// <summary>
/// The physics layer that the generated boundary ceiling is assigned to.
/// </summary>
int CeilingPhysicsLayer { get; set; }
/// <summary>
/// Two dimensional representation of the geometry of the boundary, as provided
/// by the platform.
/// </summary>
/// <remarks>
/// BoundaryGeometry should be treated as the outline of the player's space, placed
/// on the floor.
/// </remarks>
Edge[] Bounds { get; }
/// <summary>
/// Indicates the height of the floor, in relation to the coordinate system origin.
/// </summary>
/// <remarks>
/// If a floor has been located, FloorHeight.HasValue will be true, otherwise it will be false.
/// </remarks>
float? FloorHeight { get; }
/// <summary>
/// Determines if a location is within the specified area of the boundary space.
/// </summary>
/// <param name="location">The location to be checked.</param>
/// <param name="boundaryType">The type of boundary space being checked.</param>
/// <returns>True if the location is within the specified area of the boundary space.</returns>
/// <remarks>
/// Use:
/// BoundaryType.PlayArea for the inscribed volume
/// BoundaryType.TrackedArea for the area defined by the boundary edges.
/// </remarks>
bool Contains(Vector3 location, BoundaryType boundaryType = BoundaryType.TrackedArea);
/// <summary>
/// Returns the description of the inscribed rectangular bounds.
/// </summary>
/// <param name="center">The center of the rectangle.</param>
/// <param name="angle">The orientation of the rectangle.</param>
/// <param name="width">The width of the rectangle.</param>
/// <param name="height">The height of the rectangle.</param>
/// <returns>True if an inscribed rectangle was found in the boundary geometry, false otherwise.</returns>
bool TryGetRectangularBoundsParams(out Vector2 center, out float angle, out float width, out float height);
/// <summary>
/// Gets the <see href="https://docs.unity3d.com/ScriptReference/GameObject.html">GameObject</see> that represents the user's floor.
/// </summary>
/// <returns>The floor visualization object or null if one does not exist.</returns>
GameObject GetFloorVisualization();
/// <summary>
/// Gets the <see href="https://docs.unity3d.com/ScriptReference/GameObject.html">GameObject</see> that represents the user's play area.
/// </summary>
/// <returns>The play area visualization object or null if one does not exist.</returns>
GameObject GetPlayAreaVisualization();
/// <summary>
/// Gets the <see href="https://docs.unity3d.com/ScriptReference/GameObject.html">GameObject</see> that represents the user's tracked area.
/// </summary>
/// <returns>The tracked area visualization object or null if one does not exist.</returns>
GameObject GetTrackedAreaVisualization();
/// <summary>
/// Gets the <see href="https://docs.unity3d.com/ScriptReference/GameObject.html">GameObject</see> that represents the user's boundary walls.
/// </summary>
/// <returns>The boundary wall visualization object or null if one does not exist.</returns>
GameObject GetBoundaryWallVisualization();
/// <summary>
/// Gets the <see href="https://docs.unity3d.com/ScriptReference/GameObject.html">GameObject</see> that represents the upper surface of the user's boundary.
/// </summary>
/// <returns>The boundary ceiling visualization object or null if one does not exist.</returns>
GameObject GetBoundaryCeilingVisualization();
}
}
\ No newline at end of file
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
namespace Microsoft.MixedReality.Toolkit.CameraSystem
{
/// <summary>
/// Interface defining the a camera system settings provider.
/// </summary>
public interface IMixedRealityCameraSettingsProvider : IMixedRealityDataProvider
{
/// <summary>
/// Returns whether or not the current display rendering mode is opaque.
/// </summary>
bool IsOpaque { get; }
/// <summary>
/// Applies provider specific configuration settings.
/// </summary>
void ApplyConfiguration();
}
}
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
namespace Microsoft.MixedReality.Toolkit.CameraSystem
{
/// <summary>
/// Manager interface for a camera system in the Mixed Reality Toolkit.
/// The camera system is expected to manage settings on the main camera.
/// It should update the camera's clear settings, render mask, etc based on platform.
/// </summary>
public interface IMixedRealityCameraSystem : IMixedRealityEventSystem, IMixedRealityEventSource, IMixedRealityService
{
/// <summary>
/// Typed representation of the ConfigurationProfile property.
/// </summary>
MixedRealityCameraProfile CameraProfile { get; }
/// <summary>
/// Is the current camera displaying on an opaque (VR / immersive) or a transparent (AR) device
/// </summary>
bool IsOpaque { get; }
}
}
\ 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.Input
{
/// <summary>
/// Mixed Reality Toolkit controller definition, used to manage a specific controller type
/// </summary>
public interface IMixedRealityController
{
/// <summary>
/// Is the controller enabled?
/// </summary>
bool Enabled { get; set; }
/// <summary>
/// Outputs the current state of the Input Source, whether it is tracked or not. As defined by the SDK / Unity.
/// </summary>
TrackingState TrackingState { get; }
/// <summary>
/// The designated hand that the Input Source is managing, as defined by the SDK / Unity.
/// </summary>
Handedness ControllerHandedness { get; }
/// <summary>
/// The registered Input Source for this controller
/// </summary>
IMixedRealityInputSource InputSource { get; }
/// <summary>
/// The controller's "Visual" <see href="https://docs.unity3d.com/ScriptReference/Component.html">Component</see> in the scene.
/// </summary>
IMixedRealityControllerVisualizer Visualizer { get; }
/// <summary>
/// Indicates that this controller is currently providing position data.
/// </summary>
/// <remarks>
/// This value may change during usage for some controllers. As a best practice,
/// be sure to check this value before using position data.
/// </remarks>
bool IsPositionAvailable { get; }
/// <summary>
/// Indicates the accuracy of the position data being reported.
/// </summary>
bool IsPositionApproximate { get; }
/// <summary>
/// Indicates that this controller is currently providing rotation data.
/// </summary>
/// <remarks>
/// This value may change during usage for some controllers. As a best practice,
/// be sure to check this value before using rotation data.
/// </remarks>
bool IsRotationAvailable { get; }
/// <summary>
/// Mapping definition for this controller, linking the Physical inputs to logical Input System Actions
/// </summary>
MixedRealityInteractionMapping[] Interactions { get; }
Vector3 AngularVelocity { get; }
Vector3 Velocity { get; }
/// <summary>
/// Some controllers such as articulated should only be able
/// to invoke pointing/distant interactions in certain poses.
/// </summary>
bool IsInPointingPose { get; }
}
}
\ 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.Input
{
/// <summary>
/// Basic interface for synchronizing to a controller pose.
/// </summary>
public interface IMixedRealityControllerPoseSynchronizer : IMixedRealitySourcePoseHandler,
IMixedRealityInputHandler,
IMixedRealityInputHandler<float>,
IMixedRealityInputHandler<Vector2>,
IMixedRealityInputHandler<Vector3>,
IMixedRealityInputHandler<Quaternion>,
IMixedRealityInputHandler<MixedRealityPose>
{
/// <summary>
/// The controller handedness this component is synchronized with.
/// </summary>
Handedness Handedness { get; }
/// <summary>
/// Should this <see href="https://docs.unity3d.com/ScriptReference/GameObject.html">GameObject</see> clean itself up when its controller is lost?
/// </summary>
/// <remarks>It's up to the implementation to properly destroy the <see href="https://docs.unity3d.com/ScriptReference/GameObject.html">GameObject</see>'s this interface will implement.</remarks>
bool DestroyOnSourceLost { get; set; }
/// <summary>
/// The current controller reference.
/// </summary>
IMixedRealityController Controller { get; set; }
/// <summary>
/// Should the Transform's position be driven from the source pose or from input handler?
/// </summary>
bool UseSourcePoseData { get; set; }
/// <summary>
/// The input action that will drive the Transform's pose, position, or rotation.
/// </summary>
MixedRealityInputAction PoseAction { get; set; }
}
}
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
using UnityEngine;
namespace Microsoft.MixedReality.Toolkit.Input
{
public interface IMixedRealityControllerVisualizer
{
/// <summary>
/// The <see href="https://docs.unity3d.com/ScriptReference/GameObject.html">GameObject</see> reference for this controller.
/// </summary>
/// <remarks>
/// This reference may not always be available when called.
/// </remarks>
GameObject GameObjectProxy { get; }
/// <summary>
/// The current controller reference.
/// </summary>
IMixedRealityController Controller { get; set; }
// TODO add defined elements or transforms?
}
}
\ No newline at end of file
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
using System.Threading.Tasks;
using UnityEngine;
namespace Microsoft.MixedReality.Toolkit.Input
{
/// <summary>
/// Mixed Reality Toolkit controller definition, used to manage a specific controller type
/// </summary>
public interface IMixedRealityDictationSystem : IMixedRealityInputDeviceManager
{
/// <summary>
/// Is the system currently listing for dictation input?
/// </summary>
bool IsListening { get; }
/// <summary>
/// Turns on the dictation recognizer and begins recording audio from the default microphone.
/// </summary>
/// <param name="listener">GameObject listening for the dictation input.</param>
/// <param name="initialSilenceTimeout">The time length in seconds before dictation recognizer session ends due to lack of audio input in case there was no audio heard in the current session.</param>
/// <param name="autoSilenceTimeout">The time length in seconds before dictation recognizer session ends due to lack of audio input.</param>
/// <param name="recordingTime">Length in seconds for the manager to listen.</param>
/// <param name="micDeviceName">Optional: The microphone device to listen to.</param>
void StartRecording(GameObject listener, float initialSilenceTimeout = 5f, float autoSilenceTimeout = 20f, int recordingTime = 10, string micDeviceName = "");
/// <summary>
/// Turns on the dictation recognizer and begins recording audio from the default microphone.
/// </summary>
/// <param name="listener">GameObject listening for the dictation input.</param>
/// <param name="initialSilenceTimeout">The time length in seconds before dictation recognizer session ends due to lack of audio input in case there was no audio heard in the current session.</param>
/// <param name="autoSilenceTimeout">The time length in seconds before dictation recognizer session ends due to lack of audio input.</param>
/// <param name="recordingTime">Length in seconds for the manager to listen.</param>
/// <param name="micDeviceName">Optional: The microphone device to listen to.</param>
Task StartRecordingAsync(GameObject listener, float initialSilenceTimeout = 5f, float autoSilenceTimeout = 20f, int recordingTime = 10, string micDeviceName = "");
/// <summary>
/// Ends the recording session.
/// </summary>
void StopRecording();
/// <summary>
/// Ends the recording session.
/// </summary>
/// <returns><see href="https://docs.unity3d.com/ScriptReference/AudioClip.html">AudioClip</see> of the last recording session.</returns>
Task<AudioClip> StopRecordingAsync();
/// <summary>
/// Get the audio clip associated with the current session.
/// </summary>
AudioClip AudioClip { get; }
}
}
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
using Microsoft.MixedReality.Toolkit.Utilities;
namespace Microsoft.MixedReality.Toolkit.Input
{
/// <summary>
/// Hand definition, used to provide access to hand joints and other data.
/// </summary>
public interface IMixedRealityHand : IMixedRealityController
{
/// <summary>
/// Get the current pose of a hand joint.
/// </summary>
/// <remarks>
/// Hand bones should be oriented along the Z-axis, with the Y-axis indicating the "up" direction,
/// i.e. joints rotate primarily around the X-axis.
/// </remarks>
bool TryGetJoint(TrackedHandJoint joint, out MixedRealityPose pose);
}
}
\ 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.Input
{
/// <summary>
/// Mixed Reality Toolkit device definition, used to instantiate and manage a specific device / SDK
/// </summary>
public interface IMixedRealityHandJointService : IMixedRealityInputDeviceManager
{
/// <summary>
/// Get a game object following the hand joint.
/// </summary>
Transform RequestJointTransform(TrackedHandJoint joint, Handedness handedness);
bool IsHandTracked(Handedness handedness);
}
}
\ No newline at end of file
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
using Microsoft.MixedReality.Toolkit.Utilities;
using Microsoft.MixedReality.Toolkit.Input;
using UnityEngine;
using System;
namespace Microsoft.MixedReality.Toolkit.Input
{
/// <summary>
/// Hand visualization definition, used to provide access to hand joint objects.
/// </summary>
public interface IMixedRealityHandVisualizer : IMixedRealityControllerVisualizer
{
/// <summary>
/// Get a game object following the hand joint.
/// </summary>
[Obsolete("Use HandJointUtils.TryGetJointPose instead of this")]
bool TryGetJointTransform(TrackedHandJoint joint, out Transform jointTransform);
}
}
\ No newline at end of file
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
namespace Microsoft.MixedReality.Toolkit.Input
{
/// <summary>
/// Mixed Reality Toolkit input device definition, used to instantiate and manage one or more input devices
/// </summary>
public interface IMixedRealityInputDeviceManager : IMixedRealityDataProvider
{
/// <summary>
/// Retrieve all controllers currently registered with this device at runtime (if direct access is required)
/// </summary>
IMixedRealityController[] GetActiveControllers();
}
}
\ No newline at end of file
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
namespace Microsoft.MixedReality.Toolkit.Input
{
/// <summary>
/// Mixed Reality Toolkit controller definition, used to manage a specific controller type
/// </summary>
public interface IMixedRealitySpeechSystem : IMixedRealityInputDeviceManager
{
/// <summary>
/// Query whether or not the speech system is active
/// </summary>
bool IsRecognitionActive { get; }
/// <summary>
/// Make sure the keyword recognizer is on, then stop it.
/// Otherwise, leave it alone because it's already in the desired state.
/// </summary>
void StartRecognition();
/// <summary>
/// Make sure the keyword recognizer is on, then stop it.
/// Otherwise, leave it alone because it's already in the desired state.
/// </summary>
void StopRecognition();
}
}
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
using UnityEngine.EventSystems;
namespace Microsoft.MixedReality.Toolkit.Diagnostics
{
public interface IMixedRealityDiagnosticsHandler : IEventSystemHandler
{
void OnDiagnosticSettingsChanged(DiagnosticsEventData eventData);
}
}
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
namespace Microsoft.MixedReality.Toolkit.Diagnostics
{
/// <summary>
/// The interface contract that defines the Diagnostics system in the Mixed Reality Toolkit
/// </summary>
public interface IMixedRealityDiagnosticsSystem : IMixedRealityEventSystem, IMixedRealityEventSource
{
/// <summary>
/// Typed representation of the ConfigurationProfile property.
/// </summary>
MixedRealityDiagnosticsProfile DiagnosticsSystemProfile { get; }
/// <summary>
/// Enable / disable diagnostic display.
/// </summary>
/// <remarks>
/// When set to true, visibility settings for individual diagnostics are honored. When set to false,
/// all visualizations are hidden.
/// </remarks>
bool ShowDiagnostics { get; set; }
/// <summary>
/// Enable / disable the profiler display.
/// </summary>
bool ShowProfiler { get; set; }
/// <summary>
/// Show or hide the frame info (per frame stats).
/// </summary>
bool ShowFrameInfo { get; set; }
/// <summary>
/// Show or hide the memory stats (used, peak, and limit).
/// </summary>
bool ShowMemoryStats { get; set; }
/// <summary>
/// The amount of time, in seconds, to collect frames for frame rate calculation.
/// </summary>
float FrameSampleRate { get; }
}
}
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
using UnityEngine.EventSystems;
namespace Microsoft.MixedReality.Toolkit
{
/// <summary>
/// Interface to implement generic events.
/// </summary>
public interface IMixedRealityEventHandler : IEventSystemHandler
{
void OnEventRaised(GenericBaseEventData eventData);
}
}
\ 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