From f7798f752f611692f436bacb719fb0144689b5b2 Mon Sep 17 00:00:00 2001 From: dj-kusuha Date: Tue, 11 Sep 2018 11:27:43 +0900 Subject: [PATCH] fixed a runtime error when using the IL2CPP scripting backend --- Assets/uDesktopDuplication/Scripts/Manager.cs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/Assets/uDesktopDuplication/Scripts/Manager.cs b/Assets/uDesktopDuplication/Scripts/Manager.cs index c576402..43ad9db 100644 --- a/Assets/uDesktopDuplication/Scripts/Manager.cs +++ b/Assets/uDesktopDuplication/Scripts/Manager.cs @@ -62,8 +62,13 @@ public class Manager : MonoBehaviour private float reinitializationTimer_ = 0f; private bool isFirstFrame_ = true; - public static event Lib.DebugLogDelegate onDebugLog = msg => Debug.Log(msg); - public static event Lib.DebugLogDelegate onDebugErr = msg => Debug.LogError(msg); + public static event Lib.DebugLogDelegate onDebugLog = OnDebugLog; + public static event Lib.DebugLogDelegate onDebugErr = OnDebugErr; + + [AOT.MonoPInvokeCallback(typeof(Lib.DebugLogDelegate))] + private static void OnDebugLog(string msg) { Debug.Log(msg); } + [AOT.MonoPInvokeCallback(typeof(Lib.DebugLogDelegate))] + private static void OnDebugErr(string msg) { Debug.LogError(msg); } public delegate void ReinitializeHandler(); public static event ReinitializeHandler onReinitialized;