public override Playable CreatePlayable(PlayableGraph graph, GameObject go) { bool autoRebalance = false; bool createOutputs = graph.GetPlayableCount() == 0; ScriptPlayable <TimelinePlayable> playable = TimelinePlayable.Create(graph, this.GetOutputTracks(), go, autoRebalance, createOutputs); return((!playable.IsValid <ScriptPlayable <TimelinePlayable> >()) ? Playable.Null : playable); }
/// <summary> /// Creates an instance of the timeline /// </summary> /// <param name="graph">PlayableGraph that will own the playable</param> /// <param name="go">The gameobject that triggered the graph build</param> /// <returns>The Root Playable of the Timeline</returns> public override Playable CreatePlayable(PlayableGraph graph, GameObject go) { bool autoRebalanceTree = false; #if UNITY_EDITOR autoRebalanceTree = true; #endif // only create outputs if we are not nested bool createOutputs = graph.GetPlayableCount() == 0; var timeline = TimelinePlayable.Create(graph, GetOutputTracks(), go, autoRebalanceTree, createOutputs); timeline.SetPropagateSetTime(true); return(timeline.IsValid() ? timeline : Playable.Null); }