void updateDataSeries() { for (int i = 0; i < numDataSeries; i++) { if (dataSeries.Count <= i) { WMG_Series aSeries = addSeriesAt(numGrids + i); aSeries.connectFirstToLast = true; aSeries.hidePoints = true; dataSeries.Add(aSeries); } if (dataSeriesColors.Count <= i) { dataSeriesColors.AddNoCb(new Color(Random.Range(0f, 1f), Random.Range(0f, 1f), Random.Range(0f, 1f), 1), ref _dataSeriesColors); } } for (int i = dataSeries.Count - 1; i >= 0; i--) { if (dataSeries[i] != null && i >= numDataSeries) { deleteSeriesAt(numGrids + i); dataSeries.RemoveAt(i); } } for (int i = dataSeriesColors.Count - 1; i >= 0; i--) { if (i >= numDataSeries) { dataSeriesColors.RemoveAtNoCb(i, ref _dataSeriesColors); } } for (int i = 0; i < numDataSeries; i++) { WMG_Series aSeries = lineSeries[i + numGrids].GetComponent <WMG_Series>(); if (randomData) { aSeries.pointValues.SetList(WMG_Util.GenRadar(WMG_Util.GenRandomList(numPoints, radarMinVal, radarMaxVal), offset.x, offset.y, degreeOffset)); } aSeries.lineScale = dataSeriesLineWidth; aSeries.linePadding = dataSeriesLineWidth; aSeries.lineColor = dataSeriesColors[i]; } }
void updateLabels() { if (!createdLabels) { WMG_Series labels = addSeriesAt(numDataSeries + numGrids); labels.hideLines = true; createdLabels = true; labels.pointPrefab = 3; radarLabels = labels; } for (int i = 0; i < numPoints; i++) { if (labelStrings.Count <= i) { labelStrings.AddNoCb("", ref _labelStrings); } } for (int i = labelStrings.Count - 1; i >= 0; i--) { if (labelStrings[i] != null && i >= numPoints) { labelStrings.RemoveAtNoCb(i, ref _labelStrings); } } radarLabels.hidePoints = hideLabels; radarLabels.pointValues.SetList(WMG_Util.GenCircular(numPoints, offset.x, offset.y, labelsOffset + (radarMaxVal - radarMinVal), degreeOffset)); List <GameObject> labelGOs = radarLabels.getPoints(); for (int i = 0; i < labelGOs.Count; i++) { if (i >= numPoints) { break; } changeLabelFontSize(labelGOs[i], fontSize); changeLabelText(labelGOs[i], labelStrings[i]); } radarLabels.pointColor = labelsColor; }