Example #1
0
    public void BindBodyShape(Animation animation, string bodyShapeType, Transform target)
    {
        this.target    = target;
        this.animation = animation;

        if (bodyShapeType.Contains(WearableLiterals.BodyShapes.MALE))
        {
            currentAnimations = maleAnimations;
        }
        else if (bodyShapeType.Contains(WearableLiterals.BodyShapes.FEMALE))
        {
            currentAnimations = femaleAnimations;
        }

        for (var i = 0; i < currentAnimations.Get().Length; i++)
        {
            var animationToId = currentAnimations.Get()[i];
            if (this.animation.GetClip(animationToId.id) == null)
            {
                // animationToId.id and animationToId.clip.name must be the same or we get big performance drop here
                // Already coordinated with art team to have the animations with the correct ids
                this.animation.AddClip(animationToId.clip, animationToId.id);
            }
        }

        SetIdleFrame();
    }
Example #2
0
    public void BindBodyShape(Animation animation, string bodyShapeType, Transform target)
    {
        this.target    = target;
        this.animation = animation;

        if (bodyShapeType.Contains(WearableLiterals.BodyShapes.MALE))
        {
            currentAnimations = maleAnimations;
        }
        else if (bodyShapeType.Contains(WearableLiterals.BodyShapes.FEMALE))
        {
            currentAnimations = femaleAnimations;
        }

        for (var i = 0; i < currentAnimations.Get().Length; i++)
        {
            var animationToId = currentAnimations.Get()[i];
            if (this.animation.GetClip(animationToId.id) == null)
            {
                this.animation.AddClip(animationToId.clip, animationToId.id);
            }
        }

        SetIdleFrame();
    }