mixedreality/com.microsoft.mixedreality..../Core/Definitions/InputSystem/MixedRealityGestureMapping.cs

49 lines
1.4 KiB
C#

// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
using System;
using UnityEngine;
namespace Microsoft.MixedReality.Toolkit.Input
{
/// <summary>
/// Data structure for mapping gestures to <see cref="MixedRealityInputAction"/>s that can be raised by the Input System.
/// </summary>
[Serializable]
public struct MixedRealityGestureMapping
{
/// <summary>
/// Constructor.
/// </summary>
public MixedRealityGestureMapping(string description, GestureInputType gestureType, MixedRealityInputAction action)
{
this.description = description;
this.gestureType = gestureType;
this.action = action;
}
[SerializeField]
private string description;
/// <summary>
/// Simple, human readable description of the gesture.
/// </summary>
public string Description => description;
[SerializeField]
private GestureInputType gestureType;
/// <summary>
/// Type of Gesture.
/// </summary>
public GestureInputType GestureType => gestureType;
[SerializeField]
private MixedRealityInputAction action;
/// <summary>
/// Action for the associated gesture.
/// </summary>
public MixedRealityInputAction Action => action;
}
}