Skip to content

Commit

Permalink
Merge pull request #89 from ArkTarusov/fix/unity-2022-compatibility
Browse files Browse the repository at this point in the history
Fix: Resolved InternalAPIHelper error in Unity 2022.3.23f1 and later
  • Loading branch information
AnnulusGames committed Jun 20, 2024
2 parents 5fef637 + e51da20 commit e395eec
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions Alchemy/Assets/Alchemy/Editor/Internal/InternalAPIHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,14 @@ public static Type GetDrawerTypeForType(Type classType, bool isManagedReferenceP
{
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 });
Expand Down

0 comments on commit e395eec

Please sign in to comment.