1
0
mirror of https://github.com/xiaopeng12138/MaiDXR.git synced 2024-11-27 20:40:48 +01:00
MaiDXR/Assets/Scripts/IOs/ControllerHapticManager.cs
xpeng d00d192af5 bug fix
locker bug
mp haptic bug
mp hand size bug
mp endcode bug
mp decode bug
2022-08-26 22:06:45 +02:00

26 lines
622 B
C#

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.XR;
public class ControllerHapticManager : MonoBehaviour
{
public XRNode Hand;
InputDevice device;
public float duration = 0.1f;
public float amplitude = 1f;
private void OnTriggerEnter(Collider other)
{
device = InputDevices.GetDeviceAtXRNode(Hand);
device.SendHapticImpulse(0, amplitude, duration);
}
private void OnTriggerExit(Collider other)
{
device = InputDevices.GetDeviceAtXRNode(Hand);
device.StopHaptics();
}
void Uppdate()
{
}
}