0.3.0: Added history list

This commit is contained in:
Anders Ejlersen 2021-02-14 13:49:25 +01:00
parent 1e1736f94a
commit 9b73200c73
38 changed files with 662 additions and 18 deletions

View file

@ -0,0 +1,41 @@
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);
}
}
}