41 lines
1.1 KiB
C#
41 lines
1.1 KiB
C#
using System;
|
|
using UnityEditor;
|
|
using UnityEngine;
|
|
|
|
namespace Game.NavigationTool.Editor.History
|
|
{
|
|
[Serializable]
|
|
internal sealed class EditorHistoryViewTools : AbstractEditorHistoryView
|
|
{
|
|
public string searchStr = string.Empty;
|
|
|
|
[NonSerialized]
|
|
private HistoryList historyList;
|
|
|
|
public override void Initialize()
|
|
{
|
|
historyList = HistoryUtility.GetHistoryList();
|
|
}
|
|
|
|
public override void Draw(EditorHistoryWindow window, Rect rect, Styles styles)
|
|
{
|
|
const float BUTTON_SIZE = 50.0f;
|
|
|
|
GUI.BeginGroup(rect, styles.toolbox);
|
|
{
|
|
var r0 = new Rect(0.0f, 0.0f, rect.width - BUTTON_SIZE, rect.height);
|
|
var r1 = new Rect(r0.xMax, 0.0f, BUTTON_SIZE, rect.height);
|
|
searchStr = EditorGUI.TextField(r0, searchStr);
|
|
|
|
if (GUI.Button(r1, "Clear"))
|
|
historyList.Clear();
|
|
}
|
|
GUI.EndGroup();
|
|
}
|
|
|
|
public bool IsSearching()
|
|
{
|
|
return !string.IsNullOrEmpty(searchStr);
|
|
}
|
|
}
|
|
} |