public void OnHandsDetected(HandAbstraction hands) { Initialise(); leftHand = hands.GetLeftHand(); rightHand = hands.GetRightHand(); }
/** External API for host game. * Retrives the GameObject for a given hand. */ public GameObject GetHand(Hand hand) { if (handAbstraction == null) { return(null); } return(hand == Hand.Left ? handAbstraction.GetLeftHand() : handAbstraction.GetRightHand()); }
public void OnHandsDetected(HandAbstraction hands, Camera eventCamera) { targetHand = isLeft ? hands.GetLeftHand() : hands.GetRightHand(); this.transform.localScale = new Vector3(0.002f * panelScale, 0.002f * panelScale, 0.002f * panelScale); if (canvas != null) { canvas.worldCamera = eventCamera; } TrackTargetHand(); }
void Update() { if (hands != null) { bool isInBox = IsInBox(hands.GetLeftHand()) || IsInBox(hands.GetRightHand()); bool sendEvent = (isInBox && !wasInBox); wasInBox = isInBox; if (sendEvent) { OnHandEntered(); } } }