From 7738da9d196e153830d7009f09dff9c5c242875e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=BCleyman=20Yasir=20KULA?= Date: Wed, 23 Sep 2020 23:12:47 +0300 Subject: [PATCH] "Search for References-Include Children" didn't include inactive child objects in search, fixed --- Plugins/AssetUsageDetector/Editor/AssetUsageDetectorWindow.cs | 4 ++-- Plugins/AssetUsageDetector/Editor/ObjectToSearch.cs | 2 +- package.json | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Plugins/AssetUsageDetector/Editor/AssetUsageDetectorWindow.cs b/Plugins/AssetUsageDetector/Editor/AssetUsageDetectorWindow.cs index 4031f5d..01e6169 100644 --- a/Plugins/AssetUsageDetector/Editor/AssetUsageDetectorWindow.cs +++ b/Plugins/AssetUsageDetector/Editor/AssetUsageDetectorWindow.cs @@ -153,8 +153,8 @@ namespace AssetUsageDetectorNamespace } // Show the menu item only if there is a selection in the Editor - [MenuItem( "GameObject/Search for References", validate = true )] - [MenuItem( "GameObject/Search for References (Include Children)", validate = true )] + [MenuItem( "GameObject/Search for References/This Object Only", validate = true )] + [MenuItem( "GameObject/Search for References/Include Children", validate = true )] [MenuItem( "Assets/Search for References", validate = true )] private static bool SearchSelectedAssetReferencesValidate( MenuCommand command ) { diff --git a/Plugins/AssetUsageDetector/Editor/ObjectToSearch.cs b/Plugins/AssetUsageDetector/Editor/ObjectToSearch.cs index 8867dc0..62f1160 100644 --- a/Plugins/AssetUsageDetector/Editor/ObjectToSearch.cs +++ b/Plugins/AssetUsageDetector/Editor/ObjectToSearch.cs @@ -65,7 +65,7 @@ namespace AssetUsageDetectorNamespace // If this is a scene object, add its child objects to the sub-assets list // but don't include them in the search by default Transform goTransform = go.transform; - Transform[] children = go.GetComponentsInChildren(); + Transform[] children = go.GetComponentsInChildren( true ); for( int i = 0; i < children.Length; i++ ) { if( ReferenceEquals( children[i], goTransform ) ) diff --git a/package.json b/package.json index 60cd453..6b51cba 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "com.yasirkula.assetusagedetector", "displayName": "Asset Usage Detector", - "version": "1.8.6", + "version": "1.8.7", "description": "This editor extension helps you figure out at which places an asset or GameObject is used, i.e. lists the objects that refer to the asset. It is possible to search for references in the Assets folder (Project view) and/or in the scene(s) of your project. You can also search for references while in Play mode!" }