private DynamicPlotter GetPlotter(TimeSeriesGraph graph, string name) { GameObject plot = new GameObject(); DynamicPlotter plotter = plot.AddComponent <DynamicPlotter>(); plotter.Graph = graph; Debug.Log("Graph is assigned"); plotter.PointHolder = plot; Transform dataPoint = GameObject.CreatePrimitive(PrimitiveType.Sphere).transform; //dataPoint.gameObject.AddComponent<TrailRenderer>(); plotter.PointPrefab = dataPoint; Destroy(dataPoint.gameObject); GameObject text = new GameObject(); text.AddComponent <TextMesh>(); plotter.Text = text; plotter.PlotTitle = name; plotter.XAxisName = "X-Axis"; plotter.YAxisName = "Y-Axis"; plotter.ZAxisName = "Z-Axis"; plotter.Init(); return(plotter); }
private void Awake() { //TimeSeriesGraph sineGraph = CreateSineGraph(); TimeSeriesGraph droneGraph = CreateDroneGraph(); Debug.Log(droneGraph.LogMax()); Debug.Log(droneGraph.LogMid()); Debug.Log(droneGraph.LogMin()); //DynamicPlotter sinePlotter = GetPlotter(sineGraph, "Sine Graph"); DynamicPlotter dronePlotter = GetPlotter(droneGraph, "Drone Graph"); }