Exemplo n.º 1
0
        public void SetBlock(Vector3 offset, Vector3 size, Vector3 direction, string boneName)
        {
            offset.x *= Mathf.Sign(direction.x);

            Offset = offset;
            Size   = size;

            BoneFollower.SetBone(boneName);
        }
Exemplo n.º 2
0
    //跟随骨骼移动
    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);
    }
Exemplo n.º 3
0
        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);
        }
Exemplo n.º 4
0
    // 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);
    }