예제 #1
0
 private void GetP3Bones(GameObject obj)
 {
     if (null == obj)
     {
         return;
     }
     _baseLocatorP3  = BoneMount.FindChildBone(obj, BoneName.AlternativeWeaponLocator);
     _spineP3        = BoneMount.FindChildBone(obj, BoneName.CharacterSpineName);     //"Bip01 Spine");
     _spine1P3       = BoneMount.FindChildBone(obj, BoneName.CharacterSpine1Name);    // "Bip01 Spine1");
     _pelvisP3       = BoneMount.FindChildBone(obj, BoneName.CharacterBipPelvisName); //"Bip01 Pelvis");
     _ikControllerP3 = obj.GetComponent <PlayerIK>();
     _ikControllerP3.SetIKGoal(AvatarIKGoal.LeftHand);
 }
예제 #2
0
 private void GetP1Bones(GameObject obj)
 {
     if (null == obj)
     {
         return;
     }
     _viewPointP1     = BoneMount.FindChildBone(obj, BoneName.ViewPoint);
     _baseLocatorP1   = BoneMount.FindChildBone(obj, BoneName.FirstPersonHandLocator);
     _cameraLocatorP1 = BoneMount.FindChildBone(obj, BoneName.FirstPersonCameraLocator);
     _rightHandP1     = BoneMount.FindChildBone(obj, BoneName.CharacterRightHandName);
     _leftHandP1      = BoneMount.FindChildBone(obj, BoneName.CharacterLeftHandName);
     _ikControllerP1  = obj.GetComponent <PlayerIK>();
     _ikControllerP1.SetIKGoal(AvatarIKGoal.LeftHand);
 }
예제 #3
0
        public bool SetIKTarget(GameObject objP1, GameObject objP3, ref bool weaponHasIk)
        {
            bool ret = false;

            if (FirstPersonIncluded)
            {
                Transform leftIKP1 = null;
                if (objP1 != null)
                {
                    leftIKP1 = BoneMount.FindChildBoneFromCache(objP1, BoneName.AttachmentLeftIKP1);
                    if (leftIKP1 == null)
                    {
                        leftIKP1 = BoneMount.FindChildBoneFromCache(objP1, BoneName.WeaponLeftIK);
                    }
                }

                _ikControllerP1.ClearAllIKTarget();
                _ikControllerP1.SetIKGoal(AvatarIKGoal.LeftHand);
                _ikControllerP1.SetSource(AvatarIKGoal.LeftHand, leftIKP1);
            }

            if (ThirdPersonIncluded)
            {
                Transform leftIKP3 = null;
                if (objP3 != null)
                {
                    leftIKP3 = BoneMount.FindChildBoneFromCache(objP3, BoneName.AttachmentLeftIKP3);
                    ret      = null != leftIKP3;

                    if (leftIKP3 == null)
                    {
                        leftIKP3 = BoneMount.FindChildBoneFromCache(objP3, BoneName.WeaponLeftIK);
                    }

                    weaponHasIk = null != leftIKP3;
                }

                _ikControllerP3.ClearAllIKTarget();
                _ikControllerP3.SetIKGoal(AvatarIKGoal.LeftHand);
                _ikControllerP3.SetSource(AvatarIKGoal.LeftHand, leftIKP3);
            }

            return(ret);
        }