Example #1
0
 /*
  * //<public Methods>
  */
 public void TransAnimation(AnimBox anim_box)
 {
     if (ConnectProcess(anim_box))
     {
         StartCoroutine(Trans());
     }
 }
Example #2
0
        private void Awake()
        {
            graph       = PlayableGraph.Create();
            anim        = GetComponent <Animator>();
            currentAnim = defoultAnim;
            var output = AnimationPlayableOutput.Create(graph, "output", anim);

            mixer = AnimationMixerPlayable.Create(graph, 2);
            output.SetSourcePlayable(mixer);
            graph.Play();
        }
Example #3
0
        /*
         * //</public Methods>
         */


        /*
         * //<private Methods>
         */

        private bool ConnectProcess(AnimBox anim_box)
        {
            graph.Disconnect(mixer, 0);
            graph.Disconnect(mixer, 1);
            if (prePlayable.IsValid())
            {
                prePlayable.Destroy();
            }
            prePlayable     = currentPlayable;
            currentAnim     = anim_box;
            currentPlayable = AnimationClipPlayable.Create(graph, anim_box.clip);
            mixer.ConnectInput(1, prePlayable, 0);
            mixer.ConnectInput(0, currentPlayable, 0);
            once = false;
            return(true);
        }