using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
using VRTK;
public class Test : MonoBehaviour {
public VRTK_ControllerEvents vRTK_ControllerEvents;
void Start() {
vRTK_ControllerEvents.TouchpadPressed += new ControllerInteractionEventHandler(OnTouchPadPressed);
}
private void OnTouchPadPressed(object sender, ControllerInteractionEventArgs e)
{
if (e.touchpadAngle <= 45 || e.touchpadAngle >= 315)
{
print("上");
}
else if (e.touchpadAngle > 45 && e.touchpadAngle <= 135)
{
print("右");
}
else if (e.touchpadAngle > 135 && e.touchpadAngle <= 225)
{
print("下");
}
else if (e.touchpadAngle > 225 && e.touchpadAngle < 315)
{
print("左");
}
} }
VRTK 圆盘的上下左右键
最新推荐文章于 2022-06-07 15:57:57 发布