Example #1
0
        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();
        }
Example #2
0
        protected override void Start()
        {
            base.Start();

            if (isPinchGrip)
            {
                DataHand dataHand = (_isLeft) ? userRig.LeftHand.DataHand : userRig.RightHand.DataHand;

                pinchGrabDetector = dataHand.PinchDetector;
            }
        }