IndieGame/client/Assets/Scripts/Config/Table/Editor/TableEditorWindow.cs

50 lines
1.4 KiB
C#

using System.Linq;
using Sirenix.Utilities.Editor;
using UnityEditor;
using UnityEngine;
namespace Ether
{
public class TableEditorWindow : OdinWindowBase<TableEditorWindow>
{
[MenuItem("配置/表格配置 %t")]
private static void OpenWindow()
{
var window = GetWindow<TableEditorWindow>();
window.titleContent = new GUIContent("表格配置");
TableProvider.ResetCounter();
}
protected override void OnInit()
{
DrawSearchToolbar = true;
AddSubWindow<PropItemTableWindow>("道具配置");
AddSubWindow<PropItemTableWindow>("道具配置/道具列表");
}
protected override void OnBeginDrawEditors()
{
var selected = this.MenuTree.Selection.FirstOrDefault();
var toolbarHeight = this.MenuTree.Config.SearchToolbarHeight;
// Draws a toolbar with the name of the currently selected menu item.
SirenixEditorGUI.BeginHorizontalToolbar(toolbarHeight);
{
if (selected != null)
{
GUILayout.Label(selected.Name);
}
// if (SirenixEditorGUI.ToolbarButton(new GUIContent("Create Item")))
// {
//
// }
}
SirenixEditorGUI.EndHorizontalToolbar();
}
}
}