com.taptap.sdk.core 4.8.0-beta.1 → 4.8.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (42) hide show
  1. package/Mobile/Editor/NativeDependencies.xml +3 -3
  2. package/Mobile/Runtime/AndroidNativeWrapper.cs +2 -1
  3. package/Mobile/Runtime/BridgeAndroid.cs +2 -1
  4. package/Mobile/Runtime/BridgeIOS.cs +2 -3
  5. package/Mobile/Runtime/EngineBridgeInitializer.cs +2 -1
  6. package/Mobile/Runtime/TapCoreMobile.cs +6 -5
  7. package/Mobile/Runtime/TapEventMobile.cs +22 -21
  8. package/Resources/TapMessage.prefab +8 -8
  9. package/Runtime/Internal/Http/TapHttpClient.cs +2 -1
  10. package/Runtime/Internal/Http/TapHttpUtils.cs +3 -2
  11. package/Runtime/Internal/Log/TapLog.cs +39 -3
  12. package/Runtime/Internal/Platform/PlatformTypeUtils.cs +3 -7
  13. package/Runtime/Internal/UI/Base/UIManager.cs +2 -1
  14. package/Runtime/Internal/UI/BasePanel/BasePanelController.cs +2 -1
  15. package/Runtime/Internal/Utils/BridgeUtils.cs +23 -22
  16. package/Runtime/Internal/Utils/EventManager.cs +1 -1
  17. package/Runtime/Internal/Utils/ImageUtils.cs +5 -4
  18. package/Runtime/Public/DataStorage.cs +17 -4
  19. package/Runtime/Public/Log/TapLogger.cs +1 -1
  20. package/Runtime/Public/TapTapEvent.cs +2 -1
  21. package/Runtime/Public/TapTapSDK.cs +1 -1
  22. package/Standalone/Plugins/macOS/libtapsdkcorecpp.dylib.meta +1 -1
  23. package/Standalone/Plugins/x86/tapsdkcore.dll +0 -0
  24. package/Standalone/Plugins/x86_64/tapsdkcore.dll +0 -0
  25. package/Standalone/Plugins/x86_64/taptap_api.dll +0 -0
  26. package/Standalone/Plugins/x86_64/taptap_api.dll.meta +34 -6
  27. package/Standalone/Runtime/Internal/Bean/TapGatekeeper.cs +0 -2
  28. package/Standalone/Runtime/Internal/DeviceInfo.cs +2 -1
  29. package/Standalone/Runtime/Internal/EventSender.cs +2 -2
  30. package/Standalone/Runtime/Internal/Http/TapHttpUtils.cs +0 -8
  31. package/Standalone/Runtime/Internal/Openlog/TapOpenlogWrapper.cs +2 -2
  32. package/Standalone/Runtime/Internal/Prefs.cs +3 -2
  33. package/Standalone/Runtime/Internal/TapClientBridge.cs +222 -139
  34. package/Standalone/Runtime/Internal/TapClientBridgePoll.cs +2 -1
  35. package/Standalone/Runtime/Internal/Tracker.cs +11 -10
  36. package/Standalone/Runtime/Internal/UI/TapClientConnectTipController.cs +6 -6
  37. package/Standalone/Runtime/Internal/User.cs +2 -3
  38. package/Standalone/Runtime/Public/TapClientStandalone.cs +122 -84
  39. package/Standalone/Runtime/Public/TapCoreStandalone.cs +1 -15
  40. package/Standalone/Runtime/Public/TapEventStandalone.cs +9 -9
  41. package/link.xml.meta +1 -1
  42. package/package.json +9 -9
@@ -1,15 +1,15 @@
1
- <?xml version="1.0" ?>
1
+ <?xml version="1.0" encoding="UTF-8" standalone="no"?>
2
2
  <dependencies>
3
3
  <androidPackages>
4
4
  <repositories>
5
5
  <repository>https://repo.maven.apache.org/maven2</repository>
6
6
  </repositories>
7
- <androidPackage spec="com.taptap.sdk:tap-core-unity:4.8.0-beta.1"/>
7
+ <androidPackage spec="com.taptap.sdk:tap-core-unity:4.8.1-beta.7"/>
8
8
  </androidPackages>
