void updateDataSeries() { if (dataSeriesChanged || graphChanged) { for (int i = 0; i < numDataSeries; i++) { if (dataSeries.Count <= i) { WMG_Series aSeries = theGraph.addSeriesAt(numGrids + i); aSeries.connectFirstToLast = true; aSeries.hidePoints = true; dataSeries.Add(aSeries); } if (dataSeriesColors.Count <= i) { dataSeriesColors.Add(new Color(Random.Range(0f, 1f), Random.Range(0f, 1f), Random.Range(0f, 1f), 1)); } } for (int i = dataSeries.Count - 1; i >= 0; i--) { if (dataSeries[i] != null && i >= numDataSeries) { theGraph.deleteSeriesAt(numGrids + i); dataSeries.RemoveAt(i); } } for (int i = dataSeriesColors.Count - 1; i >= 0; i--) { if (i >= numDataSeries) { dataSeriesColors.RemoveAt(i); } } for (int i = 0; i < numDataSeries; i++) { WMG_Series aSeries = theGraph.lineSeries[i + numGrids].GetComponent <WMG_Series>(); if (randomData) { aSeries.pointValues = theGraph.GenRadar(theGraph.GenRandomList(numPoints, radarMinVal, radarMaxVal), offset.x, offset.y, degreeOffset); } aSeries.lineScale = dataSeriesLineWidth; aSeries.linePadding = dataSeriesLineWidth; aSeries.lineColor = dataSeriesColors[i]; } } }