44 lines
1.2 KiB
C#
44 lines
1.2 KiB
C#
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
using UnityEditor;
|
|
|
|
namespace AibisDream
|
|
{
|
|
[CustomEditor(typeof(BlockPuzzleSystem))]
|
|
public class BlockPuzzleEditor : Editor
|
|
{
|
|
private string _shapeKey;
|
|
|
|
public override void OnInspectorGUI()
|
|
{
|
|
base.OnInspectorGUI();
|
|
var example = (BlockPuzzleSystem)target;
|
|
EditorGUILayout.BeginHorizontal();
|
|
if (GUILayout.Button("加载"))
|
|
{
|
|
example.LoadConfig();
|
|
}
|
|
if (GUILayout.Button("应用"))
|
|
{
|
|
example.ApplyConfig();
|
|
}
|
|
if (GUILayout.Button("保存"))
|
|
{
|
|
example.SaveConfig();
|
|
}
|
|
EditorGUILayout.EndHorizontal();
|
|
|
|
EditorGUILayout.Space();
|
|
GUILayout.Label("创建图形");
|
|
EditorGUILayout.BeginHorizontal();
|
|
_shapeKey = EditorGUILayout.TextField("形状名称", _shapeKey);
|
|
if (GUILayout.Button("创建"))
|
|
{
|
|
example.CreateShapeInEditor(_shapeKey);
|
|
}
|
|
EditorGUILayout.EndHorizontal();
|
|
}
|
|
}
|
|
}
|