Skip to content

Commit 96315ec

Browse files
committedNov 10, 2019
For references found inside enumerators like arrays, reflection algorithm now shows the array index that the reference is found at instead of a generic "(IEnumerable)"
1 parent 12ed06d commit 96315ec

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed
 

‎Plugins/AssetUsageDetector/Editor/AssetUsageDetector.cs

+4-1
Original file line numberDiff line numberDiff line change
@@ -1305,16 +1305,19 @@ private void SearchFieldsAndPropertiesOf( ReferenceNode referenceNode )
13051305
{
13061306
// If the field is IEnumerable (possibly an array or collection), search through members of it
13071307
// Note that Transform IEnumerable (children of the transform) is not iterated
1308+
int index = 0;
13081309
foreach( object element in (IEnumerable) variableValue )
13091310
{
13101311
ReferenceNode searchResult = SearchObject( element );
13111312
if( searchResult != null )
13121313
{
13131314
if( searchResult != referenceNode )
1314-
referenceNode.AddLinkTo( searchResult, ( variables[i].isProperty ? "Property (IEnumerable): " : "Variable (IEnumerable): " ) + variables[i].name );
1315+
referenceNode.AddLinkTo( searchResult, string.Concat( variables[i].isProperty ? "Property: " : "Variable: ", variables[i].name, "[", index + "]" ) );
13151316
else
13161317
PoolReferenceNode( searchResult );
13171318
}
1319+
1320+
index++;
13181321
}
13191322
}
13201323
}

0 commit comments

Comments
 (0)