private static bool RemoveKeyPointAt(BezierCurve3D curve, int index)
{
if (curve.KeyPointsCount < 2)
{
return false;
}
var point = curve.KeyPoints[index];
Undo.IncrementCurrentGroup();
Undo.RegisterCompleteObjectUndo(curve, "Save Curve");
curve.KeyPoints.RemoveAt(index);
RenamePoints(curve);
//Undo.RegisterCompleteObjectUndo(curve, "Save Curve");
Undo.DestroyObjectImmediate(point.gameObject);
return true;
}