private void DrawRemoveCurveButton() { if (GUILayout.Button("Remove Curve")) { Undo.RecordObject(spline, "Remove Curve"); spline.RemovePoint(selectedIndex); EditorUtility.SetDirty(spline); } }