private void Update() { if (GetGesture(MLHands.Left, MLHandKeyPose.Ok)) { pose = HandPoses.Ok; } else if (GetGesture(MLHands.Left, MLHandKeyPose.Finger)) { pose = HandPoses.Finger; } else if (GetGesture(MLHands.Left, MLHandKeyPose.OpenHandBack)) { pose = HandPoses.OpenHandBack; } else if (GetGesture(MLHands.Left, MLHandKeyPose.Fist)) { pose = HandPoses.Fist; } else if (GetGesture(MLHands.Left, MLHandKeyPose.Thumb)) { pose = HandPoses.Thumb; } else { pose = HandPoses.NoPose; } if (pose != HandPoses.NoPose) { ShowPoints(); } }
public void ChangePose(HandPoses newPose, XRBaseInteractor interactor) { HandVisuals visuals = interactor.GetComponentInChildren <HandVisuals>(); if (visuals != null) { visuals.LockPose(newPose); } }
private void Update() { if (GetGesture(MLHands.Left, MLHandKeyPose.Ok)) { pose = HandPoses.Ok; } else if (GetGesture(MLHands.Left, MLHandKeyPose.Finger)) { pose = HandPoses.Finger; if (!aS.isActiveAndEnabled) { aS.enabled = true; } if (!aS.isPlaying) { aS.Play(); } } else if (GetGesture(MLHands.Left, MLHandKeyPose.OpenHand)) { pose = HandPoses.OpenHand; if (aS.isPlaying) { aS.Stop(); } } else if (GetGesture(MLHands.Left, MLHandKeyPose.Thumb)) { pose = HandPoses.Fist; if (!chorus.isActiveAndEnabled) { chorus.enabled = true; chorus.depth = 0.3f; chorus.rate = 2; } } else if (GetGesture(MLHands.Left, MLHandKeyPose.Fist)) { pose = HandPoses.Thumb; if (chorus.isActiveAndEnabled) { chorus.enabled = false; } } else { pose = HandPoses.NoPose; } }
// Update is called once per frame private void Update() { ShowPoints(); transform.position = pos [1]; //follows the index tip if (GetGesture(MLHands.Left, MLHandKeyPose.Ok)) { pose = HandPoses.Ok; } else if (GetGesture(MLHands.Left, MLHandKeyPose.Finger)) { pose = HandPoses.Finger; } else if (GetGesture(MLHands.Left, MLHandKeyPose.OpenHand)) { pose = HandPoses.OpenHand; } else if (GetGesture(MLHands.Left, MLHandKeyPose.Pinch)) { pose = HandPoses.Pinch; if (canIGrab) { selectedGameObject.transform.position = transform.position; gameObject.GetComponent <SphereCollider>().radius = 0.1f; } } else if (GetGesture(MLHands.Left, MLHandKeyPose.Thumb)) { pose = HandPoses.Thumb; if (canIPlace == true) { GameObject placedObject = Instantiate(ObjectToPlace, pos[0], transform.rotation); canIPlace = false; } } else { pose = HandPoses.NoPose; canIPlace = true; if (selectedGameObject && canIGrab == false) { selectedGameObject = null; gameObject.GetComponent <SphereCollider>().radius = 0.01f; } } }
public void LockPose(HandPoses newPose) { animator.SetInteger(LockPoseHash, (int)newPose); }