public static PlayableGraph BuildPlayableGraph(Animator animator, IList <IRigLayer> layers, SyncSceneToStreamLayer syncSceneToStreamLayer) { string graphName = animator.gameObject.transform.name + "_Rigs"; PlayableGraph graph = PlayableGraph.Create(graphName); graph.SetTimeUpdateMode(DirectorUpdateMode.GameTime); IEnumerable <PlayableChain> playableChains = BuildPlayables(animator, graph, layers, syncSceneToStreamLayer); foreach (var chain in playableChains) { if (!chain.IsValid()) { continue; } AnimationPlayableOutput output = AnimationPlayableOutput.Create(graph, String.Format("%1-Output", chain.name), animator); output.SetAnimationStreamSource(AnimationStreamSource.PreviousInputs); output.SetSortingOrder(k_AnimationOutputPriority); // Connect last rig playable to output output.SetSourcePlayable(chain.playables[chain.playables.Length - 1]); } return(graph); }