Skip to content

Commit 513d882

Browse files
committed
RuntimeHierarchy.Select now works in search mode, as well
1 parent e0c1753 commit 513d882

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

Plugins/RuntimeInspector/Scripts/RuntimeHierarchy.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -747,12 +747,15 @@ public bool Select( Transform selection, bool forceSelection = false )
747747

748748
// Make sure that the contents of the hierarchy are up-to-date
749749
Refresh();
750+
RefreshSearchResults();
750751

751752
Scene selectionScene = selection.gameObject.scene;
753+
List<HierarchyDataRoot> sceneData = m_isInSearchMode ? searchSceneData : this.sceneData;
754+
752755
for( int i = 0; i < sceneData.Count; i++ )
753756
{
754757
HierarchyDataRoot data = sceneData[i];
755-
if( ( data is HierarchyDataRootPseudoScene ) || ( (HierarchyDataRootScene) data ).Scene == selectionScene )
758+
if( m_isInSearchMode || ( data is HierarchyDataRootPseudoScene ) || ( (HierarchyDataRootScene) data ).Scene == selectionScene )
756759
{
757760
HierarchyDataTransform selectionItem = sceneData[i].FindTransform( selection );
758761
if( selectionItem != null )

Plugins/RuntimeInspector/Scripts/RuntimeHierarchy/HierarchyData.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,7 @@ public HierarchyDataTransform FindTransform( Transform target, Transform nextInP
219219
bool isInitSearch = nextInPath == null;
220220
if( isInitSearch )
221221
{
222-
nextInPath = target.root;
222+
nextInPath = ( this is HierarchyDataRootSearch ) ? target : target.root;
223223
( (HierarchyDataRoot) this ).RefreshContent();
224224
}
225225

0 commit comments

Comments
 (0)