9
9
  <iosPods>
10
10
  <sources>
11
11
  <source>https://github.com/CocoaPods/Specs.git</source>
12
12
  </sources>
13
- <iosPod name="TapTapCoreSDK" version="~> 4.6.3" bitcodeEnabled="false" addToAllTargets="false"/>
13
+ <iosPod addToAllTargets="false" bitcodeEnabled="false" name="TapTapCoreSDK" version="4.8.1-beta.7"/>
14
14
  </iosPods>
15
15
  </dependencies>
@@ -5,6 +5,7 @@ using System.Collections;
5
5
  using TapSDK.Core;
6
6
  using TapSDK.Core.Internal;
7
7
  using System.Collections.Generic;
8
+ using TapSDK.Core.Internal.Log;
8
9
 
9
10
  namespace TapSDK.Core.Mobile{
10
11
  internal class AndroidNativeWrapper
@@ -40,7 +41,7 @@ namespace TapSDK.Core.Mobile{
40
41
  }
41
42
  catch (Exception e)
42
43
  {
43
- Debug.LogError("Failed to get dynamic properties: " + e.Message);
44
+ TapLog.Error("Failed to get dynamic properties: " + e.Message);
44
45
  }
45
46
  return null;
46
47
  }
@@ -1,5 +1,6 @@
1
1
  using System;
2
2
  using UnityEngine;
3
+ using TapSDK.Core.Internal.Log;
3
4
 
4
5
  namespace TapSDK.Core
5
6
  {
@@ -51,7 +52,7 @@ namespace TapSDK.Core
51
52
  }
52
53
  catch (Exception e)
53
54
  {
54
- Debug.Log("register Failed:" + e);
55
+ TapLog.Log("register Failed:" + e);
55
56
  //
56
57
  }
57
58
  }
@@ -2,6 +2,7 @@
2
2
  using System.Collections.Concurrent;
3
3
  using System.Runtime.InteropServices;
4
4
  using UnityEngine;
5
+ using TapSDK.Core.Internal.Log;
5
6
 
6
7
  namespace TapSDK.Core
7
8
  {
@@ -48,11 +49,9 @@ namespace TapSDK.Core
48
49
  if (result.onceTime && BridgeIOS.GetInstance().GetConcurrentDictionary()
49
50
  .TryRemove(result.callbackId, out Action<Result> outAction))
50
51
  {
51
- Debug.Log($"TapSDK resolved current Action:{result.callbackId}");
52
+ TapLog.Log($"TapSDK resolved current Action:{result.callbackId}");
52
53
  }
53
54
  }
54
-
55
- Debug.Log($"TapSDK iOS BridgeAction last Count:{BridgeIOS.GetInstance().GetConcurrentDictionary().Count}");
56
55
  }
57
56
 
58
57
 
@@ -1,5 +1,6 @@
1
1
  using UnityEngine;
2
2
  using TapSDK.Core.Internal;
3
+ using TapSDK.Core.Internal.Log;
3
4
 
4
5
  namespace TapSDK.Core.Mobile
