From e51da20a102ad270f286d6f0cefd71cc6b30011b Mon Sep 17 00:00:00 2001 From: Roman Tarusov Date: Wed, 1 May 2024 20:29:18 +0200 Subject: [PATCH] Fix: Resolved InternalAPIHelper error in Unity 2022.3.23f1 and later versions --- .../Assets/Alchemy/Editor/Internal/InternalAPIHelper.cs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Alchemy/Assets/Alchemy/Editor/Internal/InternalAPIHelper.cs b/Alchemy/Assets/Alchemy/Editor/Internal/InternalAPIHelper.cs index a659d0a..ee2a9fd 100644 --- a/Alchemy/Assets/Alchemy/Editor/Internal/InternalAPIHelper.cs +++ b/Alchemy/Assets/Alchemy/Editor/Internal/InternalAPIHelper.cs @@ -39,6 +39,14 @@ namespace Alchemy.Editor { return (Type)methodInfo.Invoke(instance, new object[] { classType }); } +#elif UNITY_2022_3_OR_NEWER + // Unity 2022.3.23f1 added a new parameter to the method + var version = UnityEditorInternal.InternalEditorUtility.GetUnityVersion(); + if (version.Build >= 23) + { + return (Type)methodInfo?.Invoke(instance, new object[] { classType, isManagedReferenceProperty }); + } + return (Type)methodInfo?.Invoke(instance, new object[] { classType }); #else _ = isManagedReferenceProperty; // discard return (Type)methodInfo.Invoke(instance, new object[] { classType });