diff --git a/Assets/BetterExtensions/Runtime/Extensions/TypeExtensions.cs b/Assets/BetterExtensions/Runtime/Extensions/TypeExtensions.cs index 183060e..00603e1 100644 --- a/Assets/BetterExtensions/Runtime/Extensions/TypeExtensions.cs +++ b/Assets/BetterExtensions/Runtime/Extensions/TypeExtensions.cs @@ -139,16 +139,12 @@ public static IEnumerable GetAllInheritedTypesWithoutUnityObject(this Type public static bool IsAnonymous(this Type type) { - if (type.IsGenericType) + if (type.IsClass && type.IsSealed && type.Attributes.HasFlag(TypeAttributes.NotPublic)) { - var d = type.GetGenericTypeDefinition(); - if (d.IsClass && d.IsSealed && d.Attributes.HasFlag(TypeAttributes.NotPublic)) + var attributes = type.GetCustomAttribute(false); + if (attributes != null) { - var attributes = d.GetCustomAttribute(false); - if (attributes != null) - { - return true; - } + return true; } } diff --git a/Assets/BetterExtensions/package.json b/Assets/BetterExtensions/package.json index 9ef7981..dd8a90b 100644 --- a/Assets/BetterExtensions/package.json +++ b/Assets/BetterExtensions/package.json @@ -1,7 +1,7 @@ { "name": "com.uurha.betterextensions", "displayName": "Better Extensions", - "version": "1.5.4", + "version": "1.5.5", "unity": "2020.1", "description": "Unity extensions, serialize extension, async extension, string extension and UI extensions", "dependencies": {