5
6
  {
@@ -12,7 +13,7 @@ namespace TapSDK.Core.Mobile
12
13
  {
13
14
  if (!isInitialized)
14
15
  {
15
- Debug.Log("Initializing EngineBridge");
16
+ TapLog.Log("Initializing EngineBridge");
16
17
 
17
18
  // TODO: android 注册桥接
18
19
  // #if UNITY_ANDROID
@@ -7,6 +7,7 @@ using TapSDK.Core.Internal.Utils;
7
7
  using System.Collections.Generic;
8
8
  using UnityEngine;
9
9
  using Newtonsoft.Json;
10
+ using TapSDK.Core.Internal.Log;
10
11
 
11
12
  namespace TapSDK.Core.Mobile
12
13
  {
@@ -16,14 +17,14 @@ namespace TapSDK.Core.Mobile
16
17
 
17
18
  public TapCoreMobile()
18
19
  {
19
- Debug.Log("TapCoreMobile constructor");
20
+ TapLog.Log("TapCoreMobile constructor");
20
21
  TapLoom.Initialize();
21
22
  EngineBridgeInitializer.Initialize();
22
23
  }
23
24
 
24
25
  public void Init(TapTapSdkOptions coreOption, TapTapSdkBaseOptions[] otherOptions)
25
26
  {
26
- Debug.Log("TapCoreMobile SDK inited");
27
+ TapLog.Log("TapCoreMobile SDK inited");
27
28
  SetPlatformAndVersion(TapTapSDK.SDKPlatform, TapTapSDK.Version);
28
29
  string coreOptionsJson = JsonUtility.ToJson(coreOption);
29
30
  string[] otherOptionsJson = otherOptions.Select(option => JsonConvert.SerializeObject(option)).ToArray();
@@ -36,7 +37,7 @@ namespace TapSDK.Core.Mobile
36
37
 
37
38
  private void SetPlatformAndVersion(string platform, string version)
38
39
  {
39
- Debug.Log("TapCoreMobile SetPlatformAndVersion called with platform: " + platform + " and version: " + version);
40
+ TapLog.Log("TapCoreMobile SetPlatformAndVersion called with platform: " + platform + " and version: " + version);
40
41
  Bridge.CallHandler(EngineBridgeInitializer.GetBridgeServer()
41
42
  .Method("setPlatformAndVersion")
42
43
  .Args("platform", TapTapSDK.SDKPlatform)
@@ -47,7 +48,7 @@ namespace TapSDK.Core.Mobile
47
48
 
48
49
  private void SetSDKArtifact(string value)
49
50
  {
50
- Debug.Log("TapCoreMobile SetSDKArtifact called with value: " + value);
51
+ TapLog.Log("TapCoreMobile SetSDKArtifact called with value: " + value);
51
52
  Bridge.CallHandler(EngineBridgeInitializer.GetBridgeServer()
52
53
  .Method("setSDKArtifact")
53
54
  .Args("artifact", "Unity")
@@ -61,7 +62,7 @@ namespace TapSDK.Core.Mobile
61
62
 
62
63
  public void UpdateLanguage(TapTapLanguageType language)
63
64
  {
64
- Debug.Log("TapCoreMobile UpdateLanguage language: " + language);
65
+ TapLog.Log("TapCoreMobile UpdateLanguage language: " + language);
65
66
  Bridge.CallHandler(EngineBridgeInitializer.GetBridgeServer()
66
67
  .Method("updateLanguage")
67
68
  .Args("language", (int)language)
@@ -3,6 +3,7 @@ using System.Threading.Tasks;
3
3
  using System.Runtime.InteropServices;
4
4
  using TapSDK.Core.Internal;
5
5
  using System.Collections.Generic;
6
+ using TapSDK.Core.Internal.Log;
6
7
  using UnityEngine;
7
8
 
8
9
  namespace TapSDK.Core.Mobile
@@ -13,7 +14,7 @@ namespace TapSDK.Core.Mobile
13
14
 
14
15
  public TapEventMobile()
15
16
  {
16
- Debug.Log("TapEventMobile constructor");
17
+ TapLog.Log("TapEventMobile constructor");
17
18
  EngineBridgeInitializer.Initialize();
18
19
  }
19
20
 
@@ -24,7 +25,7 @@ namespace TapSDK.Core.Mobile
24
25
 
25
26
  public void SetUserID(string userID)
26
27
  {
27
- Debug.Log("TapEventMobile SetUserID = " + userID);
28
+ TapLog.Log("TapEventMobile SetUserID = " + userID);
28
29
  Bridge.CallHandler(EngineBridgeInitializer.GetBridgeServer()
29
30
  .Method("setUserID")
30
31
  .Args("userID", userID)
@@ -33,7 +34,7 @@ namespace TapSDK.Core.Mobile
33
34
 
34
35
  public void SetUserID(string userID, string properties)
35
36
  {
36
- Debug.Log("TapEventMobile SetUserID" + userID + properties);
37
+ TapLog.Log("TapEventMobile SetUserID" + userID + properties);
37
38
  Bridge.CallHandler(EngineBridgeInitializer.GetBridgeServer()
38
39
  .Method("setUserID")
39
40
  .Args("userID", userID)
@@ -43,7 +44,7 @@ namespace TapSDK.Core.Mobile
43
44
 
44
45
  public void ClearUser()
45
46
  {
46
- Debug.Log("TapEventMobile ClearUser");
47
+ TapLog.Log("TapEventMobile ClearUser");
47
48
  Bridge.CallHandler(EngineBridgeInitializer.GetBridgeServer()
48
49
  .Method("clearUser")
49
50
  .CommandBuilder());
@@ -54,13 +55,13 @@ namespace TapSDK.Core.Mobile
54
55
  string deviceId = Bridge.CallWithReturnValue(EngineBridgeInitializer.GetBridgeServer()
55
56
  .Method("getDeviceId")
56
57
  .CommandBuilder());
57
- Debug.Log("TapEventMobile GetDeviceId = " + deviceId);
58
+ TapLog.Log("TapEventMobile GetDeviceId = " + deviceId);
58
59
  return deviceId;
59
60
  }
60
61
 
61
62
  public void LogEvent(string name, string properties)
62
63
  {
63
- Debug.Log("TapEventMobile LogEvent" + name + properties);
64
+ TapLog.Log("TapEventMobile LogEvent" + name + properties);
64
65
  Bridge.CallHandler(EngineBridgeInitializer.GetBridgeServer()
65
66
  .Method("logEvent")
66
67
  .Args("name", name)
@@ -70,7 +71,7 @@ namespace TapSDK.Core.Mobile
70
71
 
71
72
  public void DeviceInitialize(string properties)
72
73
  {
73
- Debug.Log("TapEventMobile DeviceInitialize" + properties);
74
+ TapLog.Log("TapEventMobile DeviceInitialize" + properties);
74
75
  #if UNITY_IOS
75
76
  Bridge.CallHandler(EngineBridgeInitializer.GetBridgeServer()
76
77
  .Method("deviceInitialize")
@@ -86,7 +87,7 @@ namespace TapSDK.Core.Mobile
86
87
 
87
88
  public void DeviceUpdate(string properties)
88
89
  {
89
- Debug.Log("TapEventMobile DeviceUpdate" + properties);
90
+ TapLog.Log("TapEventMobile DeviceUpdate" + properties);
90
91
  #if UNITY_IOS
91
92
  Bridge.CallHandler(EngineBridgeInitializer.GetBridgeServer()
92
93
  .Method("deviceUpdate")
@@ -102,7 +103,7 @@ namespace TapSDK.Core.Mobile
102
103
 
103
104
  public void DeviceAdd(string properties)
104
105
  {
105
- Debug.Log("TapEventMobile DeviceAdd" + properties);
106
+ TapLog.Log("TapEventMobile DeviceAdd" + properties);
106
107
  #if UNITY_IOS
107
108
  Bridge.CallHandler(EngineBridgeInitializer.GetBridgeServer()
108
109
  .Method("deviceAdd")
@@ -118,7 +119,7 @@ namespace TapSDK.Core.Mobile
118
119
 
119
120
  public void UserInitialize(string properties)
120
121
  {
121
- Debug.Log("TapEventMobile UserInitialize" + properties);
122
+ TapLog.Log("TapEventMobile UserInitialize" + properties);
122
123
  #if UNITY_IOS
123
124
  Bridge.CallHandler(EngineBridgeInitializer.GetBridgeServer()
124
125
  .Method("userInitialize")
@@ -134,7 +135,7 @@ namespace TapSDK.Core.Mobile
134
135
 
135
136
  public void UserUpdate(string properties)
136
137
  {
137
- Debug.Log("TapEventMobile UserUpdate" + properties);
138
+ TapLog.Log("TapEventMobile UserUpdate" + properties);
138
139
  #if UNITY_IOS
139
140
  Bridge.CallHandler(EngineBridgeInitializer.GetBridgeServer()
140
141
  .Method("userUpdate")
@@ -150,7 +151,7 @@ namespace TapSDK.Core.Mobile
150
151
 
151
152
  public void UserAdd(string properties)
152
153
  {
153
- Debug.Log("TapEventMobile UserAdd" + properties);
154
+ TapLog.Log("TapEventMobile UserAdd" + properties);
154
155
  #if UNITY_IOS
155
156
  Bridge.CallHandler(EngineBridgeInitializer.GetBridgeServer()
156
157
  .Method("userAdd")
@@ -166,7 +167,7 @@ namespace TapSDK.Core.Mobile
166
167
 
167
168
  public void AddCommonProperty(string key, string value)
168
169
  {
169
- Debug.Log("TapEventMobile AddCommonProperty" + key + value);
170
+ TapLog.Log("TapEventMobile AddCommonProperty" + key + value);
170
171
  #if UNITY_IOS
171
172
  Bridge.CallHandler(EngineBridgeInitializer.GetBridgeServer()
172
173
  .Method("addCommonProperty")
@@ -184,7 +185,7 @@ namespace TapSDK.Core.Mobile
184
185
 
185
186
  public void AddCommon(string properties)
186
187
  {
187
- Debug.Log("TapEventMobile AddCommon" + properties);
188
+ TapLog.Log("TapEventMobile AddCommon" + properties);
188
189
  #if UNITY_IOS
189
190
  Bridge.CallHandler(EngineBridgeInitializer.GetBridgeServer()
190
191
  .Method("addCommon")
@@ -200,7 +201,7 @@ namespace TapSDK.Core.Mobile
200
201
 
201
202
  public void ClearCommonProperty(string key)
202
203
  {
203
- Debug.Log("TapEventMobile ClearCommonProperty");
204
+ TapLog.Log("TapEventMobile ClearCommonProperty");
204
205
 
205
206
  #if UNITY_IOS
206
207
  Bridge.CallHandler(EngineBridgeInitializer.GetBridgeServer()
@@ -217,7 +218,7 @@ namespace TapSDK.Core.Mobile
217
218
 
218
219
  public void ClearCommonProperties(string[] keys)
219
220
  {
220
- Debug.Log("TapEventMobile ClearCommonProperties");
221
+ TapLog.Log("TapEventMobile ClearCommonProperties");
221
222
 
222
223
  #if UNITY_IOS
223
224
  Bridge.CallHandler(EngineBridgeInitializer.GetBridgeServer()
@@ -234,7 +235,7 @@ namespace TapSDK.Core.Mobile
234
235
 
235
236
  public void ClearAllCommonProperties()
236
237
  {
237
- Debug.Log("TapEventMobile ClearAllCommonProperties");
238
+ TapLog.Log("TapEventMobile ClearAllCommonProperties");
238
239
 
239
240
  Bridge.CallHandler(EngineBridgeInitializer.GetBridgeServer()
240
241
  .Method("clearAllCommonProperties")
@@ -243,7 +244,7 @@ namespace TapSDK.Core.Mobile
243
244
 
244
245
  public void LogChargeEvent(string orderID, string productName, long amount, string currencyType, string paymentMethod, string properties)
245
246
  {
246
- Debug.Log("TapEventMobile LogChargeEvent" + orderID);
247
+ TapLog.Log("TapEventMobile LogChargeEvent" + orderID);
247
248
 
248
249
  Bridge.CallHandler(EngineBridgeInitializer.GetBridgeServer()
249
250
  .Method("logPurchasedEvent")
@@ -258,7 +259,7 @@ namespace TapSDK.Core.Mobile
258
259
 
259
260
  public void RegisterDynamicProperties(Func<string> callback)
260
261
  {
261
- Debug.Log("RegisterDynamicProperties called" + callback);
262
+ TapLog.Log("RegisterDynamicProperties called" + callback);
262
263
  #if UNITY_IOS
263
264
  IOSNativeWrapper.RegisterDynamicProperties(callback);
264
265
  #else
@@ -268,7 +269,7 @@ namespace TapSDK.Core.Mobile
268
269
 
269
270
  public void SetOAID(string value)
270
271
  {
271
- Debug.Log("TapEventMobile SetOAID" + value);
272
+ TapLog.Log("TapEventMobile SetOAID" + value);
272
273
  #if UNITY_ANDROID
273
274
  Bridge.CallHandler(EngineBridgeInitializer.GetBridgeServer()
274
275
  .Method("setOAID")
@@ -279,7 +280,7 @@ namespace TapSDK.Core.Mobile
279
280
 
280
281
  public void LogDeviceLoginEvent()
281
282
  {
282
- Debug.Log("TapEventMobile LogDeviceLoginEvent");
283
+ TapLog.Log("TapEventMobile LogDeviceLoginEvent");
283
284
  #if UNITY_ANDROID
284
285
  Bridge.CallHandler(EngineBridgeInitializer.GetBridgeServer()
285
286
  .Method("logDeviceLoginEvent")
@@ -133,7 +133,7 @@ RectTransform:
133
133
  m_AnchorMin: {x: 0.5, y: 0}
134
134
  m_AnchorMax: {x: 0.5, y: 0}
135
135
  m_AnchoredPosition: {x: 0.5, y: 100}
136
- m_SizeDelta: {x: 400, y: 100}
136
+ m_SizeDelta: {x: 200, y: 40}
137
137
  m_Pivot: {x: 0.5, y: 0.5}
138
138
  --- !u!1 &6224477040733538127
139
139
  GameObject:
@@ -172,8 +172,8 @@ RectTransform:
172
172
  m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
173
173
  m_AnchorMin: {x: 0.5, y: 1}
174
174
  m_AnchorMax: {x: 0.5, y: 1}
175
- m_AnchoredPosition: {x: 0, y: -50}
176
- m_SizeDelta: {x: 420, y: 120}
175
+ m_AnchoredPosition: {x: 0, y: -20}
176
+ m_SizeDelta: {x: 200, y: 40}
177
177
  m_Pivot: {x: 0.5, y: 0.5}
178
178
  --- !u!222 &6150942826548885810
179
179
  CanvasRenderer:
@@ -202,7 +202,7 @@ MonoBehaviour:
202
202
  m_OnCullStateChanged:
203
203
  m_PersistentCalls:
204
204
  m_Calls: []
205
- m_Sprite: {fileID: 21300000, guid: 4b23b6267c9a94d64b94d18ac0f19754, type: 3}
205
+ m_Sprite: {fileID: 21300000, guid: 121fadaa5f515439bb5fa46c7f9d2c2c, type: 3}
206
206
  m_Type: 1
207
207
  m_PreserveAspect: 0
208
208
  m_FillCenter: 1
@@ -286,8 +286,8 @@ RectTransform:
286
286
  m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
287
287
  m_AnchorMin: {x: 0, y: 1}
288
288
  m_AnchorMax: {x: 0, y: 1}
289
- m_AnchoredPosition: {x: 210, y: -50}
290
- m_SizeDelta: {x: 330, y: 60}
289
+ m_AnchoredPosition: {x: 100, y: -20}
290
+ m_SizeDelta: {x: 180, y: 35}
291
291
  m_Pivot: {x: 0.5, y: 0.5}
292
292
  --- !u!222 &6511217540227465427
293
293
  CanvasRenderer:
@@ -317,8 +317,8 @@ MonoBehaviour:
317
317
  m_PersistentCalls:
318
318
  m_Calls: []
319
319
  m_FontData:
320
- m_Font: {fileID: 10102, guid: 0000000000000000e000000000000000, type: 0}
321
- m_FontSize: 20
320
+ m_Font: {fileID: 12800000, guid: c76570f7b9a4942ae84d6491f2669330, type: 3}
321
+ m_FontSize: 11
322
322
  m_FontStyle: 0
323
323
  m_BestFit: 0
324
324
  m_MinSize: 0
@@ -8,6 +8,7 @@ using System.Net.Http.Headers;
8
8
  using System.Text;
9
9
  using Newtonsoft.Json;
10
10
  using TapSDK.Core.Internal.Json;
11
+ using TapSDK.Core.Internal.Log;
11
12
 
12
13
  namespace TapSDK.Core.Internal.Http {
13
14
  public class TapHttpClient {
@@ -130,7 +131,7 @@ namespace TapSDK.Core.Internal.Http {
130
131
  code = (int)error["code"];
131
132
  message = error["error"].ToString();
132
133
  } catch (Exception e) {
133
- TapLogger.Error(e);
134
+ TapLog.Error(e.Message ?? "");
134
135
  }
135
136
  return new TapException(code, message);
136
137
  }
@@ -3,6 +3,7 @@ using System.Text;
3
3
  using System.Collections.Specialized;
4
4
  using System.Net.Http;
5
5
  using UnityEngine;
6
+ using TapSDK.Core.Internal.Log;
6
7
 
7
8
  namespace TapSDK.Core.Internal.Http {
8
9
  public class TapHttpUtils {
@@ -36,7 +37,7 @@ namespace TapSDK.Core.Internal.Http {
36
37
  sb.AppendLine($"Content: {content}");
37
38
  }
38
39
  sb.AppendLine("=== HTTP Request End ===");
39
- Debug.Log(sb.ToString());
40
+ TapLog.Log(sb.ToString());
40
41
  }
41
42
 
42
43
  public static void PrintResponse(HttpResponseMessage response, string content = null) {
@@ -51,7 +52,7 @@ namespace TapSDK.Core.Internal.Http {
51
52
  sb.AppendLine($"Content: {content}");
52
53
  }
53
54
  sb.AppendLine("=== HTTP Response End ===");
54
- Debug.Log(sb.ToString());
55
+ TapLog.Log(sb.ToString());
55
56
  }
56
57
 
57
58
  public static NameValueCollection ParseQueryString(string queryString)
@@ -1,3 +1,4 @@
1
+ using System;
1
2
  using UnityEngine;
2
3
 
3
4
  namespace TapSDK.Core.Internal.Log
@@ -42,28 +43,63 @@ namespace TapSDK.Core.Internal.Log
42
43
  TapLog.Error(message, detail, tag, module);
43
44
  }
44
45
 
46
+ public static void Error(Exception e)
47
+ {
48
+ TapLog.Error(e?.Message ?? "");
49
+ }
50
+
45
51
  // 输出带有自定义颜色和标签的普通日志
46
52
  public static void Log(string message, string detail = null, string tag = TAG, string module = null)
47
53
  {
54
+ if (string.IsNullOrEmpty(message))
55
+ {
56
+ return;
57
+ }
58
+ string msg = GetFormattedMessage(message: message, detail: detail, colorHex: InfoColor, tag: tag, module: module);
59
+ if (TapLogger.LogDelegate != null)
60
+ {
61
+ TapLogger.Debug(msg);
62
+ return;
63
+ }
48
64
  if (Enabled)
49
65
  {
50
- Debug.Log(GetFormattedMessage(message: message, detail: detail, colorHex: InfoColor, tag: tag, module: module));
66
+ Debug.Log(msg);
51
67
  }
52
68
  }
53
69
 
54
70
  // 输出带有自定义颜色和标签的警告
55
71
  public static void Warning(string message, string detail = null, string tag = TAG, string module = null)
56
72
  {
73
+ if (string.IsNullOrEmpty(message))
74
+ {
75
+ return;
76
+ }
77
+ string msg = GetFormattedMessage(message: message, detail: detail, colorHex: WarningColor, tag: tag, module: module);
78
+ if (TapLogger.LogDelegate != null)
79
+ {
80
+ TapLogger.Warn(msg);
81
+ return;
82
+ }
57
83
  if (Enabled)
58
84
  {
59
- Debug.LogWarning(GetFormattedMessage(message: message, detail: detail, colorHex: WarningColor, tag: tag, module: module));
85
+ Debug.LogWarning(msg);
60
86
  }
61
87
  }
62
88
 
63
89
  // 输出带有自定义颜色和标签的错误
64
90
  public static void Error(string message, string detail = null, string tag = TAG, string module = null)
65
91
  {
66
- Debug.LogError(GetFormattedMessage(message: message, detail: detail, colorHex: ErrorColor, tag: tag, module: module));
92
+ if (string.IsNullOrEmpty(message))
93
+ {
94
+ return;
95
+ }
96
+ string msg = GetFormattedMessage(message: message, detail: detail, colorHex: ErrorColor, tag: tag, module: module);
97
+ if (TapLogger.LogDelegate != null)
98
+ {
99
+ TapLogger.Error(msg);
100
+ return;
101
+ }
102
+ Debug.LogError(msg);
67
103
  }
68
104
 
69
105
  // 格式化带有颜色和标签的消息
@@ -1,5 +1,6 @@
1
1
  using System;
2
2
  using System.Linq;
3
+ using TapSDK.Core.Internal.Log;
3
4
  using UnityEngine;
4
5
 
5
6
  namespace TapSDK.Core.Internal {
@@ -11,15 +12,11 @@ namespace TapSDK.Core.Internal {
11
12
  /// <param name="startWith"></param>
12
13
  /// <returns></returns>
13
14
  public static object CreatePlatformImplementationObject(Type interfaceType, string startWith) {
14
- // Debug.Log($"Searching for types in assemblies starting with: {startWith} that implement: {interfaceType}");
15
15
 
16
16
  // 获取所有符合条件的程序集
17
17
  var assemblies = AppDomain.CurrentDomain.GetAssemblies()
18
18
  .Where(assembly => assembly.GetName().FullName.StartsWith(startWith));
19
19
 
20
- // foreach (var assembly in assemblies) {
21
- // Debug.Log($"Found assembly: {assembly.GetName().FullName}");
22
- // }
23
20
 
24
21
  // 获取符合条件的类型
25
22
  Type platformSupportType = assemblies
@@ -27,17 +24,16 @@ namespace TapSDK.Core.Internal {
27
24
  .SingleOrDefault(clazz => interfaceType.IsAssignableFrom(clazz) && clazz.IsClass);
28
25
 
29
26
  if (platformSupportType != null) {
30
- // Debug.Log($"Found type: {platformSupportType.FullName}, creating instance...");
31
27
  try
32
28
  {
33
29
  return Activator.CreateInstance(platformSupportType);
34
30
  }
35
31
  catch (Exception ex)
36
32
  {
37
- Debug.LogError($"Failed to create instance of {platformSupportType.FullName}: {ex}");
33
+ TapLog.Error($"Failed to create instance of {platformSupportType.FullName}: {ex}");
38
34
  }
39
35
  } else {
40
- Debug.LogError($"No type found that implements {interfaceType} in assemblies starting with {startWith}");
36
+ TapLog.Error($"No type found that implements {interfaceType} in assemblies starting with {startWith}");
41
37
  }
42
38
 
43
39
  return null;
@@ -2,6 +2,7 @@
2
2
  using System.Collections.Generic;
3
3
  using System.Linq;
4
4
  using System.Threading.Tasks;
5
+ using TapSDK.Core.Internal.Log;
5
6
  using UnityEngine;
6
7
  using UnityEngine.UI;
7
8
 
@@ -615,7 +616,7 @@ namespace TapSDK.UI
615
616
  {
616
617
  if (!string.IsNullOrEmpty(text))
617
618
  {
618
- Debug.LogFormat($"[UIManager] Call OpenTip text:{text} ");
619
+ TapLog.Log("[UIManager] Call OpenTip text: " + text);
619
620
  var tip = OpenUI<TipPanelController>("TapCommonTip", new TipPanelOpenParam(text, textColor, textAnchor));
620
621
  if (tip != null)
621
622
  {
@@ -1,5 +1,6 @@
1
1
  using System;
2
2
  using System.Collections;
3
+ using TapSDK.Core.Internal.Log;
3
4
  using UnityEngine;
4
5
  using UnityEngine.UI;
5
6
 
@@ -75,7 +76,7 @@ namespace TapSDK.UI
75
76
  #if UNITY_EDITOR
76
77
  if (canvas == null)
77
78
  {
78
- Debug.LogErrorFormat("[TapSDK UI] BasePanel Must Be Related To Canvas Component!");
79
+ TapLog.Log("[TapSDK UI] BasePanel Must Be Related To Canvas Component!");
79
80
  }
80
81
  #endif
81
82
  }