public void SetData(LineContext context, TimelineData data, float timeScale) { this.context = context; this.data = data; realTimeLength = data.TimeLength * timeScale; for (int i = 0; i < data.Tracks.Count; ++i) { Trackline trackline = new Trackline(); trackline.SetData(context, data.Tracks[i], timeScale); tracks.Add(trackline); } }
// Use this for initialization IEnumerator Start() { // Wait three frames after there's an actual spill defined before continuing. while(GameObject.FindWithTag("Spill") == null) { yield return 0; } yield return 0; yield return 0; yield return 0; // Set our focal point to the spill, but the point at sea-level of the spill mainPos = GameObject.FindWithTag("Spill").transform.position; mainPos.y = 0.0f; dist = 5.0f; // Set the size of the orthographic view to either 25, or the magnitude of the bounding box's size of the spill. Whichever's biggest. GetComponent<Camera>().orthographicSize = Mathf.Max(GameObject.FindWithTag("Spill").renderer.bounds.size.magnitude,25.0f); // Set the trackline reference. lineRef = GetComponent<Trackline>(); }