private void Awake() { userRig = GetComponentInParent <UserRig>(); skeletalControllerHand = GetComponent <SkeletalControllerHand>(); ProviderSwitcher providerSwitcher = userRig.ProviderSwitcher; // get all of our handed stuff // break into the model manager handModelManagers = userRig.GetComponentsInChildren <HandModelManager>(true); FieldInfo[] privateFields = typeof(HandModelManager).GetFields(BindingFlags.Instance | BindingFlags.NonPublic); modelGroupField = privateFields.First <FieldInfo>(item => item.Name == "ModelPool"); modelGroupLists = new List <HandModelManager.ModelGroup> [handModelManagers.Length]; // we need our datahands foreach (HandModelManager modelManager in handModelManagers) { DataHand[] dataHands = modelManager.GetComponentsInChildren <DataHand>(true); if (dataHands != null && dataHands.Length == 2) { Chirality chirality = (IsLeft) ? Chirality.Left : Chirality.Right; dataHand = dataHands.First(item => item is DataHand && item.Handedness == chirality); } else { continue; } } GetModelGroupLists(); }
private void Awake() { controllerHand = GetComponent <SkeletalControllerHand>(); handAnimator = GetComponent <Animator>(); hand = controllerTransform.GetComponentInChildren <OVRHand>(); skeleton = hand.GetComponent <OVRSkeleton>(); GetControllerHashes(); }
private void Awake() { isPinchingHash = Animator.StringToHash("IsPinching"); pinchAmtHash = Animator.StringToHash("PinchAmt"); isGrabbedHash = Animator.StringToHash("IsGrabbed"); pinchThumbHorizHash = Animator.StringToHash("ThumbHoriz"); if (!controllerHand) { controllerHand = GetComponent <SkeletalControllerHand>(); } animator = steamVRPose.GetComponentInChildren <Animator>(); }
private void Awake() { isPinchingHash = Animator.StringToHash("IsPinching"); pinchAmtHash = Animator.StringToHash("PinchAmt"); isGrabbedHash = Animator.StringToHash("IsGrabbed"); if (!controllerHand) { controllerHand = GetComponent <SkeletalControllerHand>(); } steamVRPose = wrist.GetComponentInParent <SteamVR_Behaviour_Pose>(); skeletonBehavior = steamVRPose.GetComponentInChildren <MaskedSteamVRSkeleton>(); animator = steamVRPose.GetComponentInChildren <Animator>(); }
private void Awake() { interactionManager = Leap.Unity.Interaction.InteractionManager.instance; 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; } else if (controller is SteamVRInteractionController) { SteamVRInteractionController interactionController = (SteamVRInteractionController)controller; if (interactionController.isLeft) { leftInteractionController = interactionController; } else { rightInteractionController = interactionController; } } } } SkeletalControllerHand[] hands = transform.parent.GetComponentsInChildren <SkeletalControllerHand>(true); leftSkeletalControllerHand = hands.First(item => item.IsLeft); rightSkeletalControllerHand = hands.First(item => !item.IsLeft); }
/*private bool _graspButtonDown = false; * private bool _graspButtonUp = false; * private float _graspButtonDownSlopTimer = 0F;*/ private void Awake() { SkeletalControllerHand[] controllerHands = FindObjectsOfType <SkeletalControllerHand>(); foreach (SkeletalControllerHand controllerHand in controllerHands) { if (controllerHand.IsLeft == _isLeft) { skeletalControllerHand = controllerHand; break; } } steamVRRemapper = skeletalControllerHand.GetComponent <SteamVRRemapper>(); _graspManipulatorPoints.Add(position); disableContactTimer = disableContactAfterGraspTime; _contactBones = new ContactBone[] { }; switcher = FindObjectOfType <ProviderSwitcher>(); }
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() { SkeletalControllerHand[] controllerHands = FindObjectsOfType <SkeletalControllerHand>(); foreach (SkeletalControllerHand controllerHand in controllerHands) { if (controllerHand.IsLeft == _isLeft) { skeletalControllerHand = controllerHand; break; } } steamVRRemapper = skeletalControllerHand.GetComponent <SteamVRRemapper>(); _graspManipulatorPoints.Add(position); _contactBones = new ContactBone[] { }; primaryHoverPoints.Add(skeletalControllerHand.IndexMetacarpal.GetChild(0).GetChild(0).GetChild(0)); userRig = FindObjectOfType <UserRig>(); }
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); }
protected virtual void Awake() { controllerHand = GetComponent <SkeletalControllerHand>(); handAnimator = GetComponent <Animator>(); }
private void OnEnable() { controllerHand = target as SkeletalControllerHand; }