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(PlayableGestureClip.Create( animationClip, avatarMask, fadeIn, fadeOut, speed, ref this.graph, ref this.mixerGesturesInput, ref this.mixerGesturesOutput )); }
public static PlayableGestureClip CreateAfter( AnimationClip animationClip, AvatarMask avatarMask, float fadeIn, float fadeOut, float speed, ref PlayableGraph graph, PlayableBase previous) { PlayableGestureClip gesture = new PlayableGestureClip( 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 PlayableGestureClip 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 { PlayableGestureClip gesture = new PlayableGestureClip( 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); }