private IGestureType GetGestureType() { /* * TODO: Raycast out in the direction of the gesture from the controller, check the velocity, and * if a valid IGestureType is found on the target, return it; otherwise, return an EmptyGesture */ IGestureType returnGesture = null; if (leftHand.velocity.magnitude >= minimumVelocity) { velocity = leftHand.velocity; ray = new Ray(leftHand.handPosition, velocity); returnGesture = RetrieveGesture(); } if (returnGesture == null || returnGesture.Equals(EmptyGesture)) { if (rightHand.velocity.magnitude >= minimumVelocity) { velocity = rightHand.velocity; ray = new Ray(rightHand.handPosition, velocity); returnGesture = RetrieveGesture(); } else { returnGesture = EmptyGesture; } } return(returnGesture); }
// Update is called once per frame private void Update() { IGestureType gesture = GetGestureType(); gesture.ExecuteEvent(); }