From 42e32781296ce993086263b783d44bdf7ee493cc Mon Sep 17 00:00:00 2001 From: yasirkula Date: Sun, 7 May 2023 21:38:28 +0300 Subject: [PATCH] Fixed not being able to ping some asset search results in Project window (in particular, VFX graph search results) --- Plugins/AssetUsageDetector/Editor/Utilities.cs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Plugins/AssetUsageDetector/Editor/Utilities.cs b/Plugins/AssetUsageDetector/Editor/Utilities.cs index 089de22..98d4234 100644 --- a/Plugins/AssetUsageDetector/Editor/Utilities.cs +++ b/Plugins/AssetUsageDetector/Editor/Utilities.cs @@ -190,6 +190,11 @@ namespace AssetUsageDetectorNamespace // Can't ping assets that are hidden from Project window (e.g. animator states of AnimatorController), ping the main asset at that path instead pingTarget = AssetDatabase.LoadMainAssetAtPath( AssetDatabase.GetAssetPath( obj ) ); } + else if( !AssetDatabase.IsMainAsset( obj ) && Array.IndexOf( AssetDatabase.LoadAllAssetRepresentationsAtPath( AssetDatabase.GetAssetPath( obj ) ), obj ) < 0 ) + { + // VFX Graph assets' nodes are serialized as part of the graph but they are invisible in the Project window even though their hideFlags is None (I don't know how) + pingTarget = AssetDatabase.LoadMainAssetAtPath( AssetDatabase.GetAssetPath( obj ) ); + } } }