From d52cbf6bcf94e279847816a4c5ce6184e2ccfd39 Mon Sep 17 00:00:00 2001 From: johnche Date: Wed, 18 Dec 2024 10:17:27 +0800 Subject: [PATCH] =?UTF-8?q?[unity]=E4=B8=A4=E5=A5=97API=E5=90=8C=E6=97=B6?= =?UTF-8?q?=E6=94=BE=E5=BC=80=E5=90=8E=EF=BC=8Cunity=E7=9A=84CI=E4=BC=9A?= =?UTF-8?q?=E5=8D=A1=E5=9C=A8v1=E7=89=88=E6=9C=AC=E7=9A=84=E6=89=A7?= =?UTF-8?q?=E8=A1=8C=E4=B8=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../upm/Runtime/Src/Default/Native/PuertsDLL.cs | 4 ++++ .../upm/Runtime/Src/IL2Cpp/Native/NativeAPI.cs | 16 ++++++++++++++++ 2 files changed, 20 insertions(+) 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