65 lines
1.9 KiB
C#
65 lines
1.9 KiB
C#
|
|
#if UNITY_EDITOR
|
|
using Script.EditorScript;
|
|
|
|
using UnityEditor;
|
|
|
|
using UnityEngine;
|
|
[ExecuteInEditMode]
|
|
public class ExtendedEditorWindow : EditorWindow
|
|
{
|
|
[MenuItem("Window/Tool UI")]
|
|
public static void ShowWindow()
|
|
{
|
|
GetWindow<ExtendedEditorWindow>("Tool UI");
|
|
}
|
|
|
|
void OnGUI()
|
|
{
|
|
GUILayout.Label("This is an extended editor window", EditorStyles.boldLabel);
|
|
|
|
if (GUILayout.Button("生成棋盘模板"))
|
|
{
|
|
GameObject back = GameObject.Find("Board");
|
|
BackBroadEditor board = back.GetComponent<BackBroadEditor>();
|
|
board.GenerateBoard();
|
|
}
|
|
|
|
if (GUILayout.Button("生成箱子"))
|
|
{
|
|
GameObject back = GameObject.Find("Box");
|
|
BoxBroadEditor board = back.GetComponent<BoxBroadEditor>();
|
|
board.GenerateBoard();
|
|
}
|
|
|
|
//if (GUILayout.Button("生成模板数据"))
|
|
//{
|
|
// GameObject tempObj = GameObject.Find("RandomPropsTemp");
|
|
// RandomPropsTemp temp = tempObj.GetComponent<RandomPropsTemp>();
|
|
// temp.GenerateTempData();
|
|
//}
|
|
|
|
if (GUILayout.Button("导出数据"))
|
|
{
|
|
GameObject tempObj = GameObject.Find("RandomPropsTemp");
|
|
RandomPropsTemp temp = tempObj.GetComponent<RandomPropsTemp>();
|
|
temp.GenerateTempData();
|
|
Debug.LogError("模板生成结束");
|
|
|
|
GameObject init = GameObject.Find("Init");
|
|
ClampEditorController board = init.GetComponent<ClampEditorController>();
|
|
board.ExportData();
|
|
|
|
Debug.LogError("导出数据结束");
|
|
}
|
|
if (GUILayout.Button("检查数据"))
|
|
{
|
|
GameObject init = GameObject.Find("Init");
|
|
ClampEditorController board = init.GetComponent<ClampEditorController>();
|
|
board.CheckData();
|
|
|
|
Debug.LogError("检查数据结束");
|
|
}
|
|
}
|
|
}
|
|
#endif |