remove unused onValidate, rename regenerate point method

This commit is contained in:
Xevion
2020-05-06 13:35:44 -05:00
parent 0dbbebb975
commit 40af3d68bf
2 changed files with 2 additions and 16 deletions

View File

@@ -33,22 +33,8 @@ public class PointRendering : MonoBehaviour {
private int _retryAttempts;
public List<Vector2> points;
public void OnValidate() {
Debug.Log("Firing onValidate!");
// Check to see if point position related values changed. SphereSize is rendering only, so we ignore it.
if (numPoints != _prevNumPoints || _prevRegionSize != regionSize
|| samplingMethod != _samplingMethod || radius != _radius || retryAttempts != _retryAttempts) {
// Update the property tracking values
_prevNumPoints = numPoints;
_prevRegionSize = regionSize;
_samplingMethod = samplingMethod;
_radius = radius;
_retryAttempts = retryAttempts;
}
}
public void regeneratePoints() {
public void RegeneratePoints() {
switch (samplingMethod) {
case SamplingTypes.Random:
points = PointGeneration.random_sampling(numPoints, regionSize);

View File

@@ -59,7 +59,7 @@ public class SamplingEditor : Editor {
// Handling for different types of point sampling methods
if (regenerate) {
float t1 = Time.realtimeSinceStartup;
points.regeneratePoints();
points.RegeneratePoints();
float t2 = Time.realtimeSinceStartup;
this._message = $"{points.points.Count:n0} points in {t2 - t1:0.0000}s";
}