Skip to content

Commit b0980bb

Browse files
committed
If RuntimeHierarchy's selection is deselected, its Connected Inspector will also stop inspecting
1 parent 40819bc commit b0980bb

File tree

3 files changed

+4
-10
lines changed

3 files changed

+4
-10
lines changed

Plugins/RuntimeInspector/README.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
= Runtime Inspector & Hierarchy (v1.7.1) =
1+
= Runtime Inspector & Hierarchy (v1.7.2) =
22

33
Documentation: https://github.com/yasirkula/UnityRuntimeInspector
44
FAQ: https://github.com/yasirkula/UnityRuntimeInspector#faq

Plugins/RuntimeInspector/Scripts/RuntimeHierarchy.cs

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1424,14 +1424,8 @@ private void OnCurrentSelectionChanged( bool dontRaiseEvent = false )
14241424

14251425
if( m_connectedInspector )
14261426
{
1427-
for( int i = m_currentSelection.Count - 1; i >= 0; i-- )
1428-
{
1429-
if( m_currentSelection[i] )
1430-
{
1431-
m_connectedInspector.Inspect( m_currentSelection[i].gameObject );
1432-
break;
1433-
}
1434-
}
1427+
Transform newInspectedObject = m_currentSelection.FindLast( ( transform ) => transform != null );
1428+
m_connectedInspector.Inspect( ( newInspectedObject != null ) ? newInspectedObject.gameObject : null );
14351429
}
14361430

14371431
if( OnSelectionChanged != null && !dontRaiseEvent )

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "com.yasirkula.runtimeinspector",
33
"displayName": "Runtime Inspector & Hierarchy",
4-
"version": "1.7.1",
4+
"version": "1.7.2",
55
"documentationUrl": "https://github.com/yasirkula/UnityRuntimeInspector",
66
"changelogUrl": "https://github.com/yasirkula/UnityRuntimeInspector/releases",
77
"licensesUrl": "https://github.com/yasirkula/UnityRuntimeInspector/blob/master/LICENSE.txt",

0 commit comments

Comments
 (0)