private void Build() { if (!graph.IsValid()) { timelineRoot = new GameObject("timeline"); graph = PlayableGraph.Create("TimelineGraph"); } var tracksData = config.tracks; int len = tracksData.Length; trackTrees = new XTrack[len]; for (int i = 0; i < len; i++) { trackTrees[i] = XTimelineFactory.GetTrack(tracksData[i], this); if (i >= 0 && i == config.skillHostTrack) { SkillHostTrack = trackTrees[i]; } } prev = 0; if (graph.IsValid()) { if (Application.isPlaying) { graph.SetTimeUpdateMode(DirectorUpdateMode.GameTime); graph.Play(); editMode = TimelinePlayMode.RealRunning; } } _duration = RecalcuteDuration(); }
public void Initial(TrackData data, XTimeline tl, XTrack parent) { this.data = data; this.timeline = tl; this.parent = parent; if (data != null) { if (data.clips != null) { int len = data.clips.Length; clips = new IClip[len]; for (int i = 0; i < len; i++) { clips[i] = BuildClip(data.clips[i]); } } if (data.marks != null) { int len = data.marks.Length; marks = new XMarker[len]; for (int i = 0; i < len; i++) { marks[i] = XTimelineFactory.GetMarker(this, data.marks[i]); } } if (data.childs != null) { int len = data.childs.Length; childs = new XTrack[len]; for (int i = 0; i < len; i++) { childs[i] = XTimelineFactory.GetTrack(data.childs[i], timeline, this); } } } OnPostBuild(); }
public override XTrack Clone() { return(XTimelineFactory.GetTrack(data, timeline, parent)); }
public override XTrack Clone() { TrackData data = CloneData(); return(XTimelineFactory.GetTrack(data, timeline, parent)); }