Example #1
0
        private void GetP3Bones(GameObject obj)
        {
            if (null == obj)
            {
                return;
            }
            _neckP3          = BoneMount.FindChildBone(obj, BoneName.CharacterNeckBoneName);
            _headP3          = BoneMount.FindChildBone(obj, BoneName.CharacterHeadBoneName);
            _rightClavicleP3 = BoneMount.FindChildBone(obj, BoneName.CharacterRightClavicleName);

            _spine  = BoneMount.FindChildBoneFromCache(obj, BoneName.CharacterSpineName);
            _spine1 = BoneMount.FindChildBoneFromCache(obj, BoneName.CharacterSpine1Name);
        }
Example #2
0
 private void GetP3Bones(GameObject obj)
 {
     if (null == obj)
     {
         return;
     }
     _baseLocatorP3     = BoneMount.FindChildBone(obj, BoneName.AlternativeWeaponLocator);
     _neckP3            = BoneMount.FindChildBone(obj, BoneName.CharacterNeckBoneName);
     _headP3            = BoneMount.FindChildBone(obj, BoneName.CharacterHeadBoneName);
     _leftClavicleP3    = BoneMount.FindChildBone(obj, BoneName.CharacterLeftClavicleName);
     _rightClavicleP3   = BoneMount.FindChildBone(obj, BoneName.CharacterRightClavicleName);
     _leftWeaponLocator = BoneMount.FindChildBone(obj, BoneName.CharLeftHand);
 }
Example #3
0
        private void AddBag(WardrobeParam param)
        {
            if (param.Type == Wardrobe.Bag && _bagChanged != null)
            {
                var attachment6 = BoneMount.FindChildBone(param.DefaultGameObject, BoneName.WeaponAttachment6);
                var attachment7 = BoneMount.FindChildBone(param.DefaultGameObject, BoneName.WeaponAttachment7);

                if (attachment6 != null)
                {
                    _attachment6Parent       = attachment6.parent;
                    _attachment6ParentInChar = GetBoneOfTheSameName(_attachment6Parent, _allBonesDictionary);
                }
                if (attachment7 != null)
                {
                    _attachment7Parent       = attachment7.parent;
                    _attachment7ParentInChar = GetBoneOfTheSameName(_attachment7Parent, _allBonesDictionary);
                }
                _bagChanged.Invoke();
            }
        }
        public static void SetSteeringWheelIK(this PlayerEntity playerEntity, VehicleEntity vehicleEntity)
        {
            if (vehicleEntity != null && vehicleEntity.hasGameObject)
            {
                var thirdPersonObj = playerEntity.thirdPersonModel.Value;
                var ikControllerP3 = thirdPersonObj.GetComponent <PlayerIK>();

                ikControllerP3.ClearAllIKTarget();
                ikControllerP3.SetIKGoal(AvatarIKGoal.LeftHand);
                ikControllerP3.SetIKGoal(AvatarIKGoal.RightHand);

                var vehicleObj = vehicleEntity.gameObject.UnityObject;
                var leftIKP3   = BoneMount.FindChildBone(vehicleObj, BoneName.SteeringWheelLeftIK, true);
                ikControllerP3.SetSource(AvatarIKGoal.LeftHand, leftIKP3);
                var rightIKP3 = BoneMount.FindChildBone(vehicleObj, BoneName.SteeringWheelRightIK, true);
                ikControllerP3.SetSource(AvatarIKGoal.RightHand, rightIKP3);
                ikControllerP3.SetIKActive(true);

                playerEntity.characterBoneInterface.CharacterBone.IsIKActive = true;
                //playerEntity.appearanceInterface.Appearance.IsIKActive = true;
            }
        }
Example #5
0
 public void SetFirstPersonCharacter(GameObject obj)
 {
     _characterP1     = obj;
     _rightClavicleP1 = BoneMount.FindChildBone(obj, BoneName.CharacterRightClavicleName);
     _rightHandP1     = BoneMount.FindChildBone(obj, BoneName.CharacterRightHandName);
 }