瀏覽代碼

尝试使用takingdata来统计错误信息

lzx 1 天之前
父節點
當前提交
15f507f124
共有 1 個文件被更改,包括 8 次插入0 次删除
  1. 8 0
      Assets/Scripts/ThirdParty/TalkingDataScripts/TalkingDataSDK.cs

+ 8 - 0
Assets/Scripts/ThirdParty/TalkingDataScripts/TalkingDataSDK.cs

@@ -1013,6 +1013,8 @@ public static class TalkingDataSDK
     public static void OnEvent(string eventId, Dictionary<string, object> parameters,
         Dictionary<string, object> eventValue)
     {
+        if (talkingdataClass == null)
+            return;
         if (Application.platform != RuntimePlatform.OSXEditor && Application.platform != RuntimePlatform.WindowsEditor)
         {
 #if UNITY_ANDROID
@@ -1045,6 +1047,8 @@ public static class TalkingDataSDK
     /// </summary>
     public static void OnError(string message, string stackTrace, LogType logType)
     {
+        if (talkingdataClass == null)
+            return;
         if (Application.platform != RuntimePlatform.OSXEditor && Application.platform != RuntimePlatform.WindowsEditor)
         {
 #if UNITY_ANDROID
@@ -1065,6 +1069,8 @@ public static class TalkingDataSDK
     /// </summary>
     public static void ReportException(System.Exception exception)
     {
+        if (talkingdataClass == null)
+            return;
         if (Application.platform != RuntimePlatform.OSXEditor && Application.platform != RuntimePlatform.WindowsEditor)
         {
 #if UNITY_ANDROID
@@ -1091,6 +1097,8 @@ public static class TalkingDataSDK
     /// <param name="enabled">true:开启, false:关闭</param>
     public static void SetReportUncaughtExceptions(bool enabled)
     {
+        if (talkingdataClass == null)
+            return;
         try
         {
             talkingdataClass.CallStatic("setReportUncaughtExceptions", enabled);