您最多选择25个主题
主题必须以中文或者字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符
38 行
834 B
38 行
834 B
using UnityEngine;
|
|
using System.Collections;
|
|
using UnityEditor;
|
|
|
|
namespace BoatAttack
|
|
{
|
|
[CustomEditor(typeof(WaypointGroup))]
|
|
public class WaypointGroupEditor : Editor
|
|
{
|
|
|
|
public override void OnInspectorGUI()
|
|
{
|
|
DrawDefaultInspector();
|
|
|
|
WaypointGroup WPG = (WaypointGroup)target;
|
|
|
|
if (GUILayout.Button("Drop Waypoint"))
|
|
{
|
|
WPG.CreateWaypoint();
|
|
}
|
|
|
|
if (GUILayout.Button("Delete Last Waypoint"))
|
|
{
|
|
WPG.DeleteLastWaypoint();
|
|
}
|
|
|
|
if (GUILayout.Button("Delete All Waypoints"))
|
|
{
|
|
WPG.DeleteAllWaypoints();
|
|
}
|
|
|
|
if (GUI.changed)
|
|
{
|
|
EditorUtility.SetDirty(target);
|
|
}
|
|
}
|
|
}
|
|
}
|