diff --git a/AgoraChatSDK/AgoraChat/Helper/LogPrinter.cs b/AgoraChatSDK/AgoraChat/Helper/LogPrinter.cs index d5c66d2c..313e3382 100644 --- a/AgoraChatSDK/AgoraChat/Helper/LogPrinter.cs +++ b/AgoraChatSDK/AgoraChat/Helper/LogPrinter.cs @@ -11,7 +11,7 @@ public class LogPrinter public static void Log(object message) { #if !_WIN32 - Debug.Log("UNITYSDK: " + message); + //Debug.Log("UNITYSDK: " + message); #endif } } diff --git a/AgoraChatSDK/AgoraChat/Native/NativeListener.cs b/AgoraChatSDK/AgoraChat/Native/NativeListener.cs index ee789873..23d657bd 100644 --- a/AgoraChatSDK/AgoraChat/Native/NativeListener.cs +++ b/AgoraChatSDK/AgoraChat/Native/NativeListener.cs @@ -1,6 +1,9 @@ using AgoraChat.SimpleJSON; using System; using System.Runtime.InteropServices; +#if !_WIN32 +using UnityEngine; +#endif namespace AgoraChat { @@ -104,18 +107,14 @@ internal NativeListener() }; } - internal class MonoPInvokeCallbackAttribute : Attribute - { - public MonoPInvokeCallbackAttribute(Type t) { } - } - - [MonoPInvokeCallback(typeof(NativeListenerEvent))] +#if !_WIN32 + [AOT.MonoPInvokeCallback(typeof(NativeListenerEvent))] public static void OnRunCallback(string listener, string method, string jsonString) { LogPrinter.Log($"OnRunCallback listener: {listener}, method: {method}, jsonString: {jsonString}"); SDKClient.Instance._clientImpl.nativeListener.nativeListenerEvent?.Invoke(listener, method, jsonString); } - +#endif ~NativeListener() { queue_worker.ClearQueue(); diff --git a/UnityChatDemo/Assets/AgoraChat/AgoraChat/Helper/LogPrinter.cs b/UnityChatDemo/Assets/AgoraChat/AgoraChat/Helper/LogPrinter.cs index d5c66d2c..313e3382 100644 --- a/UnityChatDemo/Assets/AgoraChat/AgoraChat/Helper/LogPrinter.cs +++ b/UnityChatDemo/Assets/AgoraChat/AgoraChat/Helper/LogPrinter.cs @@ -11,7 +11,7 @@ public class LogPrinter public static void Log(object message) { #if !_WIN32 - Debug.Log("UNITYSDK: " + message); + //Debug.Log("UNITYSDK: " + message); #endif } } diff --git a/UnityChatDemo/Assets/AgoraChat/AgoraChat/Native/NativeListener.cs b/UnityChatDemo/Assets/AgoraChat/AgoraChat/Native/NativeListener.cs index ee789873..23d657bd 100644 --- a/UnityChatDemo/Assets/AgoraChat/AgoraChat/Native/NativeListener.cs +++ b/UnityChatDemo/Assets/AgoraChat/AgoraChat/Native/NativeListener.cs @@ -1,6 +1,9 @@ using AgoraChat.SimpleJSON; using System; using System.Runtime.InteropServices; +#if !_WIN32 +using UnityEngine; +#endif namespace AgoraChat { @@ -104,18 +107,14 @@ internal NativeListener() }; } - internal class MonoPInvokeCallbackAttribute : Attribute - { - public MonoPInvokeCallbackAttribute(Type t) { } - } - - [MonoPInvokeCallback(typeof(NativeListenerEvent))] +#if !_WIN32 + [AOT.MonoPInvokeCallback(typeof(NativeListenerEvent))] public static void OnRunCallback(string listener, string method, string jsonString) { LogPrinter.Log($"OnRunCallback listener: {listener}, method: {method}, jsonString: {jsonString}"); SDKClient.Instance._clientImpl.nativeListener.nativeListenerEvent?.Invoke(listener, method, jsonString); } - +#endif ~NativeListener() { queue_worker.ClearQueue();