0 votes
by
edited by
Hi.

I have a very long road and willing to fill the spline.cs with that road markers in runtime.

CSV is very heavy to handle through a remote dedicated server.

Is there a way through the API to fill the splineline points in spline.cs with another data than CSV? json, txt, array, list?

Thanks,

Joan

1 Answer

+1 vote
by
 
Best answer

The points in Spline.cs is just an array of Spline.Point class:

public Point[] points = new Point[0];

Where Spline.Point is declared inside the Spline class as:

You may create and populate an array of Spline.Point yourself, then assign it to Spline.points. Unless you're using custom tangents, you only need to specify Point.position in each point. Those other non-serialized fields are for internal use.

You need to call Spline.Refresh() after changing the points or any other setting in the Spline class.

by
That's perfect.
Thank you very much
...