// Update is called once per frame void Update() { if (isActive) { visibleTime += Time.deltaTime; previousHand.CopyFrom(leapHand); SetHandData(leapHand, leapProvider.FrameID); } else { visibleTime = 0; } }
private void Start() { handID = !isLeft ? 0 : 1; leapHand = TestHandFactory.MakeTestHand(IsLeft, 0, handID, TestHandFactory.UnitType.UnityUnits); //GenerateHandData(0); arm = leapHand.Arm; fingers = leapHand.Fingers; thumbBones = leapHand.Fingers[(int)Finger.FingerType.TYPE_THUMB].bones; indexBones = leapHand.Fingers[(int)Finger.FingerType.TYPE_INDEX].bones; middleBones = leapHand.Fingers[(int)Finger.FingerType.TYPE_MIDDLE].bones; ringBones = leapHand.Fingers[(int)Finger.FingerType.TYPE_RING].bones; pinkyBones = leapHand.Fingers[(int)Finger.FingerType.TYPE_PINKY].bones; previousHand = new Hand(); previousHand.CopyFrom(leapHand); SetHandData(leapHand, 0); }
public static void AddHand(ref Frame frame, Hand __addHand) { Hand _addHand = new Hand(); _addHand.CopyFrom(__addHand); _addHand.FrameId = frame.Id; if (frame.Hands.Count == 1) { _addHand.Id = 1; _addHand.TimeVisible = frame.Hands[0].TimeVisible; } foreach (Finger f in _addHand.Fingers) { f.Id = _addHand.Id * 10 + f.Id; f.TimeVisible = _addHand.TimeVisible; } frame.Hands.Insert(0, _addHand); }