From e1752febbbf12338262fe8120911368a60007dd7 Mon Sep 17 00:00:00 2001 From: Katy Coe Date: Mon, 18 Nov 2019 02:46:07 +0100 Subject: [PATCH] Model: Include ComVisible and Serializable in TypeInfo.GetAllTypeReferences() --- Il2CppInspector/Reflection/TypeInfo.cs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Il2CppInspector/Reflection/TypeInfo.cs b/Il2CppInspector/Reflection/TypeInfo.cs index 070f4e2..e81a805 100644 --- a/Il2CppInspector/Reflection/TypeInfo.cs +++ b/Il2CppInspector/Reflection/TypeInfo.cs @@ -586,6 +586,12 @@ namespace Il2CppInspector.Reflection { public List GetAllTypeReferences() { var refs = new HashSet(); + // Fixed attributes + if (IsImport) + refs.Add(Assembly.Model.TypesByFullName["System.Runtime.InteropServices.ComVisibleAttribute"]); + if (IsSerializable) + refs.Add(Assembly.Model.TypesByFullName["System.SerializableAttribute"]); + // Constructor, event, field, method, nested type, property attributes var attrs = DeclaredMembers.SelectMany(m => m.CustomAttributes); refs.UnionWith(attrs.Select(a => a.AttributeType));