void DrawAddButton() { if (GUILayout.Button("Extend")) { Undo.RegisterCreatedObjectUndo(_target.AddAnchors(1) [0], "Extend Spline"); } }