Points uniformly spread on bézier curve should be functional.

This commit is contained in:
William Moberg
2016-05-26 15:16:23 +02:00
parent fc764b4ec2
commit abffff6482
2 changed files with 19 additions and 13 deletions
+2 -2
View File
@@ -21,14 +21,14 @@ public class WarehouseColumn : MonoBehaviour {
void Update() {
if (Application.isPlaying) {
//offset += Time.deltaTime;
//Offset += Time.deltaTime * 4;
}
foreach (Transform row in rows) {
var i = row.GetSiblingIndex();
var distance = (float)i / (rows.childCount) * curve.length + Offset;
distance = Mathf.Repeat(distance, curve.length);
var pos = curve.GetPointAtDistance(distance);
var pos = curve.GetUniformPointAtDistance(distance);
row.position = pos;
}
}