public override void OnInspectorGUI() { SetRefs(); if (selectedIndex >= 0 && selectedIndex < curve.ControlPointCount) { DrawSelectedPointInspector(); Repaint(); } // Todo: custom array to allow moving point ordor if (GUILayout.Button("Add Spline")) { Undo.RecordObject(curve, "Add Spline"); curve.AddSpline(); SceneView.RepaintAll(); EditorUtility.SetDirty(curve); } if (curve.Splines > 1) { if (GUILayout.Button("Remove Spline")) { Undo.RecordObject(curve, "Remove Spline"); curve.RemoveSpline(); SceneView.RepaintAll(); EditorUtility.SetDirty(curve); } } if (GUILayout.Button("Reset")) { Undo.RecordObject(curve, "Reset"); curve.Reset(); SceneView.RepaintAll(); } }