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

64 lines
1.9 KiB
C#

using Sirenix.OdinInspector.Editor;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using Sirenix.OdinInspector.Demos.RPGEditor;
using Sirenix.Utilities.Editor;
using UnityEditor;
using UnityEngine;
namespace Ether
{
public class TableEditorWindow : OdinMenuEditorWindow
{
[MenuItem("配置/表格配置 %t")]
private static void OpenWindow()
{
var window = GetWindow<TableEditorWindow>();
window.titleContent = new GUIContent("表格配置");
}
private PropItemTableWindow propItemTableWindow;
protected override OdinMenuTree BuildMenuTree()
{
var tree = new OdinMenuTree();
tree.Selection.SupportsMultiSelect = false;
tree.Config.DrawSearchToolbar = true;
if (propItemTableWindow == null)
{
propItemTableWindow = new PropItemTableWindow();
}
tree.Add("道具配置", propItemTableWindow);
tree.Add("道具配置/道具列表", propItemTableWindow);
return tree;
}
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();
}
}
}