private void DrawAddCurveButton() { if (GUILayout.Button("Add Curve")) { Undo.RecordObject(spline, "Add Curve"); spline.AddCurve(selectedIndex); EditorUtility.SetDirty(spline); } }