void OnDrawGizmos() { if (this != instance) { return; } Gizmos.color = Color.green; Gizmos.DrawIcon(feetPositionGuess, "vr_interaction_system_feet.png"); Gizmos.color = Color.cyan; Gizmos.DrawLine(feetPositionGuess, feetPositionGuess + trackingOriginTransform.up * eyeHeight); // Body direction arrow Gizmos.color = Color.blue; Vector3 bodyDirection = bodyDirectionGuess; Vector3 bodyDirectionTangent = Vector3.Cross(trackingOriginTransform.up, bodyDirection); Vector3 startForward = feetPositionGuess + trackingOriginTransform.up * eyeHeight * 0.75f; Vector3 endForward = startForward + bodyDirection * 0.33f; Gizmos.DrawLine(startForward, endForward); Gizmos.DrawLine(endForward, endForward - 0.033f * (bodyDirection + bodyDirectionTangent)); Gizmos.DrawLine(endForward, endForward - 0.033f * (bodyDirection - bodyDirectionTangent)); Gizmos.color = Color.red; int count = handCount; for (int i = 0; i < count; i++) { VRHand hand = GetHand(i); if (hand.startingHandType == VRHand.HandType.Left) { Gizmos.DrawIcon(hand.transform.position, "vr_interaction_system_left_hand.png"); } else if (hand.startingHandType == VRHand.HandType.Right) { Gizmos.DrawIcon(hand.transform.position, "vr_interaction_system_right_hand.png"); } else { VRHand.HandType guessHandType = hand.GuessCurrentHandType(); if (guessHandType == VRHand.HandType.Left) { Gizmos.DrawIcon(hand.transform.position, "vr_interaction_system_left_hand_question.png"); } else if (guessHandType == VRHand.HandType.Right) { Gizmos.DrawIcon(hand.transform.position, "vr_interaction_system_right_hand_question.png"); } else { Gizmos.DrawIcon(hand.transform.position, "vr_interaction_system_unknown_hand.png"); } } Gizmos.DrawIcon(hand.transform.position, "right_hand_question.png"); } }