|
|
@ -21,6 +21,19 @@ public class Lighthouse : MonoBehaviour |
|
|
|
{ |
|
|
|
splineCursor = splineCurve.GetComponent<BGCcCursor>(); |
|
|
|
|
|
|
|
if (splineDistantPoints == null || splineDistantPoints.Count == 0) |
|
|
|
{ |
|
|
|
splineDistantPoints.Add(0f); |
|
|
|
for (int i=1; i<splineCurve.PointsCount; i++) |
|
|
|
{ |
|
|
|
BGCurvePointI point = splineCurve.Points[i]; |
|
|
|
float distance = 0f; |
|
|
|
splineCursor.Math.CalcPositionByClosestPoint(point.PositionLocal, out distance); |
|
|
|
splineDistantPoints.Add(distance); |
|
|
|
} |
|
|
|
splineDistantPoints.Add(splineCursor.Math.GetDistance()); |
|
|
|
} |
|
|
|
splineCursor.Distance = 0f; |
|
|
|
moveToNextPoint(); |
|
|
|
} |
|
|
|
|
|
|
|