Example #1
0
        public void CrossFadeGesture(RuntimeAnimatorController rtc, AvatarMask avatarMask,
                                     float fadeIn, float fadeOut, float speed,
                                     params PlayableGesture.Parameter[] parameters)
        {
            if (this.gestures.Count == 0)
            {
                this.gestures.Add(PlayableGestureRTC.Create(
                                      rtc, avatarMask,
                                      fadeIn, fadeOut, speed,
                                      ref this.graph,
                                      ref this.mixerGesturesInput,
                                      ref this.mixerGesturesOutput,
                                      parameters
                                      ));
            }
            else
            {
                PlayableGesture previous = gestures[this.gestures.Count - 1];
                previous.StretchDuration(fadeIn);

                this.gestures.Add(PlayableGestureRTC.CreateAfter(
                                      rtc, avatarMask,
                                      fadeIn, fadeOut, speed,
                                      ref this.graph,
                                      previous,
                                      parameters
                                      ));
            }
        }
Example #2
0
        public void CrossFadeGesture(AnimationClip animationClip, AvatarMask avatarMask,
                                     float fadeIn, float fadeOut, float speed)
        {
            if (this.gestures.Count == 0)
            {
                this.gestures.Add(PlayableGestureClip.Create(
                                      animationClip, avatarMask,
                                      fadeIn, fadeOut, speed,
                                      ref this.graph,
                                      ref this.mixerGesturesInput,
                                      ref this.mixerGesturesOutput
                                      ));
            }
            else
            {
                PlayableGesture previous = gestures[this.gestures.Count - 1];
                previous.StretchDuration(fadeIn);

                this.gestures.Add(PlayableGestureClip.CreateAfter(
                                      animationClip, avatarMask,
                                      fadeIn, fadeOut, speed,
                                      ref this.graph,
                                      previous
                                      ));
            }
        }
        // GESTURE METHODS: -----------------------------------------------------------------------

        public void PlayGesture(AnimationClip animationClip, AvatarMask avatarMask,
                                float fadeIn, float fadeOut, float speed)
        {
            this.StopGesture(fadeIn);
            this.gestures.Add(PlayableGesture.Create(
                                  animationClip, avatarMask,
                                  fadeIn, fadeOut, speed,
                                  ref this.graph,
                                  ref this.mixerGesturesInput,
                                  ref this.mixerGesturesOutput
                                  ));
        }
        public static PlayableGesture CreateAfter(
            AnimationClip animationClip, AvatarMask avatarMask,
            float fadeIn, float fadeOut, float speed,
            ref PlayableGraph graph, PlayableBase previous)
        {
            PlayableGesture gesture = new PlayableGesture(
                animationClip, avatarMask,
                fadeIn, fadeOut, speed
                );

            AnimationClipPlayable input1 = AnimationClipPlayable.Create(graph, animationClip);

            input1.SetTime(0f);
            input1.SetSpeed(speed);
            input1.SetDuration(animationClip.length);

            gesture.Setup(ref graph, previous, ref input1);
            return(gesture);
        }
        public static PlayableGesture Create <TInput0, TOutput>(
            AnimationClip animationClip, AvatarMask avatarMask,
            float fadeIn, float fadeOut, float speed,
            ref PlayableGraph graph, ref TInput0 input0, ref TOutput output)
            where TInput0 : struct, IPlayable
            where TOutput : struct, IPlayable
        {
            PlayableGesture gesture = new PlayableGesture(
                animationClip, avatarMask,
                fadeIn, fadeOut, speed
                );

            AnimationClipPlayable input1 = AnimationClipPlayable.Create(graph, animationClip);

            input1.SetTime(0f);
            input1.SetSpeed(speed);
            input1.SetDuration(animationClip.length);

            gesture.Setup(ref graph, ref input0, ref input1, ref output);
            return(gesture);
        }