HandShank3Dof.cs 850 B

123456789101112131415161718192021222324252627282930
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4. using ShadowKit.Action;
  5. using SC.InputSystem;
  6. public class HandShank3Dof : MonoBehaviour {
  7. public int deviceId;
  8. public TextMesh stateText;
  9. public InputDevicePartType partType;
  10. // Update is called once per frame
  11. void LateUpdate() {
  12. if(InputSystem.Instant.HandShank != null) {
  13. stateText.text = "未连接";
  14. foreach(var part in InputSystem.Instant.HandShank.inputDeviceHandShankPartList) {
  15. if(part.PartType == partType) {
  16. if(part.inputDataHandShank.isVaild) {
  17. stateText.text = "已连接";
  18. transform.rotation = part.inputDataHandShank.rotation;
  19. }
  20. }
  21. }
  22. }
  23. }
  24. }