ViveInput.cs 768 B

12345678910111213141516171819202122232425262728293031323334353637
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4. using Valve.VR;
  5. public class ViveInput : MonoBehaviour
  6. {
  7. private SteamVR_Action_Boolean grabPinch;
  8. //private void Awake()
  9. //{
  10. // actionBoolean = SteamVR_Actions._default.GrabPinch;
  11. //}
  12. //// Start is called before the first frame update
  13. //void Start()
  14. //{
  15. // actionSet.Activate(SteamVR_Input_Sources.Any, 0, true);
  16. //}
  17. private void Start()
  18. {
  19. grabPinch = SteamVR_Actions.default_GrabPinch;
  20. }
  21. // Update is called once per frame
  22. void Update()
  23. {
  24. if (grabPinch.GetStateDown(SteamVR_Input_Sources.Any))
  25. {
  26. Debug.Log("grab pinch down");
  27. }
  28. // TODO: other inputs
  29. }
  30. }