scripts
This commit is contained in:
@@ -0,0 +1,67 @@
|
||||
using System;
|
||||
using UnityEngine.Animations;
|
||||
|
||||
namespace UnityEngine.Playables
|
||||
{
|
||||
// Token: 0x020001EF RID: 495
|
||||
public static class AnimationPlayableUtilities
|
||||
{
|
||||
// Token: 0x060022C0 RID: 8896 RVA: 0x00028450 File Offset: 0x00026650
|
||||
public static void Play(Animator animator, Playable playable, PlayableGraph graph)
|
||||
{
|
||||
AnimationPlayableOutput animationPlayableOutput = AnimationPlayableOutput.Create(graph, "AnimationClip", animator);
|
||||
animationPlayableOutput.SetSourcePlayable(playable);
|
||||
animationPlayableOutput.SetSourceInputPort(0);
|
||||
graph.SyncUpdateAndTimeMode(animator);
|
||||
graph.Play();
|
||||
}
|
||||
|
||||
// Token: 0x060022C1 RID: 8897 RVA: 0x00028488 File Offset: 0x00026688
|
||||
public static AnimationClipPlayable PlayClip(Animator animator, AnimationClip clip, out PlayableGraph graph)
|
||||
{
|
||||
graph = PlayableGraph.Create();
|
||||
AnimationPlayableOutput animationPlayableOutput = AnimationPlayableOutput.Create(graph, "AnimationClip", animator);
|
||||
AnimationClipPlayable animationClipPlayable = AnimationClipPlayable.Create(graph, clip);
|
||||
animationPlayableOutput.SetSourcePlayable(animationClipPlayable);
|
||||
graph.SyncUpdateAndTimeMode(animator);
|
||||
graph.Play();
|
||||
return animationClipPlayable;
|
||||
}
|
||||
|
||||
// Token: 0x060022C2 RID: 8898 RVA: 0x000284E4 File Offset: 0x000266E4
|
||||
public static AnimationMixerPlayable PlayMixer(Animator animator, int inputCount, out PlayableGraph graph)
|
||||
{
|
||||
graph = PlayableGraph.Create();
|
||||
AnimationPlayableOutput animationPlayableOutput = AnimationPlayableOutput.Create(graph, "Mixer", animator);
|
||||
AnimationMixerPlayable animationMixerPlayable = AnimationMixerPlayable.Create(graph, inputCount, false);
|
||||
animationPlayableOutput.SetSourcePlayable(animationMixerPlayable);
|
||||
graph.SyncUpdateAndTimeMode(animator);
|
||||
graph.Play();
|
||||
return animationMixerPlayable;
|
||||
}
|
||||
|
||||
// Token: 0x060022C3 RID: 8899 RVA: 0x00028540 File Offset: 0x00026740
|
||||
public static AnimationLayerMixerPlayable PlayLayerMixer(Animator animator, int inputCount, out PlayableGraph graph)
|
||||
{
|
||||
graph = PlayableGraph.Create();
|
||||
AnimationPlayableOutput animationPlayableOutput = AnimationPlayableOutput.Create(graph, "Mixer", animator);
|
||||
AnimationLayerMixerPlayable animationLayerMixerPlayable = AnimationLayerMixerPlayable.Create(graph, inputCount);
|
||||
animationPlayableOutput.SetSourcePlayable(animationLayerMixerPlayable);
|
||||
graph.SyncUpdateAndTimeMode(animator);
|
||||
graph.Play();
|
||||
return animationLayerMixerPlayable;
|
||||
}
|
||||
|
||||
// Token: 0x060022C4 RID: 8900 RVA: 0x0002859C File Offset: 0x0002679C
|
||||
public static AnimatorControllerPlayable PlayAnimatorController(Animator animator, RuntimeAnimatorController controller, out PlayableGraph graph)
|
||||
{
|
||||
graph = PlayableGraph.Create();
|
||||
AnimationPlayableOutput animationPlayableOutput = AnimationPlayableOutput.Create(graph, "AnimatorControllerPlayable", animator);
|
||||
AnimatorControllerPlayable animatorControllerPlayable = AnimatorControllerPlayable.Create(graph, controller);
|
||||
animationPlayableOutput.SetSourcePlayable(animatorControllerPlayable);
|
||||
graph.SyncUpdateAndTimeMode(animator);
|
||||
graph.Play();
|
||||
return animatorControllerPlayable;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user