using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using Valve.VR;
using Valve.VR.Extras;
using Valve.VR.InteractionSystem;
public class InputController : MonoBehaviour
{
// Start is called before the first frame update
public Hand hand;
// Start is called before the first frame update
void Start()
{
}
private void OnEnable()
{
if (hand == null)
{
hand = this.GetComponent<Hand>();
}
}
// Update is called once per frame
void Update()
{
if (SteamVR_Input.GetState("default", "interactUI", hand.handType))
{
Debug.Log("interactUI");
}
//自定义按键
if (SteamVR_Input.GetState("custom", "RayHide", hand.handType))
{
Debug.Log("RayHide");
}
if (SteamVR_Input.GetState("custom", "TouchPad", hand.handType))
{
Debug.Log("TouchPad");
}
}
}