Пример #1
0
        //Create and return the track mixer playable
        Playable CreateClipsMixer(PlayableGraph graph)
        {
            var clipActions = clips.OfType <PlayAnimatorClip>().ToList();

            ports      = new Dictionary <PlayAnimatorClip, int>();
            clipsMixer = AnimationMixerPlayable.Create(graph, clipActions.Count, true);
            for (var i = 0; i < clipActions.Count; i++)
            {
                var playAnimClip = clipActions[i];
                var clipPlayable = AnimationClipPlayable.Create(graph, playAnimClip.animationClip);
                clipPlayable.SetApplyFootIK(applyFootIK && isMasterTrack);
                graph.Connect(clipPlayable, 0, clipsMixer, i);
                clipsMixer.SetInputWeight(i, 0f);
                ports[playAnimClip] = i;
            }

            //need pause clips.
            clipsMixer.Pause();
            return(clipsMixer);
        }