From cf0fea56ab4143d0d887a9a62a86db4707b2d308 Mon Sep 17 00:00:00 2001 From: yasirkula Date: Tue, 27 Jun 2023 14:01:20 +0300 Subject: [PATCH] Fixed 3D model assets' direct children not being pinged correctly when selected via a search result --- Plugins/AssetUsageDetector/Editor/Utilities.cs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Plugins/AssetUsageDetector/Editor/Utilities.cs b/Plugins/AssetUsageDetector/Editor/Utilities.cs index 98d4234..fa8c0b3 100644 --- a/Plugins/AssetUsageDetector/Editor/Utilities.cs +++ b/Plugins/AssetUsageDetector/Editor/Utilities.cs @@ -177,6 +177,12 @@ namespace AssetUsageDetectorNamespace selection = objTR.gameObject; #endif } + else if( prefabAssetType == PrefabAssetType.Model ) + { + objTR = ( (GameObject) obj ).transform; + while( objTR.parent != null && objTR.parent.parent != null ) + objTR = objTR.parent; + } #else Transform objTR = ( (GameObject) obj ).transform; while( objTR.parent != null && objTR.parent.parent != null )