private void Awake() { platformManager = GetComponent <PlatformManager>(); interactionManager = Leap.Unity.Interaction.InteractionManager.instance; if (interactionManager != null) { controllerManager = interactionManager.GetComponent <PlatformControllerManager>(); } DataHand[] dataHands = modelManager.GetComponentsInChildren <DataHand>(true); leftAbstractHand = (HandModelBase)dataHands.First(item => item is DataHand && item.Handedness == Chirality.Left); rightAbstractHand = (HandModelBase)dataHands.First(item => item is DataHand && item.Handedness == Chirality.Right); if (interactionManager) { foreach (InteractionController controller in interactionManager.interactionControllers) { if (controller is InteractionHand) { InteractionHand hand = (InteractionHand)controller; if (hand.isLeft) { leftInteractionHand = hand; } else { rightInteractionHand = hand; } hand.leapProvider = defaultProvider; } } } SkeletalControllerHand[] hands = transform.parent.GetComponentsInChildren <SkeletalControllerHand>(true); leftSkeletalControllerHand = hands.First(item => item.IsLeft); rightSkeletalControllerHand = hands.First(item => !item.IsLeft); }
private void Awake() { userRig = GetComponentInParent <UserRig>(); platformManager = GetComponent <PlatformManager>(); interactionManager = Leap.Unity.Interaction.InteractionManager.instance; if (interactionManager != null) { controllerManager = interactionManager.GetComponent <PlatformControllerManager>(); } if (interactionManager) { foreach (InteractionController controller in interactionManager.interactionControllers) { if (controller is InteractionHand) { InteractionHand hand = (InteractionHand)controller; if (hand.isLeft) { leftInteractionHand = hand; } else { rightInteractionHand = hand; } hand.leapProvider = defaultProvider; } } } SkeletalControllerHand[] hands = transform.parent.GetComponentsInChildren <SkeletalControllerHand>(true); leftSkeletalControllerHand = hands.First(item => item.IsLeft); rightSkeletalControllerHand = hands.First(item => !item.IsLeft); }