mirror of
https://github.com/yasirkula/UnityAssetUsageDetector.git
synced 2026-11-19 14:32:37 +08:00
References to a scene object's prefab parent's prefab parent (at any depth) are now found correctly
This commit is contained in:
@@ -350,12 +350,16 @@ namespace AssetUsageDetectorNamespace
|
||||
if( searchPrefabConnections )
|
||||
{
|
||||
#if UNITY_2018_3_OR_NEWER
|
||||
Object prefab = PrefabUtility.GetCorrespondingObjectFromSource( go );
|
||||
#else
|
||||
Object prefab = PrefabUtility.GetPrefabParent( go );
|
||||
Object prefab = go;
|
||||
while( prefab = PrefabUtility.GetCorrespondingObjectFromSource( prefab ) )
|
||||
#endif
|
||||
if( objectsToSearchSet.Contains( prefab ) && assetsToSearchRootPrefabs.ContainsFast( prefab as GameObject ) )
|
||||
referenceNode.AddLinkTo( GetReferenceNode( prefab ), "Prefab object" );
|
||||
{
|
||||
#if !UNITY_2018_3_OR_NEWER
|
||||
Object prefab = PrefabUtility.GetPrefabParent( go );
|
||||
#endif
|
||||
if( objectsToSearchSet.Contains( prefab ) && assetsToSearchRootPrefabs.ContainsFast( prefab as GameObject ) )
|
||||
referenceNode.AddLinkTo( GetReferenceNode( prefab ), "Prefab object" );
|
||||
}
|
||||
}
|
||||
|
||||
// Search through all the components of the object
|
||||
|
||||
Reference in New Issue
Block a user