32 lines
850 B
C#
32 lines
850 B
C#
using ActionRPG.Splines;
|
|
using UnityEditor;
|
|
using UnityEngine;
|
|
|
|
namespace ActionRPG.Editor
|
|
{
|
|
[CustomEditor(typeof(SplineObjectPlacer))]
|
|
public class SplineObjectPlacerEditor : UnityEditor.Editor
|
|
{
|
|
public override void OnInspectorGUI()
|
|
{
|
|
DrawDefaultInspector();
|
|
|
|
SplineObjectPlacer placer = (SplineObjectPlacer)target;
|
|
|
|
EditorGUILayout.Space(6);
|
|
|
|
if (GUILayout.Button("Regenerate", GUILayout.Height(30)))
|
|
{
|
|
Undo.RecordObject(placer.gameObject, "Regenerate Spline Objects");
|
|
placer.Regenerate();
|
|
}
|
|
|
|
if (GUILayout.Button("Clear", GUILayout.Height(24)))
|
|
{
|
|
Undo.RecordObject(placer.gameObject, "Clear Spline Objects");
|
|
placer.Clear();
|
|
}
|
|
}
|
|
}
|
|
}
|