public static XTrack GetTrack(TrackData data, XTimeline tl, XTrack parent = null) { XTrack xTrack = null; switch (data.type) { case AssetType.Marker: xTrack = SharedPool <XMarkerTrack> .Get(); break; case AssetType.Animation: xTrack = SharedPool <XAnimationTrack> .Get(); break; case AssetType.BoneFx: xTrack = SharedPool <XBoneFxTrack> .Get(); break; case AssetType.SceneFx: xTrack = SharedPool <XSceneFxTrack> .Get(); break; case AssetType.PostProcess: xTrack = SharedPool <XPostprocessTrack> .Get(); break; case AssetType.Transform: xTrack = SharedPool <XTransformTrack> .Get(); break; case AssetType.LogicValue: xTrack = SharedPool <XLogicTrack> .Get(); break; case AssetType.Group: xTrack = SharedPool <XGroupTrack> .Get(); break; default: Debug.LogError("unknown track " + data.type); break; } if (xTrack) { xTrack.Initial(data, tl, parent); } return(xTrack); }
public void Start() { Application.targetFrameRate = 30; if (Application.isPlaying) { timeline = new XTimeline(path, PlayMode.Plot); timeline.SetPlaying(true); } play = true; }
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(); }