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;
namespace Microsoft.MixedReality.Toolkit
{
/// <summary>
/// Interface to implement an event source.
/// </summary>
public interface IMixedRealityEventSource : IEqualityComparer
{
/// <summary>
/// The unique source id of this event source.
/// </summary>
uint SourceId { get; }
/// <summary>
/// The name of this event source.
/// </summary>
string SourceName { get; }
}
}
\ No newline at end of file
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
using System;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.EventSystems;
namespace Microsoft.MixedReality.Toolkit
{
/// <summary>
/// Interface used to implement an Event System that is compatible with the Mixed Reality Toolkit.
/// </summary>
public interface IMixedRealityEventSystem : IMixedRealityService
{
/// <summary>
/// List of event listeners that are registered to this Event System.
/// </summary>
/// <remarks>
/// This collection is obsolete and is replaced by handler-based internal storage. It will be removed in a future release.
/// </remarks>
List<GameObject> EventListeners { get; }
/// <summary>
/// The main function for handling and forwarding all events to their intended recipients.
/// </summary>
/// <remarks>See: https://docs.unity3d.com/Manual/MessagingSystem.html </remarks>
/// <typeparam name="T">Event Handler Interface Type</typeparam>
/// <param name="eventData">Event Data</param>
/// <param name="eventHandler">Event Handler delegate</param>
void HandleEvent<T>(BaseEventData eventData, ExecuteEvents.EventFunction<T> eventHandler) where T : IEventSystemHandler;
/// <summary>
/// Registers a <see href="https://docs.unity3d.com/ScriptReference/GameObject.html">GameObject</see> to listen for events from this Event System.
/// </summary>
/// <param name="listener"><see href="https://docs.unity3d.com/ScriptReference/GameObject.html">GameObject</see> to add to <see cref="EventListeners"/>.</param>
[Obsolete("Register using a game object causes all components of this object to receive global events of all types. " +
"Use RegisterHandler<> methods instead to avoid unexpected behavior.")]
void Register(GameObject listener);
/// <summary>
/// Unregisters a <see href="https://docs.unity3d.com/ScriptReference/GameObject.html">GameObject</see> from listening for events from this Event System.
/// </summary>
/// <param name="listener"><see href="https://docs.unity3d.com/ScriptReference/GameObject.html">GameObject</see> to remove from <see cref="EventListeners"/>.</param>
[Obsolete("Unregister using a game object will disable listening of global events for all components of this object. " +
"Use UnregisterHandler<> methods instead to avoid unexpected behavior.")]
void Unregister(GameObject listener);
/// <summary>
/// Registers the given handler as a global listener for all events handled via the T interface.
/// T must be an interface type, not a class type, derived from IEventSystemHandler.
/// </summary>
/// <remarks>
/// If you want to register a single C# object as global handler for several event handling interfaces,
/// you must call this function for each interface type.
/// </remarks>
/// <param name="handler">Handler to receive global input events of specified handler type.</param>
void RegisterHandler<T>(IEventSystemHandler handler) where T : IEventSystemHandler;
/// <summary>
/// Unregisters the given handler as a global listener for all events handled via the T interface.
/// T must be an interface type, not a class type, derived from IEventSystemHandler.
/// </summary>
/// <remarks>
/// If a single C# object listens to global input events for several event handling interfaces,
/// you must call this function for each interface type.
/// </remarks>
/// <param name="handler">Handler to stop receiving global input events of specified handler type.</param>
void UnregisterHandler<T>(IEventSystemHandler handler) where T : IEventSystemHandler;
}
}
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
using Microsoft.MixedReality.Toolkit.Utilities;
namespace Microsoft.MixedReality.Toolkit
{
/// <summary>
/// Defines configuration data for to be registered for a <see cref="IMixedRealityService"/> on startup.
/// Generally, used for configuring the extended interface, <see cref="IMixedRealityDataProvider"/>
/// </summary>
public interface IMixedRealityServiceConfiguration
{
/// <summary>
/// The concrete type for the system, feature or manager.
/// </summary>
SystemType ComponentType { get; }
/// <summary>
/// The name of the system, feature or manager.
/// </summary>
string ComponentName { get; }
/// <summary>
/// The priority this system, feature or manager will be initialized in.
/// </summary>
uint Priority { get; }
/// <summary>
/// The runtime platform(s) to run this service.
/// </summary>
SupportedPlatforms RuntimePlatform { get; }
/// <summary>
/// Profile configuration associated with the service
/// </summary>
BaseMixedRealityProfile Profile { get; }
}
}
\ No newline at end of file
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
using System;
using UnityEngine;
using UnityEngine.EventSystems;
namespace Microsoft.MixedReality.Toolkit.Input
{
/// <summary>
/// Base interface for all input handlers. This allows us to use ExecuteEvents.ExecuteHierarchy&lt;IMixedRealityBaseInputHandler&gt;
/// to send an event to all input handling interfaces.
/// </summary>
public interface IMixedRealityBaseInputHandler : IEventSystemHandler { }
}
\ No newline at end of file
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
using UnityEngine.EventSystems;
namespace Microsoft.MixedReality.Toolkit.Input
{
/// <summary>
/// Interface to implement dictation events.
/// </summary>
public interface IMixedRealityDictationHandler : IEventSystemHandler
{
void OnDictationHypothesis(DictationEventData eventData);
void OnDictationResult(DictationEventData eventData);
void OnDictationComplete(DictationEventData eventData);
void OnDictationError(DictationEventData eventData);
}
}
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
using UnityEngine.EventSystems;
namespace Microsoft.MixedReality.Toolkit.Input
{
/// <summary>
/// Interface to implement to react to focus changed events.
/// </summary>
/// <remarks>
/// The events on this interface are related to those of <see cref="IMixedRealityFocusHandler"/>, whose event have
/// a known ordering with this interface:
///
/// IMixedRealityFocusChangedHandler::OnBeforeFocusChange
/// IMixedRealityFocusHandler::OnFocusEnter
/// IMixedRealityFocusHandler::OnFocusExit
/// IMixedRealityFocusChangedHandler::OnFocusChanged
///
/// Because these two interfaces are different, consumers must be wary about having nested
/// hierarchies where some game objects will implement both interfaces, and more deeply nested
/// object within the same parent-child chain that implement a single one of these - such
/// a presence can lead to scenarios where one interface is invoked on the child object, and then
/// the other interface is invoked on the parent object (thus, the parent would "miss" getting
/// the event that the child had already processed).
/// </remarks>
public interface IMixedRealityFocusChangedHandler : IEventSystemHandler
{
/// <summary>
/// Focus event that is raised before the focus is actually changed.
/// </summary>
/// <remarks>Useful for logic that needs to take place before focus changes.</remarks>
void OnBeforeFocusChange(FocusEventData eventData);
/// <summary>
/// Focus event that is raised when the focused object is changed.
/// </summary>
void OnFocusChanged(FocusEventData eventData);
}
}
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
using UnityEngine.EventSystems;
namespace Microsoft.MixedReality.Toolkit.Input
{
/// <summary>
/// Interface to implement to react to focus enter/exit.
/// </summary>
/// <remarks>
/// The events on this interface are related to those of <see cref="IMixedRealityFocusChangedHandler"/>, whose event have
/// a known ordering with this interface:
///
/// IMixedRealityFocusChangedHandler::OnBeforeFocusChange
/// IMixedRealityFocusHandler::OnFocusEnter
/// IMixedRealityFocusHandler::OnFocusExit
/// IMixedRealityFocusChangedHandler::OnFocusChanged
///
/// Because these two interfaces are different, consumers must be wary about having nested
/// hierarchies where some game objects will implement both interfaces, and more deeply nested
/// object within the same parent-child chain that implement a single one of these - such
/// a presence can lead to scenarios where one interface is invoked on the child object, and then
/// the other interface is invoked on the parent object (thus, the parent would "miss" getting
/// the event that the child had already processed).
/// </remarks>
public interface IMixedRealityFocusHandler : IEventSystemHandler
{
/// <summary>
/// The Focus Enter event is raised on this <see href="https://docs.unity3d.com/ScriptReference/GameObject.html">GameObject</see> whenever a <see cref="Microsoft.MixedReality.Toolkit.Input.IMixedRealityPointer"/>'s focus enters this <see href="https://docs.unity3d.com/ScriptReference/GameObject.html">GameObject</see>'s <see href="https://docs.unity3d.com/ScriptReference/Collider.html">Collider</see>.
/// </summary>
void OnFocusEnter(FocusEventData eventData);
/// <summary>
/// The Focus Exit event is raised on this <see href="https://docs.unity3d.com/ScriptReference/GameObject.html">GameObject</see> whenever a <see cref="Microsoft.MixedReality.Toolkit.Input.IMixedRealityPointer"/>'s focus leaves this <see href="https://docs.unity3d.com/ScriptReference/GameObject.html">GameObject</see>'s <see href="https://docs.unity3d.com/ScriptReference/Collider.html">Collider</see>.
/// </summary>
void OnFocusExit(FocusEventData eventData);
}
}
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
using UnityEngine.EventSystems;
namespace Microsoft.MixedReality.Toolkit.Input
{
/// <summary>
/// Interface to implement for generic gesture input.
/// </summary>
public interface IMixedRealityGestureHandler : IMixedRealityBaseInputHandler
{
/// <summary>
/// Gesture Started Event.
/// </summary>
void OnGestureStarted(InputEventData eventData);
/// <summary>
/// Gesture Updated Event.
/// </summary>
void OnGestureUpdated(InputEventData eventData);
/// <summary>
/// Gesture Completed Event.
/// </summary>
void OnGestureCompleted(InputEventData eventData);
/// <summary>
/// Gesture Canceled Event.
/// </summary>
void OnGestureCanceled(InputEventData eventData);
}
/// <summary>
/// Interface to implement for generic gesture input.
/// </summary>
/// <typeparam name="T">The type of data you want to listen for.</typeparam>
public interface IMixedRealityGestureHandler<T> : IMixedRealityGestureHandler
{
/// <summary>
/// Gesture Updated Event.
/// </summary>
/// <remarks>
/// The <see cref="Microsoft.MixedReality.Toolkit.Input.InputEventData{T}.InputData"/> for the associated gesture data.
/// </remarks>
void OnGestureUpdated(InputEventData<T> eventData);
/// <summary>
/// Gesture Completed Event.
/// </summary>
/// <remarks>
/// The <see cref="Microsoft.MixedReality.Toolkit.Input.InputEventData{T}.InputData"/> for the associated gesture data.
/// </remarks>
void OnGestureCompleted(InputEventData<T> eventData);
}
}
\ No newline at end of file
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
using Microsoft.MixedReality.Toolkit.Utilities;
using System.Collections.Generic;
using UnityEngine.EventSystems;
namespace Microsoft.MixedReality.Toolkit.Input
{
/// <summary>
/// Interface to implement for hand joint information.
/// </summary>
public interface IMixedRealityHandJointHandler : IEventSystemHandler
{
void OnHandJointsUpdated(InputEventData<IDictionary<TrackedHandJoint, MixedRealityPose>> eventData);
}
}
\ No newline at end of file
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
using UnityEngine.EventSystems;
using UnityEngine;
namespace Microsoft.MixedReality.Toolkit.Input
{
/// <summary>
/// Interface to implement for hand mesh information.
/// </summary>
public interface IMixedRealityHandMeshHandler : IEventSystemHandler
{
void OnHandMeshUpdated(InputEventData<HandMeshInfo> eventData);
}
/// <summary>
/// Stores pointers and transform information for Hand Mesh data provided by current platform. This is the data container for the IMixedRealityHandMeshHandler input system event interface.
/// </summary>
public class HandMeshInfo
{
/// <summary>
/// Pointer to vertices buffer of the hand mesh in the local coordinate system (i.e relative to center of hand)
/// </summary>
public Vector3[] vertices;
/// <summary>
/// Pointer to the triangle indices buffer of the hand mesh.
/// </summary>
public int[] triangles;
/// <summary>
/// Pointer to the normals buffer of the hand mesh in the local coordinate system
/// </summary>
public Vector3[] normals;
/// <summary>
/// Pointer to UV mapping of the hand mesh triangles
/// </summary>
public Vector2[] uvs;
/// <summary>
/// Translation to apply to mesh to go from local coordinates to world coordinates
/// </summary>
public Vector3 position;
/// <summary>
/// Rotation to apply to mesh to go from local coordinates to world coordinates
/// </summary>
public Quaternion rotation;
}
}
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
using System;
using UnityEngine;
using UnityEngine.EventSystems;
namespace Microsoft.MixedReality.Toolkit.Input
{
/// <summary>
/// Interface to receive input action events.
/// </summary>
public interface IMixedRealityInputActionHandler : IMixedRealityBaseInputHandler
{
/// <summary>
/// Received on action start, e.g when a button is pressed or a gesture starts.
/// </summary>
/// <param name="eventData">Input event that triggered the action</param>
void OnActionStarted(BaseInputEventData eventData);
/// <summary>
/// Received on action end, e.g when a button is released or a gesture completed.
/// </summary>
/// <param name="eventData">Input event that triggered the action</param>
void OnActionEnded(BaseInputEventData eventData);
}
}
\ No newline at end of file
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
using System;
using UnityEngine;
using UnityEngine.EventSystems;
namespace Microsoft.MixedReality.Toolkit.Input
{
/// <summary>
/// Interface to implement for simple generic input.
/// </summary>
public interface IMixedRealityInputHandler : IMixedRealityBaseInputHandler
{
/// <summary>
/// Input Up updates from Interactions, Keys, or any other simple input.
/// </summary>
void OnInputUp(InputEventData eventData);
/// <summary>
/// Input Down updates from Interactions, Keys, or any other simple input.
/// </summary>
void OnInputDown(InputEventData eventData);
}
/// <summary>
/// Interface to implement for more complex generic input.
/// </summary>
/// <typeparam name="T">The type of input to listen for.</typeparam>
/// <remarks>
/// Valid input types:
/// </remarks>
public interface IMixedRealityInputHandler<T> : IEventSystemHandler
{
/// <summary>
/// Raised input event updates from the type of input specified in the interface handler implementation.
/// </summary>
/// <remarks>
/// The <see cref="Microsoft.MixedReality.Toolkit.Input.InputEventData{T}.InputData"/> is the current input data.
/// </remarks>
void OnInputChanged(InputEventData<T> eventData);
}
}
\ No newline at end of file
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
using UnityEngine.EventSystems;
namespace Microsoft.MixedReality.Toolkit.Input
{
/// <summary>
/// Interface to implement to react to simple pointer input.
/// </summary>
public interface IMixedRealityPointerHandler : IEventSystemHandler
{
/// <summary>
/// When a pointer down event is raised, this method is used to pass along the event data to the input handler.
/// </summary>
void OnPointerDown(MixedRealityPointerEventData eventData);
/// <summary>
/// Called every frame a pointer is down. Can be used to implement drag-like behaviors.
/// </summary>
void OnPointerDragged(MixedRealityPointerEventData eventData);
/// <summary>
/// When a pointer up event is raised, this method is used to pass along the event data to the input handler.
/// </summary>
void OnPointerUp(MixedRealityPointerEventData eventData);
/// <summary>
/// When a pointer clicked event is raised, this method is used to pass along the event data to the input handler.
/// </summary>
void OnPointerClicked(MixedRealityPointerEventData eventData);
}
}
\ 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>
/// Interface to implement to react to source
/// </summary>
public interface IMixedRealitySourcePoseHandler : IMixedRealitySourceStateHandler
{
/// <summary>
/// Raised when the source pose tracking state is changed.
/// </summary>
void OnSourcePoseChanged(SourcePoseEventData<TrackingState> eventData);
/// <summary>
/// Raised when the source position is changed.
/// </summary>
void OnSourcePoseChanged(SourcePoseEventData<Vector2> eventData);
/// <summary>
/// Raised when the source position is changed.
/// </summary>
void OnSourcePoseChanged(SourcePoseEventData<Vector3> eventData);
/// <summary>
/// Raised when the source rotation is changed.
/// </summary>
void OnSourcePoseChanged(SourcePoseEventData<Quaternion> eventData);
/// <summary>
/// Raised when the source pose is changed.
/// </summary>
void OnSourcePoseChanged(SourcePoseEventData<MixedRealityPose> eventData);
}
}
\ No newline at end of file
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
using UnityEngine.EventSystems;
namespace Microsoft.MixedReality.Toolkit.Input
{
/// <summary>
/// Interface to implement to react to source state changes, such as when an input source is detected or lost.
/// </summary>
public interface IMixedRealitySourceStateHandler : IEventSystemHandler
{
/// <summary>
/// Raised when a source is detected.
/// </summary>
void OnSourceDetected(SourceStateEventData eventData);
/// <summary>
/// Raised when a source is lost.
/// </summary>
void OnSourceLost(SourceStateEventData eventData);
}
}
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
using UnityEngine.EventSystems;
namespace Microsoft.MixedReality.Toolkit.Input
{
/// <summary>
/// Interface to implement to react to speech recognition.
/// </summary>
public interface IMixedRealitySpeechHandler : IMixedRealityBaseInputHandler
{
void OnSpeechKeywordRecognized(SpeechEventData eventData);
}
}
\ No newline at end of file
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
using Microsoft.MixedReality.Toolkit.Input;
using UnityEngine.EventSystems;
namespace Microsoft.MixedReality.Toolkit.Input
{
/// <summary>
/// Implementation of this interface causes a script to receive notifications of Touch events from HandTrackingInputSources
/// </summary>
public interface IMixedRealityTouchHandler : IEventSystemHandler
{
/// <summary>
/// When a Touch motion has occurred, this handler receives the event.
/// </summary>
/// <remarks>
/// A Touch motion is defined as occurring within the bounds of an object (transitive).
/// </remarks>
/// <param name="eventData">Contains information about the HandTrackingInputSource.</param>
void OnTouchStarted(HandTrackingInputEventData eventData);
/// <summary>
/// When a Touch motion ends, this handler receives the event.
/// </summary>
/// <remarks>
/// A Touch motion is defined as occurring within the bounds of an object (transitive).
/// </remarks>
/// <param name="eventData">Contains information about the HandTrackingInputSource.</param>
void OnTouchCompleted(HandTrackingInputEventData eventData);
/// <summary>
/// When a Touch motion is updated, this handler receives the event.
/// </summary>
/// <remarks>
/// A Touch motion is defined as occurring within the bounds of an object (transitive).
/// </remarks>
/// <param name="eventData">Contains information about the HandTrackingInputSource.</param>
void OnTouchUpdated(HandTrackingInputEventData eventData);
}
}
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
using Microsoft.MixedReality.Toolkit.Utilities;
using UnityEngine;
namespace Microsoft.MixedReality.Toolkit.Input
{
/// <summary>
/// Interface for cursor modifiers that can modify a <see href="https://docs.unity3d.com/ScriptReference/GameObject.html">GameObject</see>'s properties.
/// </summary>
public interface ICursorModifier : IMixedRealityFocusChangedHandler
{
/// <summary>
/// Transform for which this <see cref="IMixedRealityCursor"/> modifies applies its various properties.
/// </summary>
Transform HostTransform { get; set; }
/// <summary>
/// How much a <see cref="IMixedRealityCursor"/>'s position should be offset from the surface of the <see href="https://docs.unity3d.com/ScriptReference/GameObject.html">GameObject</see> when overlapping.
/// </summary>
Vector3 CursorPositionOffset { get; set; }
/// <summary>
/// Should the <see cref="IMixedRealityCursor"/> snap to the <see href="https://docs.unity3d.com/ScriptReference/GameObject.html">GameObject</see>'s position?
/// </summary>
bool SnapCursorPosition { get; set; }
/// <summary>
/// Scale of the <see cref="IMixedRealityCursor"/> when looking at this <see href="https://docs.unity3d.com/ScriptReference/GameObject.html">GameObject</see>.
/// </summary>
Vector3 CursorScaleOffset { get; set; }
/// <summary>
/// Direction of the <see cref="IMixedRealityCursor"/> offset.
/// </summary>
Vector3 CursorNormalOffset { get; set; }
/// <summary>
/// If true, the normal from the pointing vector will be used to orient the <see cref="IMixedRealityCursor"/> instead of the targeted <see href="https://docs.unity3d.com/ScriptReference/GameObject.html">GameObject</see>'s normal at point of contact.
/// </summary>
bool UseGazeBasedNormal { get; set; }
/// <summary>
/// Should the <see cref="IMixedRealityCursor"/> be hidden when this <see href="https://docs.unity3d.com/ScriptReference/GameObject.html">GameObject</see> is focused?
/// </summary>
bool HideCursorOnFocus { get; set; }
/// <summary>
/// <see cref="IMixedRealityCursor"/> animation parameters to set when this <see href="https://docs.unity3d.com/ScriptReference/GameObject.html">GameObject</see> is focused. Leave empty for none.
/// </summary>
AnimatorParameter[] CursorParameters { get; }
/// <summary>
/// Indicates whether the <see cref="IMixedRealityCursor"/> should be visible or not.
/// </summary>
/// <returns>True if <see cref="IMixedRealityCursor"/> should be visible, false if not.</returns>
bool GetCursorVisibility();
/// <summary>
/// Returns the <see cref="IMixedRealityCursor"/> position after considering this modifier.
/// </summary>
/// <param name="cursor"><see cref="IMixedRealityCursor"/> that is being modified.</param>
/// <returns>New position for the <see cref="IMixedRealityCursor"/></returns>
Vector3 GetModifiedPosition(IMixedRealityCursor cursor);
/// <summary>
/// Returns the <see cref="IMixedRealityCursor"/> rotation after considering this modifier.
/// </summary>
/// <param name="cursor"><see cref="IMixedRealityCursor"/> that is being modified.</param>
/// <returns>New rotation for the <see cref="IMixedRealityCursor"/></returns>
Quaternion GetModifiedRotation(IMixedRealityCursor cursor);
/// <summary>
/// Returns the <see cref="IMixedRealityCursor"/>'s local scale after considering this modifier.
/// </summary>
/// <param name="cursor"><see cref="IMixedRealityCursor"/> that is being modified.</param>
/// <returns>New local scale for the <see cref="IMixedRealityCursor"/></returns>
Vector3 GetModifiedScale(IMixedRealityCursor cursor);
/// <summary>
/// Returns the modified <see href="https://docs.unity3d.com/ScriptReference/Transform.html">Transform</see> for the <see cref="IMixedRealityCursor"/> after considering this modifier.
/// </summary>
/// <param name="cursor">Cursor that is being modified.</param>
/// <param name="position">Modified position.</param>
/// <param name="rotation">Modified rotation.</param>
/// <param name="scale">Modified scale.</param>
void GetModifiedTransform(IMixedRealityCursor cursor, out Vector3 position, out Quaternion rotation, out Vector3 scale);
}
}
\ No newline at end of file
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
namespace Microsoft.MixedReality.Toolkit.Input
{
/// <summary>
/// Interface for defining Input Action Rules
/// </summary>
/// <typeparam name="T"></typeparam>
public interface IInputActionRule<T>
{
/// <summary>
/// The Base Action that the rule will listen to.
/// </summary>
MixedRealityInputAction BaseAction { get; }
/// <summary>
/// The Action to raise if the criteria is met.
/// </summary>
MixedRealityInputAction RuleAction { get; }
/// <summary>
/// The criteria to check against for determining if the action should be raised.
/// </summary>
T Criteria { get; }
}
}
\ No newline at end of file
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
using UnityEngine;
namespace Microsoft.MixedReality.Toolkit.Input
{
/// <summary>
/// Cursor Interface for handling input events and setting visibility.
/// </summary>
public interface IMixedRealityCursor : IMixedRealityFocusChangedHandler, IMixedRealitySourceStateHandler, IMixedRealityPointerHandler
{
/// <summary>
/// The <see cref="IMixedRealityPointer"/> this <see cref="IMixedRealityCursor"/> is associated with.
/// </summary>
IMixedRealityPointer Pointer { get; set; }
/// <summary>
/// Surface distance to place the cursor off of the surface at
/// </summary>
float SurfaceCursorDistance { get; }
/// <summary>
/// The maximum distance the cursor can be with nothing hit
/// </summary>
float DefaultCursorDistance { get; set; }
/// <summary>
/// Position of the <see cref="IMixedRealityCursor"/>.
/// </summary>
Vector3 Position { get; }
/// <summary>
/// Rotation of the <see cref="IMixedRealityCursor"/>.
/// </summary>
Quaternion Rotation { get; }
/// <summary>
/// Local scale of the <see cref="IMixedRealityCursor"/>.
/// </summary>
Vector3 LocalScale { get; }
/// <summary>
/// Sets the visibility of the <see cref="IMixedRealityCursor"/>.
/// </summary>
/// <param name="visible">True if cursor should be visible, false if not.</param>
void SetVisibility(bool visible);
/// <summary>
/// Utility method to destroy cursor dependencies (e.g. event subscriptions) in the system
/// explicitly in the middle update loop. This is a "replacement" of Unity OnDestroy.
/// Relying on Unity OnDestroy may cause event handler subscription to
/// become invalid at the point of destroying.
/// </summary>
void Destroy();
/// <summary>
/// Is the cursor currently visible?
/// </summary>
bool IsVisible { get; }
/// <summary>
/// Sets the visibility of the <see cref="IMixedRealityCursor"/> when the source is detected.
/// </summary>
bool SetVisibilityOnSourceDetected { get; set; }
/// <summary>
/// Returns the <see cref="IMixedRealityCursor"/>'s <see href="https://docs.unity3d.com/ScriptReference/GameObject.html">GameObject</see> reference.
/// </summary>
/// <returns>The <see href="https://docs.unity3d.com/ScriptReference/GameObject.html">GameObject</see> this <see cref="IMixedRealityCursor"/> component is attached to.</returns>
GameObject GameObjectReference { get; }
}
}
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