// Computes the min and max magnitudes public void UpdateCharacteristics(Formula.Function function) { if (function == Formula.Function.None) { foreach (Coordinate d in data.Keys) { foreach (Coordinate c in data[d].points.Keys) { if (this.minMagnitude > this.data [d].points [c]) { this.minMagnitude = this.data [d].points [c]; } if (this.maxMagnitude < this.data [d].points [c]) { this.maxMagnitude = this.data [d].points [c]; } } } } else { this.minMagnitude = -0.5f; this.maxMagnitude = 0.5f; } }
public void Initialize(Data dataHandler, Formula.Function function) { foreach (Transform t in gameObject.transform) { if (t.name == "Graph") { graph = t; } if (t.name == "Grid") { grid = t; } } gridManager = grid.GetComponent <GridManager> (); this.dataHandler = dataHandler; this.data = this.dataHandler.data; this.function = function; UpdateGrapherRatio(); gridManager.Initialize(dataHandler); }