move random sampling method into separate class, general cleanup, update .gitignore with less

This commit is contained in:
Xevion
2020-05-05 10:00:40 -05:00
parent 243650a4bc
commit fb0756e622

View File

@@ -0,0 +1,17 @@
using System.Collections.Generic;
using UnityEngine;
public class PointGeneration {
public static List<Vector2> random_sampling(int numPoints, Vector2 range, Vector2 offset) {
// Create a new empty list of points, and add some randomly
List<Vector2> points = new List<Vector2>();
for (int i = 0; i < numPoints; i++) {
points.Add(
new Vector2(
Random.Range(-range.x, range.x),
Random.Range(-range.y, range.y)));
}
return points;
}
}