From 4c6dd1249a250f7817d7c6cc685135bb562cc6df Mon Sep 17 00:00:00 2001 From: walon Date: Sat, 22 Apr 2023 14:05:50 +0800 Subject: [PATCH] =?UTF-8?q?[fix]=20=E4=BF=AE=E5=A4=8DWebGL=E4=B8=80?= =?UTF-8?q?=E4=BA=9B=E6=A1=A5=E6=8E=A5=E5=87=BD=E6=95=B0ABI=E8=AE=A1?= =?UTF-8?q?=E7=AE=97=E7=9A=84bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Editor/ABI/TypeCreatorBase.cs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/Editor/ABI/TypeCreatorBase.cs b/Editor/ABI/TypeCreatorBase.cs index a5485ee..36cfa41 100644 --- a/Editor/ABI/TypeCreatorBase.cs +++ b/Editor/ABI/TypeCreatorBase.cs @@ -261,7 +261,15 @@ namespace HybridCLR.Editor.ABI { return true; } - return fields.All(f => f.IsStatic); + if (fields.All(f => f.IsStatic)) + { + return true; + } + if (typeDef.IsExplicitLayout && fields.Count(f => !f.IsStatic) > 1) + { + return true; + } + return false; } protected static TypeInfo CreateGeneralValueType(TypeSig type, int size, int aligment)