[Tooltip("The default controller visualization type. This value is used as a fallback if no controller definition exists with a custom visualization type.")]
[Tooltip("Check to obtain controller models from the platform SDK. If left unchecked, the global models will be used. Note: this value is overridden by controller definitions.")]
privatebooluseDefaultModels=false;
/// <summary>
/// Check to obtain controller models from the platform SDK. If left unchecked, the global models will be used. Note: this value is overridden by controller definitions.
/// </summary>
publicboolUseDefaultModels
{
get=>useDefaultModels;
privateset=>useDefaultModels=value;
}
[SerializeField]
[Tooltip("The default controller model material when loading platform SDK controller models. This value is used as a fallback if no controller definition exists with a custom material type.")]
privateMaterialdefaultControllerModelMaterial;
/// <summary>
/// The default controller model material when loading platform SDK controller models. This value is used as a fallback if no controller definition exists with a custom material type.
/// </summary>
publicMaterialDefaultControllerModelMaterial
{
get=>defaultControllerModelMaterial;
privateset=>defaultControllerModelMaterial=value;
}
[SerializeField]
[Tooltip("Override Left Controller Model.")]
privateGameObjectglobalLeftControllerModel;
/// <summary>
/// The Default controller model when there is no specific controller model for the Left hand or when no hand is specified (Handedness = none)
/// </summary>
/// <remarks>
/// If the default model for the left hand controller can not be found, the controller will fall back and use this for visualization.
/// </remarks>
publicGameObjectGlobalLeftHandModel
{
get=>globalLeftControllerModel;
privateset=>globalLeftControllerModel=value;
}
[SerializeField]
[Tooltip("Override Right Controller Model.\nNote: If the default model is not found, the fallback is the global right hand model.")]
privateGameObjectglobalRightControllerModel;
/// <summary>
/// The Default controller model when there is no specific controller model for the Right hand.
/// </summary>
/// <remarks>
/// If the default model for the right hand controller can not be found, the controller will fall back and use this for visualization.
/// </remarks>
publicGameObjectGlobalRightHandModel
{
get=>globalRightControllerModel;
privateset=>globalRightControllerModel=value;
}
[SerializeField]
[Tooltip("Override Left Hand Visualizer.")]
privateGameObjectglobalLeftHandVisualizer;
/// <summary>
/// The Default controller model when there is no specific controller model for the Left hand or when no hand is specified (Handedness = none)
/// </summary>
/// <remarks>
/// If the default model for the left hand controller can not be found, the controller will fall back and use this for visualization.
/// </remarks>
publicGameObjectGlobalLeftHandVisualizer
{
get=>globalLeftHandVisualizer;
privateset=>globalLeftHandVisualizer=value;
}
[SerializeField]
[Tooltip("Override Right Controller Model.\nNote: If the default model is not found, the fallback is the global right hand model.")]
privateGameObjectglobalRightHandVisualizer;
/// <summary>
/// The Default hand model when there is no specific hand model for the Right hand.
/// </summary>
/// <remarks>
/// If the default model for the right hand can not be found, the hand will fall back and use this for visualization.
[Tooltip("The designated hand that the device is managing.")]
privateHandednesshandedness;
/// <summary>
/// The designated hand that the device is managing.
/// </summary>
publicHandednessHandedness=>handedness;
[SerializeField]
[Tooltip("Check to obtain controller models from the platform SDK. If left unchecked, the global models will be used.")]
privatebooluseDefaultModel;
/// <summary>
/// Check to obtain controller models from the platform SDK. If left unchecked, the global models will be used.
/// </summary>
publicboolUseDefaultModel=>useDefaultModel;
[SerializeField]
[Tooltip("The default controller model material when loading platform SDK controller models.")]
privateMaterialdefaultModelMaterial;
/// <summary>
/// The default controller model material when loading platform SDK controller models. This value is used as a fallback if no controller definition exists with a custom material type.
[Tooltip("Optional KeyCode value to get input from Unity's old input system.")]
privateKeyCodekeyCode;
/// <summary>
/// Optional KeyCode value to get input from Unity's old input system.
/// </summary>
publicKeyCodeKeyCode=>keyCode;
[SerializeField]
[Tooltip("Optional horizontal or single axis value to get axis data from Unity's old input system.")]
privatestringaxisCodeX;
/// <summary>
/// Optional horizontal or single axis value to get axis data from Unity's old input system.
/// </summary>
publicstringAxisCodeX=>axisCodeX;
[SerializeField]
[Tooltip("Optional vertical axis value to get axis data from Unity's old input system.")]
privatestringaxisCodeY;
/// <summary>
/// Optional vertical axis value to get axis data from Unity's old input system.
/// </summary>
publicstringAxisCodeY=>axisCodeY;
[SerializeField]
[Tooltip("Should the X axis be inverted?")]
privateboolinvertXAxis=false;
/// <summary>
/// Should the X axis be inverted?
/// </summary>
/// <remarks>
/// Only valid for <see cref="Microsoft.MixedReality.Toolkit.Utilities.AxisType.SingleAxis"/> and <see cref="Microsoft.MixedReality.Toolkit.Utilities.AxisType.DualAxis"/> inputs.
Debug.LogError($"SetBoolValue is only valid for AxisType.Digital, AxisType.SingleAxis, or AxisType.DualAxis InteractionMappings\nPlease check the {InputType} mapping for the current controller");
}
Changed=boolData!=value;
boolData=value;
}
}
/// <summary>
/// The Float data value.
/// </summary>
/// <remarks>Only supported for a SingleAxis mapping axis type</remarks>
publicfloatFloatData
{
get
{
returnfloatData;
}
set
{
if(AxisType!=AxisType.SingleAxis)
{
Debug.LogError($"SetFloatValue is only valid for AxisType.SingleAxis InteractionMappings\nPlease check the {InputType} mapping for the current controller");
}
if(invertXAxis)
{
Changed=!floatData.Equals(value*-1f);
floatData=value*-1f;
}
else
{
Changed=!floatData.Equals(value);
floatData=value;
}
}
}
/// <summary>
/// The Vector2 data value.
/// </summary>
/// <remarks>Only supported for a DualAxis mapping axis type</remarks>
publicVector2Vector2Data
{
get
{
returnvector2Data;
}
set
{
if(AxisType!=AxisType.DualAxis)
{
Debug.LogError($"SetVector2Value is only valid for AxisType.DualAxis InteractionMappings\nPlease check the {InputType} mapping for the current controller");
/// <remarks>Only supported for a ThreeDof mapping axis type</remarks>
publicVector3PositionData
{
get
{
returnpositionData;
}
set
{
if(AxisType!=AxisType.ThreeDofPosition)
{
{
Debug.LogError($"SetPositionValue is only valid for AxisType.ThreeDoFPosition InteractionMappings\nPlease check the {InputType} mapping for the current controller");
}
}
Changed=positionData!=value;
positionData=value;
}
}
/// <summary>
/// The ThreeDof Quaternion Rotation data value.
/// </summary>
/// <remarks>Only supported for a ThreeDof mapping axis type</remarks>
publicQuaternionRotationData
{
get
{
returnrotationData;
}
set
{
if(AxisType!=AxisType.ThreeDofRotation)
{
Debug.LogError($"SetRotationValue is only valid for AxisType.ThreeDoFRotation InteractionMappings\nPlease check the {InputType} mapping for the current controller");
}
Changed=rotationData!=value;
rotationData=value;
}
}
/// <summary>
/// The Pose data value.
/// </summary>
/// <remarks>Only supported for a SixDof mapping axis type</remarks>
publicMixedRealityPosePoseData
{
get
{
returnposeData;
}
set
{
if(AxisType!=AxisType.SixDof)
{
Debug.LogError($"SetPoseValue is only valid for AxisType.SixDoF InteractionMappings\nPlease check the {InputType} mapping for the current controller");