示例#1
0
    private void InitAnimationController()
    {
        PlayableGraphObject = PlayableGraph.Create();
        var playableOutput = AnimationPlayableOutput.Create(PlayableGraphObject, "Animation", AnimatorComponent);

        mixerPlayable = AnimationMixerPlayable.Create(PlayableGraphObject, AnimationsDictionary.Count);
        playableOutput.SetSourcePlayable(mixerPlayable);
        foreach (var anim in AnimationsDictionary)
        {
            var  clipPlayable0 = AnimationClipPlayable.Create(PlayableGraphObject, anim.Value);
            bool isConnected   = PlayableGraphObject.Connect(clipPlayable0, 0, mixerPlayable, anim.Key);
        }
        PlayableGraphObject.Play();
    }
示例#2
0
 void DistroyAllAnimations()
 {
     PlayableGraphObject.Destroy();
 }