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(); }
protected override void Start() { base.Start(); if (isPinchGrip) { DataHand dataHand = (_isLeft) ? userRig.LeftHand.DataHand : userRig.RightHand.DataHand; pinchGrabDetector = dataHand.PinchDetector; } }