IEnumerator startGrabCoroutine(HandVRSphereHand.EitherHand hand, Vector3 centerPosition) { yield return(new WaitForSeconds(0.1f)); focusedObjects_[(int)hand].StartGrab(hand, centerPosition); startGrabCoroutineRunning_[(int)hand] = null; }
public void EndFocus(HandVRSphereHand.EitherHand hand) { focusHands_.Remove(hand); if (focusHands_.Count == 0) { material_.color = defaultColor_; } }
public void StartFocus(HandVRSphereHand.EitherHand hand) { if (focusHands_.Count == 0) { material_.color = FocusedColor; } focusHands_.Add(hand); }
IEnumerator endGrabCoroutine(HandVRSphereHand.EitherHand hand) { yield return(new WaitForSeconds(0.1f)); focusedObjects_[(int)hand].EndGrab(hand); endGrabCoroutineRunning_[(int)hand] = null; isGrab_[(int)hand] = false; }
public int GetIdFromHandednesses(HandVRSphereHand.EitherHand hand) { float score0 = GetHandednessesScoreOnLeft(0); float score1 = GetHandednessesScoreOnLeft(1); if (score0 < 0f && score1 < 0f) { return(-1); } else if (!BothHand) { if (score0 < 0f) { return(1); } else { return(0); } } else if (score0 < 0f) { if (score1 >= 0f && (hand == HandVRSphereHand.EitherHand.Left && score1 >= 0.5f || hand == HandVRSphereHand.EitherHand.Right && score1 < 0.5f)) { return(1); } else { return(-1); } } else if (score1 < 0f) { if (hand == HandVRSphereHand.EitherHand.Left && score0 >= 0.5f || hand == HandVRSphereHand.EitherHand.Right && score0 < 0.5f) { return(0); } else { return(-1); } } else { if (hand == HandVRSphereHand.EitherHand.Left && score0 >= score1 || hand == HandVRSphereHand.EitherHand.Right && score0 < score1) { return(0); } else { return(1); } } }
public void StayGrab(HandVRSphereHand.EitherHand hand, Vector3 centerPosition) { if (targetTransformParent_ == null) { return; } targetTransformParent_.position = centerPosition; }
public void StartGrab(HandVRSphereHand.EitherHand hand, Vector3 centerPosition) { if (focusHands_.Contains(hand)) { detect(); focusHands_.Remove(hand); material_.color = defaultColor_; } }
void touch(HandVRSphereHand.EitherHand hand) { if (focusHands_.Contains(hand)) { detect(); focusHands_.Remove(hand); material_.color = DetectColor; } }
public void StartGrab(HandVRSphereHand.EitherHand hand, Vector3 centerPosition) { if (grabHands_.Count == 0) { material_.color = GrabColor; targetTransformParent_.position = centerPosition; targetTransformParent_.LookAt(transform); targetTransform_.rotation = transform.rotation; targetTransform_.position = transform.position; } grabHands_.Add(hand); }
IEnumerator focusStartCoroutine(HandVRSphereHand.EitherHand hand) { yield return(null); if (focusStartHands_.Remove(hand)) { if (focusHands_.Count == 0 && material_.color != DetectColor) { material_.color = FocusedColor; } focusHands_.Add(hand); } }
public void EndGrab(HandVRSphereHand.EitherHand hand) { grabHands_.Remove(hand); if (grabHands_.Count == 0) { if (focusHands_.Count > 0) { material_.color = FocusedColor; } else { material_.color = defaultColor_; } } }
public void EndGrab(HandVRSphereHand.EitherHand hand) { if (targetTransformParent_ == null) { return; } grabHands_.Remove(hand); if (grabHands_.Count == 0) { if (focusHands_.Count > 0) { material_.color = FocusedColor; } else { material_.color = defaultColor_; } } }
public void EndTouch(HandVRSphereHand.EitherHand hand) { }
public void StayTouch(HandVRSphereHand.EitherHand hand, Vector3 centerPosition) { touch(hand); }
public void EndGrab(HandVRSphereHand.EitherHand hand) { }
public void StayGrab(HandVRSphereHand.EitherHand hand, Vector3 centerPosition) { }
public void StartFocus(HandVRSphereHand.EitherHand hand) { focusStartHands_.Add(hand); StartCoroutine(focusStartCoroutine(hand)); }
public void StayGrab(HandVRSphereHand.EitherHand hand, Vector3 centerPosition) { targetTransformParent_.position = centerPosition; }