Fix invoking managed method on value types (eg. Transform) to properly handle instance value

#1801
This commit is contained in:
Wojtek Figat
2023-10-26 11:37:37 +02:00
parent f44421b7a7
commit bfaa292b04

View File

@@ -1302,7 +1302,8 @@ namespace FlaxEngine.Interop
#if !USE_AOT
internal bool TryGetDelegate(out Invoker.MarshalAndInvokeDelegate outDeleg, out object outDelegInvoke)
{
if (invokeDelegate == null)
// Skip using in-built delegate for value types (eg. Transform) to properly handle instance value passing to method
if (invokeDelegate == null && !method.DeclaringType.IsValueType)
{
List<Type> methodTypes = new List<Type>();
if (!method.IsStatic)