yasirkula / UnityBezierSolution

A bezier spline solution for Unity 3D with some utility functions (like travelling the spline with constant speed/time)

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Reset of a spline doesn't remove all the points

aprouzeau opened this issue · comments

Hi,

When I tried to reset the spline by using "Initialize" with a number of points lower than the previous spline, it didn't remove all the previous points and I ended up with too much point.

I had to manually remove of add the appropriate number of points:

if(spline.Count > newRendPoint.Length)
{
    for(int i= prevLength-1; i>= newRendPoint.Length; i--)
    {
        spline.RemovePointAt(i);
    }
}
else if(spline.Count < newRendPoint.Length)
{
    for (int i = prevLength; i < newRendPoint.Length; i++)
    {
        spline.InsertNewPointAt(i);
    }
}

72e83c7 should resolve this issue.

Now the update is live on Asset Store, as well.