Skip to content

Commit cb4a7f0

Browse files
committed
added search to groups view
1 parent e692e7d commit cb4a7f0

2 files changed

Lines changed: 11 additions & 1 deletion

File tree

Editor/GroupTreeView.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,11 @@ class GroupItem : BaseItem
6666
{
6767
public BuildLayout.Group source;
6868

69+
public GroupItem()
70+
{
71+
supportsSearch = true;
72+
}
73+
6974
public override int CompareTo(TreeViewItem other, int column)
7075
{
7176
var otherItem = other as GroupItem;

Editor/GroupsView.cs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,14 @@ namespace Oddworm.EditorFramework.BuildLayoutExplorer
1414
public class GroupsView : BuildLayoutView
1515
{
1616
[SerializeField] BuildLayoutTreeView m_TreeView;
17+
SearchField m_SearchField;
1718

1819
public override void Awake()
1920
{
2021
base.Awake();
2122

2223
m_TreeView = new GroupTreeView(window);
24+
m_SearchField = new SearchField(window);
2325
}
2426

2527
public override void Rebuild(BuildLayout buildLayout)
@@ -39,7 +41,10 @@ public override void OnToolbarGUI()
3941
{
4042
base.OnToolbarGUI();
4143

42-
GUILayout.FlexibleSpace();
44+
GUILayout.Space(10);
45+
46+
if (m_SearchField.OnToolbarGUI(GUILayout.ExpandWidth(true)))
47+
m_TreeView.searchString = m_SearchField.text;
4348
}
4449
}
4550
}

0 commit comments

Comments
 (0)