mirror of
https://github.com/Xevion/procedural-placement.git
synced 2025-12-06 11:16:01 -06:00
remove unused onValidate, rename regenerate point method
This commit is contained in:
@@ -33,22 +33,8 @@ public class PointRendering : MonoBehaviour {
|
|||||||
private int _retryAttempts;
|
private int _retryAttempts;
|
||||||
|
|
||||||
public List<Vector2> points;
|
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) {
|
switch (samplingMethod) {
|
||||||
case SamplingTypes.Random:
|
case SamplingTypes.Random:
|
||||||
points = PointGeneration.random_sampling(numPoints, regionSize);
|
points = PointGeneration.random_sampling(numPoints, regionSize);
|
||||||
|
|||||||
@@ -59,7 +59,7 @@ public class SamplingEditor : Editor {
|
|||||||
// Handling for different types of point sampling methods
|
// Handling for different types of point sampling methods
|
||||||
if (regenerate) {
|
if (regenerate) {
|
||||||
float t1 = Time.realtimeSinceStartup;
|
float t1 = Time.realtimeSinceStartup;
|
||||||
points.regeneratePoints();
|
points.RegeneratePoints();
|
||||||
float t2 = Time.realtimeSinceStartup;
|
float t2 = Time.realtimeSinceStartup;
|
||||||
this._message = $"{points.points.Count:n0} points in {t2 - t1:0.0000}s";
|
this._message = $"{points.points.Count:n0} points in {t2 - t1:0.0000}s";
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user