diff --git a/Plugins/AssetUsageDetector/Editor/AssetUsageDetectorSearchFunctions.cs b/Plugins/AssetUsageDetector/Editor/AssetUsageDetectorSearchFunctions.cs index b4d06be..31332b1 100644 --- a/Plugins/AssetUsageDetector/Editor/AssetUsageDetectorSearchFunctions.cs +++ b/Plugins/AssetUsageDetector/Editor/AssetUsageDetectorSearchFunctions.cs @@ -1642,10 +1642,6 @@ namespace AssetUsageDetectorNamespace if( field.FieldType.IsIgnoredUnityType() ) continue; - // "ref struct"s can't be accessed via reflection - if( field.FieldType.IsByRefLike ) - continue; - // Additional filtering for fields: // 1- Ignore "m_RectTransform", "m_CanvasRenderer" and "m_Canvas" fields of Graphic components string fieldName = field.Name; @@ -1668,10 +1664,6 @@ namespace AssetUsageDetectorNamespace if( property.PropertyType.IsIgnoredUnityType() ) continue; - // "ref struct"s can't be accessed via reflection - if( property.PropertyType.IsByRefLike ) - continue; - // Skip properties without a getter function MethodInfo propertyGetter = property.GetGetMethod( true ); if( propertyGetter == null ) diff --git a/Plugins/AssetUsageDetector/Editor/Utilities.cs b/Plugins/AssetUsageDetector/Editor/Utilities.cs index 3a2c2a4..6655288 100644 --- a/Plugins/AssetUsageDetector/Editor/Utilities.cs +++ b/Plugins/AssetUsageDetector/Editor/Utilities.cs @@ -359,9 +359,9 @@ namespace AssetUsageDetectorNamespace if( typeof( Type ).IsAssignableFrom( type ) || type.Namespace == reflectionNamespace ) return true; - // Searching pointers or ref variables for reference throws ArgumentException - if( type.IsPointer || type.IsByRef ) - return true; + // Searching pointers, ref variables or ref structs for reference throws ArgumentException + if (type.IsPointer || type.IsByRef || type.IsByRefLike) + return true; return false; }