public void SetBlock(Vector3 offset, Vector3 size, Vector3 direction, string boneName) { offset.x *= Mathf.Sign(direction.x); Offset = offset; Size = size; BoneFollower.SetBone(boneName); }
//跟随骨骼移动 public void FollowBoneMove(SpineAvatar otherSpine, string boneName) { GameObject selfFollowGameObject = new GameObject(avatarObject.name); avatarFollow = selfFollowGameObject.AddComponent <AvatarFollow> (); BoneFollower boneFollower = selfFollowGameObject.AddComponent <BoneFollower> (); boneFollower.SkeletonRenderer = GetSkeletonAnimation; boneFollower.SetBone(boneName); avatarFollow.StartFollow(selfFollowGameObject, otherSpine); }
public void SetAttack(Brawler brawler, [NotNull] AttackData attackData, Vector3 direction) { _brawler = brawler; _attackData = attackData; _direction = direction; Vector3 offset = _attackData.AttackVolumeOffset; offset.x *= Mathf.Sign(direction.x); Offset = offset; Size = _attackData.AttackVolumeSize; BoneFollower.SetBone(attackData.BoneName); }
// Switches the weapon hand transform for the currently held weapon public IEnumerator SwitchWeaponHand() { // If no weapons are in the weapon list, return if (lWeapons.Count <= 0) { yield break; } if (!Application.isEditor) { yield return(new WaitForEndOfFrame()); } // Bone Follower BoneFollower follower = CurrentWeapon.GetComponent <BoneFollower>(); // Weapon Hand Transform string handBone = bFacingLeft ? sWeaponRearHandBone : sWeaponFrontHandBone; follower.SetBone(handBone); }