Skip to content

Commit 635d065

Browse files
committed
Material's color and mainTexture properties aren't searched at runtime since they're searched by SearchMaterial anyways and they can actually throw errors in the Console if the corresponding shader property doesn't exist
1 parent cb4454b commit 635d065

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

Plugins/AssetUsageDetector/Editor/AssetUsageDetectorSearchFunctions.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1626,6 +1626,10 @@ private VariableGetterHolder[] GetFilteredVariablesForType( Type type )
16261626
#endif
16271627
typeof( Collider2D ).IsAssignableFrom( currType ) ) )
16281628
continue;
1629+
// Ignore certain Material properties that are already searched via SearchMaterial function (also, if a material doesn't have a _Color or _BaseColor
1630+
// property and its "color" property is called, it logs an error to the console, so this rule helps avoid that scenario, as well)
1631+
else if( ( propertyName == "color" || propertyName == "mainTexture" ) && typeof( Material ).IsAssignableFrom( currType ) )
1632+
continue;
16291633
// Ignore "parameters" property of Animator since it doesn't contain any useful data and logs a warning to the console when Animator is inactive
16301634
else if( typeof( Animator ).IsAssignableFrom( currType ) && propertyName == "parameters" )
16311635
continue;

0 commit comments

Comments
 (0)