GetHandPos.cs 954 B

123456789101112131415161718192021222324
  1. using SC.InputSystem;
  2. using System.Collections;
  3. using System.Collections.Generic;
  4. using UnityEngine;
  5. using UnityEngine.UI;
  6. public class GetHandPos : MonoBehaviour {
  7. public InputDevicePartType partType;
  8. public TextMesh text;
  9. void LateUpdate() {
  10. if(InputSystem.Instant.Gesture26Dof) {
  11. foreach(var part in InputSystem.Instant.Gesture26Dof.InputDevice26DofGesturePartList) {
  12. if(part.PartType == partType) {
  13. text.text = "FINGERsmall-JOINTfive\nworldPos:" + part.GetJointPosition(true, SC.InputSystem.InputDevice26DofGesture.FINGER.small, SC.InputSystem.InputDevice26DofGesture.JOINT.Five).ToString("(0.00,0.00,0.00)");
  14. text.text +="\nlocalPos:"+ part.GetJointPosition(false, SC.InputSystem.InputDevice26DofGesture.FINGER.forefinger, SC.InputSystem.InputDevice26DofGesture.JOINT.One).ToString("(0.00,0.00,0.00)");
  15. }
  16. }
  17. }
  18. }
  19. }