ModifyHand.cs 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. using SC.InputSystem;
  2. using System.Collections;
  3. using System.Collections.Generic;
  4. using UnityEngine;
  5. public class ModifyHand : MonoBehaviour {
  6. public InputDevicePartType partType;
  7. Vector3 offset = new Vector3(0f, 0f, 0f);
  8. float fv = 0.01f;//每次调节1cm
  9. bool displayHandLine = true;
  10. public void HandLine() {
  11. displayHandLine = !displayHandLine;
  12. if(InputSystem.Instant.Gesture26Dof) {
  13. foreach(var part in InputSystem.Instant.Gesture26Dof.InputDevice26DofGesturePartList) {
  14. if(part.PartType == partType) {
  15. part.DisplayFingerLineRender(displayHandLine);
  16. }
  17. }
  18. }
  19. }
  20. bool displayJoint = false;
  21. public void Joint() {
  22. displayJoint = !displayJoint;
  23. if(InputSystem.Instant.Gesture26Dof) {
  24. foreach(var part in InputSystem.Instant.Gesture26Dof.InputDevice26DofGesturePartList) {
  25. if(part.PartType == partType) {
  26. part.DisplayFingerDetecter(displayJoint);
  27. }
  28. }
  29. }
  30. }
  31. bool turnOffRay = true;
  32. public void Ray() {
  33. turnOffRay = !turnOffRay;
  34. if(InputSystem.Instant.Gesture26Dof) {
  35. foreach(var part in InputSystem.Instant.Gesture26Dof.InputDevice26DofGesturePartList) {
  36. if(part.PartType == partType) {
  37. part.SetRay(turnOffRay);
  38. }
  39. }
  40. }
  41. }
  42. bool turnOffTouch = true;
  43. public void Touch() {
  44. turnOffTouch = !turnOffTouch;
  45. if(InputSystem.Instant.Gesture26Dof) {
  46. foreach(var part in InputSystem.Instant.Gesture26Dof.InputDevice26DofGesturePartList) {
  47. if(part.PartType == partType) {
  48. part.SetTouch(turnOffTouch);
  49. }
  50. }
  51. }
  52. }
  53. }