Fix: Resolved InternalAPIHelper error in Unity 2022.3.23f1 and later versions

This commit is contained in:
Roman Tarusov 2024-05-01 20:29:18 +02:00
parent 5fef637954
commit e51da20a10

View File

@ -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 });