diff --git a/unity/Assets/core/upm/Runtime/Src/Default/Native/PuertsDLL.cs b/unity/Assets/core/upm/Runtime/Src/Default/Native/PuertsDLL.cs index bf95373b26..44e8be3031 100644 --- a/unity/Assets/core/upm/Runtime/Src/Default/Native/PuertsDLL.cs +++ b/unity/Assets/core/upm/Runtime/Src/Default/Native/PuertsDLL.cs @@ -9,6 +9,8 @@ using System.Runtime.InteropServices; using System.Text; +#if !PUERTS_IL2CPP_OPTIMIZATION || !ENABLE_IL2CPP + namespace Puerts { #pragma warning disable 414 @@ -645,3 +647,5 @@ public static string GetJSStackTrace(IntPtr isolate) } } } + +#endif diff --git a/unity/Assets/core/upm/Runtime/Src/IL2Cpp/Native/NativeAPI.cs b/unity/Assets/core/upm/Runtime/Src/IL2Cpp/Native/NativeAPI.cs index 52facc6c00..7c9af112e8 100644 --- a/unity/Assets/core/upm/Runtime/Src/IL2Cpp/Native/NativeAPI.cs +++ b/unity/Assets/core/upm/Runtime/Src/IL2Cpp/Native/NativeAPI.cs @@ -5,6 +5,8 @@ * This file is subject to the terms and conditions defined in file 'LICENSE', which is part of this source code package. */ +#if UNITY_2020_1_OR_NEWER +#if PUERTS_IL2CPP_OPTIMIZATION && ENABLE_IL2CPP using System; using System.Runtime.InteropServices; @@ -14,6 +16,17 @@ namespace Puerts { +#pragma warning disable 414 + public class MonoPInvokeCallbackAttribute : System.Attribute + { + private Type type; + public MonoPInvokeCallbackAttribute(Type t) + { + type = t; + } + } +#pragma warning restore 414 + public class NativeAPI { #if (UNITY_IPHONE || UNITY_TVOS || UNITY_WEBGL || UNITY_SWITCH) && !UNITY_EDITOR @@ -428,3 +441,6 @@ public struct pesapi_ffi public pesapi_set_env_private_func set_env_private; } } + +#endif +#endif