com.taptap.sdk.core 4.3.0-aplha.12
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.
- package/Editor/BuildTargetUtils.cs +14 -0
- package/Editor/BuildTargetUtils.cs.meta +11 -0
- package/Editor/LinkXMLGenerator.cs +70 -0
- package/Editor/LinkXMLGenerator.cs.meta +11 -0
- package/Editor/Plist.cs +954 -0
- package/Editor/Plist.cs.meta +3 -0
- package/Editor/SDKLinkProcessBuild.cs +119 -0
- package/Editor/SDKLinkProcessBuild.cs.meta +11 -0
- package/Editor/TapFileHelper.cs +168 -0
- package/Editor/TapFileHelper.cs.meta +3 -0
- package/Editor/TapSDK.Core.Editor.asmdef +15 -0
- package/Editor/TapSDK.Core.Editor.asmdef.meta +7 -0
- package/Editor/TapSDKCoreCompile.cs +284 -0
- package/Editor/TapSDKCoreCompile.cs.meta +3 -0
- package/Editor/TapSDKCoreIOSProcessor.cs +74 -0
- package/Editor/TapSDKCoreIOSProcessor.cs.meta +3 -0
- package/Editor/UI/ScrollViewEditor.cs +267 -0
- package/Editor/UI/ScrollViewEditor.cs.meta +12 -0
- package/Editor/UI/ScrollViewExEditor.cs +34 -0
- package/Editor/UI/ScrollViewExEditor.cs.meta +12 -0
- package/Editor/UI/TapSDK.UI.Editor.asmdef +17 -0
- package/Editor/UI/TapSDK.UI.Editor.asmdef.meta +7 -0
- package/Editor/UI.meta +9 -0
- package/Editor.meta +8 -0
- package/Mobile/Editor/NativeDependencies.xml +22 -0
- package/Mobile/Editor/NativeDependencies.xml.meta +7 -0
- package/Mobile/Editor/TapCommonMobileProcessBuild.cs +20 -0
- package/Mobile/Editor/TapCommonMobileProcessBuild.cs.meta +11 -0
- package/Mobile/Editor/TapSDK.Core.Mobile.Editor.asmdef +17 -0
- package/Mobile/Editor/TapSDK.Core.Mobile.Editor.asmdef.meta +7 -0
- package/Mobile/Editor.meta +8 -0
- package/Mobile/Runtime/AndroidNativeWrapper.cs +50 -0
- package/Mobile/Runtime/AndroidNativeWrapper.cs.meta +11 -0
- package/Mobile/Runtime/Bridge.cs +84 -0
- package/Mobile/Runtime/Bridge.cs.meta +11 -0
- package/Mobile/Runtime/BridgeAndroid.cs +73 -0
- package/Mobile/Runtime/BridgeAndroid.cs.meta +11 -0
- package/Mobile/Runtime/BridgeCallback.cs +35 -0
- package/Mobile/Runtime/BridgeCallback.cs.meta +11 -0
- package/Mobile/Runtime/BridgeIOS.cs +113 -0
- package/Mobile/Runtime/BridgeIOS.cs.meta +11 -0
- package/Mobile/Runtime/Command.cs +119 -0
- package/Mobile/Runtime/Command.cs.meta +11 -0
- package/Mobile/Runtime/Constants.cs +9 -0
- package/Mobile/Runtime/Constants.cs.meta +11 -0
- package/Mobile/Runtime/EngineBridgeInitializer.cs +33 -0
- package/Mobile/Runtime/EngineBridgeInitializer.cs.meta +11 -0
- package/Mobile/Runtime/IBridge.cs +15 -0
- package/Mobile/Runtime/IBridge.cs.meta +11 -0
- package/Mobile/Runtime/IOSNativeWrapper.cs +273 -0
- package/Mobile/Runtime/IOSNativeWrapper.cs.meta +11 -0
- package/Mobile/Runtime/Result.cs +37 -0
- package/Mobile/Runtime/Result.cs.meta +11 -0
- package/Mobile/Runtime/TapCoreMobile.cs +71 -0
- package/Mobile/Runtime/TapCoreMobile.cs.meta +11 -0
- package/Mobile/Runtime/TapEventMobile.cs +265 -0
- package/Mobile/Runtime/TapEventMobile.cs.meta +11 -0
- package/Mobile/Runtime/TapSDK.Core.Mobile.Runtime.asmdef +18 -0
- package/Mobile/Runtime/TapSDK.Core.Mobile.Runtime.asmdef.meta +7 -0
- package/Mobile/Runtime/TapUUID.cs +9 -0
- package/Mobile/Runtime/TapUUID.cs.meta +11 -0
- package/Mobile/Runtime.meta +8 -0
- package/Mobile.meta +8 -0
- package/Plugins/iOS.meta +8 -0
- package/Plugins.meta +8 -0
- package/Resources/Fonts/taptap-sdk-bold.ttf +0 -0
- package/Resources/Fonts/taptap-sdk-bold.ttf.meta +22 -0
- package/Resources/Fonts/taptap-sdk.ttf +0 -0
- package/Resources/Fonts/taptap-sdk.ttf.meta +21 -0
- package/Resources/Fonts.meta +8 -0
- package/Resources/Loading.prefab +260 -0
- package/Resources/Loading.prefab.meta +7 -0
- package/Resources/TapCommonTip.prefab +194 -0
- package/Resources/TapCommonTip.prefab.meta +7 -0
- package/Resources/TapCommonToastBlack.prefab +528 -0
- package/Resources/TapCommonToastBlack.prefab.meta +7 -0
- package/Resources/TapCommonToastWhite.prefab +411 -0
- package/Resources/TapCommonToastWhite.prefab.meta +7 -0
- package/Resources/TapSDKCommonTapIcon-v2.png +0 -0
- package/Resources/TapSDKCommonTapIcon-v2.png.meta +128 -0
- package/Resources/TapSDKCommonTapIcon.png +0 -0
- package/Resources/TapSDKCommonTapIcon.png.meta +128 -0
- package/Resources/TapSDKCommonToastBg.png +0 -0
- package/Resources/TapSDKCommonToastBg.png.meta +128 -0
- package/Resources/TapSDKConstantUIRoot.prefab +100 -0
- package/Resources/TapSDKConstantUIRoot.prefab.meta +7 -0
- package/Resources/TapSDKUIRoot.prefab +100 -0
- package/Resources/TapSDKUIRoot.prefab.meta +7 -0
- package/Resources/TapTapBtn_White.png +0 -0
- package/Resources/TapTapBtn_White.png.meta +128 -0
- package/Resources/TapTapBtn_White_2.png +0 -0
- package/Resources/TapTapBtn_White_2.png.meta +128 -0
- package/Resources/ToastBackground.png +0 -0
- package/Resources/ToastBackground.png.meta +128 -0
- package/Resources/detail_bg.png +0 -0
- package/Resources/detail_bg.png.meta +92 -0
- package/Resources/success.png +0 -0
- package/Resources/success.png.meta +128 -0
- package/Resources/taptap-bg.png +0 -0
- package/Resources/taptap-bg.png.meta +140 -0
- package/Resources/taptap-close.png +0 -0
- package/Resources/taptap-close.png.meta +146 -0
- package/Resources/taptap-router-v2.png +0 -0
- package/Resources/taptap-router-v2.png.meta +128 -0
- package/Resources/taptap-router.png +0 -0
- package/Resources/taptap-router.png.meta +146 -0
- package/Resources/taptap-sdk-refresh 1.png +0 -0
- package/Resources/taptap-sdk-refresh 1.png.meta +128 -0
- package/Resources/taptap-toast-error.png +0 -0
- package/Resources/taptap-toast-error.png.meta +128 -0
- package/Resources/taptap-toast-info.png +0 -0
- package/Resources/taptap-toast-info.png.meta +128 -0
- package/Resources/taptap-toast-success.png +0 -0
- package/Resources/taptap-toast-success.png.meta +128 -0
- package/Resources/taptap-toast-warning.png +0 -0
- package/Resources/taptap-toast-warning.png.meta +128 -0
- package/Resources.meta +8 -0
- package/Runtime/Internal/Http/TapHttpClient.cs +176 -0
- package/Runtime/Internal/Http/TapHttpClient.cs.meta +11 -0
- package/Runtime/Internal/Http/TapHttpUtils.cs +83 -0
- package/Runtime/Internal/Http/TapHttpUtils.cs.meta +11 -0
- package/Runtime/Internal/Http.meta +8 -0
- package/Runtime/Internal/Init/IInitTask.cs +18 -0
- package/Runtime/Internal/Init/IInitTask.cs.meta +11 -0
- package/Runtime/Internal/Init.meta +8 -0
- package/Runtime/Internal/Json/TapJsonConverter.cs +40 -0
- package/Runtime/Internal/Json/TapJsonConverter.cs.meta +11 -0
- package/Runtime/Internal/Json.meta +8 -0
- package/Runtime/Internal/Platform/ITapCorePlatform.cs +12 -0
- package/Runtime/Internal/Platform/ITapCorePlatform.cs.meta +11 -0
- package/Runtime/Internal/Platform/ITapEventPlatform.cs +37 -0
- package/Runtime/Internal/Platform/ITapEventPlatform.cs.meta +11 -0
- package/Runtime/Internal/Platform/PlatformTypeUtils.cs +46 -0
- package/Runtime/Internal/Platform/PlatformTypeUtils.cs.meta +11 -0
- package/Runtime/Internal/Platform.meta +8 -0
- package/Runtime/Internal/UI/Base/Const.cs +27 -0
- package/Runtime/Internal/UI/Base/Const.cs.meta +11 -0
- package/Runtime/Internal/UI/Base/GraphicRaycasterBugFixed.cs +240 -0
- package/Runtime/Internal/UI/Base/GraphicRaycasterBugFixed.cs.meta +3 -0
- package/Runtime/Internal/UI/Base/LoadingPanelController.cs +29 -0
- package/Runtime/Internal/UI/Base/LoadingPanelController.cs.meta +11 -0
- package/Runtime/Internal/UI/Base/MonoSingleton.cs +102 -0
- package/Runtime/Internal/UI/Base/MonoSingleton.cs.meta +11 -0
- package/Runtime/Internal/UI/Base/Singleton.cs +29 -0
- package/Runtime/Internal/UI/Base/Singleton.cs.meta +11 -0
- package/Runtime/Internal/UI/Base/TipPanelController.cs +45 -0
- package/Runtime/Internal/UI/Base/TipPanelController.cs.meta +3 -0
- package/Runtime/Internal/UI/Base/ToastBlackPanelController.cs +95 -0
- package/Runtime/Internal/UI/Base/ToastBlackPanelController.cs.meta +11 -0
- package/Runtime/Internal/UI/Base/ToastWhitePanelController.cs +79 -0
- package/Runtime/Internal/UI/Base/ToastWhitePanelController.cs.meta +3 -0
- package/Runtime/Internal/UI/Base/UIManager.cs +724 -0
- package/Runtime/Internal/UI/Base/UIManager.cs.meta +11 -0
- package/Runtime/Internal/UI/Base.meta +8 -0
- package/Runtime/Internal/UI/BasePanel/BasePanelController.cs +385 -0
- package/Runtime/Internal/UI/BasePanel/BasePanelController.cs.meta +11 -0
- package/Runtime/Internal/UI/BasePanel.meta +8 -0
- package/Runtime/Internal/UI/Params/BasePanelConfig.cs +18 -0
- package/Runtime/Internal/UI/Params/BasePanelConfig.cs.meta +11 -0
- package/Runtime/Internal/UI/Params/IOpenPanelParameter.cs +7 -0
- package/Runtime/Internal/UI/Params/IOpenPanelParameter.cs.meta +11 -0
- package/Runtime/Internal/UI/Params.meta +8 -0
- package/Runtime/Internal/UI/ScrollViewEx/ObjPool/SimpleObjPool.cs +76 -0
- package/Runtime/Internal/UI/ScrollViewEx/ObjPool/SimpleObjPool.cs.meta +12 -0
- package/Runtime/Internal/UI/ScrollViewEx/ObjPool.meta +9 -0
- package/Runtime/Internal/UI/ScrollViewEx/ScrollView/ScrollView.cs +828 -0
- package/Runtime/Internal/UI/ScrollViewEx/ScrollView/ScrollView.cs.meta +12 -0
- package/Runtime/Internal/UI/ScrollViewEx/ScrollView/ScrollViewEx.cs +245 -0
- package/Runtime/Internal/UI/ScrollViewEx/ScrollView/ScrollViewEx.cs.meta +12 -0
- package/Runtime/Internal/UI/ScrollViewEx/ScrollView.meta +9 -0
- package/Runtime/Internal/UI/ScrollViewEx.meta +8 -0
- package/Runtime/Internal/UI.meta +8 -0
- package/Runtime/Internal/Utils/BridgeUtils.cs +29 -0
- package/Runtime/Internal/Utils/BridgeUtils.cs.meta +11 -0
- package/Runtime/Internal/Utils/ImageUtils.cs +147 -0
- package/Runtime/Internal/Utils/ImageUtils.cs.meta +11 -0
- package/Runtime/Internal/Utils/TapLoom.cs +155 -0
- package/Runtime/Internal/Utils/TapLoom.cs.meta +11 -0
- package/Runtime/Internal/Utils/UrlUtils.cs +34 -0
- package/Runtime/Internal/Utils/UrlUtils.cs.meta +11 -0
- package/Runtime/Internal/Utils.meta +8 -0
- package/Runtime/Internal.meta +8 -0
- package/Runtime/Public/DataStorage.cs +141 -0
- package/Runtime/Public/DataStorage.cs.meta +11 -0
- package/Runtime/Public/ITapPropertiesProxy.cs +6 -0
- package/Runtime/Public/ITapPropertiesProxy.cs.meta +11 -0
- package/Runtime/Public/Json.cs +636 -0
- package/Runtime/Public/Json.cs.meta +11 -0
- package/Runtime/Public/Log/TapLogLevel.cs +7 -0
- package/Runtime/Public/Log/TapLogLevel.cs.meta +11 -0
- package/Runtime/Public/Log/TapLogger.cs +48 -0
- package/Runtime/Public/Log/TapLogger.cs.meta +11 -0
- package/Runtime/Public/Log.meta +8 -0
- package/Runtime/Public/Platform.cs +27 -0
- package/Runtime/Public/Platform.cs.meta +11 -0
- package/Runtime/Public/RegionType.cs +8 -0
- package/Runtime/Public/RegionType.cs.meta +11 -0
- package/Runtime/Public/SafeDictionary.cs +27 -0
- package/Runtime/Public/SafeDictionary.cs.meta +11 -0
- package/Runtime/Public/TapError.cs +62 -0
- package/Runtime/Public/TapError.cs.meta +11 -0
- package/Runtime/Public/TapErrorCode.cs +44 -0
- package/Runtime/Public/TapErrorCode.cs.meta +11 -0
- package/Runtime/Public/TapException.cs +24 -0
- package/Runtime/Public/TapException.cs.meta +11 -0
- package/Runtime/Public/TapLanguage.cs +21 -0
- package/Runtime/Public/TapLanguage.cs.meta +11 -0
- package/Runtime/Public/TapLocalizeManager.cs +128 -0
- package/Runtime/Public/TapLocalizeManager.cs.meta +11 -0
- package/Runtime/Public/TapTapEvent.cs +93 -0
- package/Runtime/Public/TapTapEvent.cs.meta +11 -0
- package/Runtime/Public/TapTapSDK.cs +96 -0
- package/Runtime/Public/TapTapSDK.cs.meta +11 -0
- package/Runtime/Public/TapTapSDKCoreOptions.cs +104 -0
- package/Runtime/Public/TapTapSDKCoreOptions.cs.meta +11 -0
- package/Runtime/Public.meta +8 -0
- package/Runtime/TapSDK.Core.Runtime.asmdef +3 -0
- package/Runtime/TapSDK.Core.Runtime.asmdef.meta +7 -0
- package/Runtime.meta +8 -0
- package/Standalone/Editor/TapCoreStandaloneProcessBuild.cs +20 -0
- package/Standalone/Editor/TapCoreStandaloneProcessBuild.cs.meta +11 -0
- package/Standalone/Editor/TapSDK.Core.Standalone.Editor.asmdef +17 -0
- package/Standalone/Editor/TapSDK.Core.Standalone.Editor.asmdef.meta +7 -0
- package/Standalone/Editor.meta +8 -0
- package/Standalone/Plugins/macOS/TapDBDeviceInfo.bundle/Contents/Info.plist +46 -0
- package/Standalone/Plugins/macOS/TapDBDeviceInfo.bundle/Contents/Info.plist.meta +7 -0
- package/Standalone/Plugins/macOS/TapDBDeviceInfo.bundle/Contents/MacOS/TapDBDeviceInfo +0 -0
- package/Standalone/Plugins/macOS/TapDBDeviceInfo.bundle/Contents/MacOS/TapDBDeviceInfo.meta +7 -0
- package/Standalone/Plugins/macOS/TapDBDeviceInfo.bundle/Contents/MacOS.meta +8 -0
- package/Standalone/Plugins/macOS/TapDBDeviceInfo.bundle/Contents/_CodeSignature/CodeResources +115 -0
- package/Standalone/Plugins/macOS/TapDBDeviceInfo.bundle/Contents/_CodeSignature/CodeResources.meta +7 -0
- package/Standalone/Plugins/macOS/TapDBDeviceInfo.bundle/Contents/_CodeSignature.meta +8 -0
- package/Standalone/Plugins/macOS/TapDBDeviceInfo.bundle/Contents.meta +8 -0
- package/Standalone/Plugins/macOS/TapDBDeviceInfo.bundle.meta +33 -0
- package/Standalone/Plugins/macOS.meta +8 -0
- package/Standalone/Plugins.meta +8 -0
- package/Standalone/Runtime/Internal/Constants.cs +37 -0
- package/Standalone/Runtime/Internal/Constants.cs.meta +11 -0
- package/Standalone/Runtime/Internal/DeviceInfo.cs +152 -0
- package/Standalone/Runtime/Internal/DeviceInfo.cs.meta +11 -0
- package/Standalone/Runtime/Internal/EventSender.cs +239 -0
- package/Standalone/Runtime/Internal/EventSender.cs.meta +11 -0
- package/Standalone/Runtime/Internal/Http/HttpClient.cs +211 -0
- package/Standalone/Runtime/Internal/Http/HttpClient.cs.meta +11 -0
- package/Standalone/Runtime/Internal/Http/NetUtils.cs +48 -0
- package/Standalone/Runtime/Internal/Http/NetUtils.cs.meta +11 -0
- package/Standalone/Runtime/Internal/Http/TimeUtil.cs +30 -0
- package/Standalone/Runtime/Internal/Http/TimeUtil.cs.meta +11 -0
- package/Standalone/Runtime/Internal/Http.meta +8 -0
- package/Standalone/Runtime/Internal/Identity.cs +43 -0
- package/Standalone/Runtime/Internal/Identity.cs.meta +11 -0
- package/Standalone/Runtime/Internal/PlayRecorder.cs +53 -0
- package/Standalone/Runtime/Internal/PlayRecorder.cs.meta +11 -0
- package/Standalone/Runtime/Internal/Prefs.cs +85 -0
- package/Standalone/Runtime/Internal/Prefs.cs.meta +11 -0
- package/Standalone/Runtime/Internal/Tracker.cs +318 -0
- package/Standalone/Runtime/Internal/Tracker.cs.meta +11 -0
- package/Standalone/Runtime/Internal/User.cs +51 -0
- package/Standalone/Runtime/Internal/User.cs.meta +11 -0
- package/Standalone/Runtime/Internal.meta +8 -0
- package/Standalone/Runtime/Public/EventManager.cs +41 -0
- package/Standalone/Runtime/Public/EventManager.cs.meta +11 -0
- package/Standalone/Runtime/Public/TapCoreStandalone.cs +197 -0
- package/Standalone/Runtime/Public/TapCoreStandalone.cs.meta +11 -0
- package/Standalone/Runtime/Public/TapEventStandalone.cs +281 -0
- package/Standalone/Runtime/Public/TapEventStandalone.cs.meta +11 -0
- package/Standalone/Runtime/Public.meta +8 -0
- package/Standalone/Runtime/TapSDK.Core.Standalone.Runtime.asmdef +21 -0
- package/Standalone/Runtime/TapSDK.Core.Standalone.Runtime.asmdef.meta +7 -0
- package/Standalone/Runtime.meta +8 -0
- package/Standalone.meta +8 -0
- package/package.json +8 -0
- package/package.json.meta +7 -0
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
using System;
|
|
2
|
+
using System.Text;
|
|
3
|
+
|
|
4
|
+
namespace TapSDK.Core {
|
|
5
|
+
public class TapLogger {
|
|
6
|
+
/// <summary>
|
|
7
|
+
/// Configures the logger.
|
|
8
|
+
/// </summary>
|
|
9
|
+
/// <value>The log delegate.</value>
|
|
10
|
+
public static Action<TapLogLevel, string> LogDelegate {
|
|
11
|
+
get; set;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
public static void Debug(string log) {
|
|
15
|
+
LogDelegate?.Invoke(TapLogLevel.Debug, log);
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
public static void Debug(string format, params object[] args) {
|
|
19
|
+
LogDelegate?.Invoke(TapLogLevel.Debug, string.Format(format, args));
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
public static void Warn(string log) {
|
|
23
|
+
LogDelegate?.Invoke(TapLogLevel.Warn, log);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
public static void Warn(string format, params object[] args) {
|
|
27
|
+
LogDelegate?.Invoke(TapLogLevel.Warn, string.Format(format, args));
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
public static void Error(string log) {
|
|
31
|
+
LogDelegate?.Invoke(TapLogLevel.Error, log);
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
public static void Error(string format, params object[] args) {
|
|
35
|
+
LogDelegate?.Invoke(TapLogLevel.Error, string.Format(format, args));
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
public static void Error(Exception e) {
|
|
39
|
+
StringBuilder sb = new StringBuilder();
|
|
40
|
+
sb.Append(e.GetType());
|
|
41
|
+
sb.Append("\n");
|
|
42
|
+
sb.Append(e.Message);
|
|
43
|
+
sb.Append("\n");
|
|
44
|
+
sb.Append(e.StackTrace);
|
|
45
|
+
Error(sb.ToString());
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
using UnityEngine;
|
|
2
|
+
|
|
3
|
+
namespace TapSDK.Core
|
|
4
|
+
{
|
|
5
|
+
public class Platform
|
|
6
|
+
{
|
|
7
|
+
public static bool IsAndroid()
|
|
8
|
+
{
|
|
9
|
+
return Application.platform == RuntimePlatform.Android;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
public static bool IsIOS()
|
|
13
|
+
{
|
|
14
|
+
return Application.platform == RuntimePlatform.IPhonePlayer;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
public static bool IsWin32()
|
|
18
|
+
{
|
|
19
|
+
return Application.platform == RuntimePlatform.WindowsPlayer;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
public static bool IsMacOS()
|
|
23
|
+
{
|
|
24
|
+
return Application.platform == RuntimePlatform.OSXPlayer;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
using System.Collections.Generic;
|
|
2
|
+
|
|
3
|
+
namespace TapSDK.Core
|
|
4
|
+
{
|
|
5
|
+
public static class SafeDictionary
|
|
6
|
+
{
|
|
7
|
+
public static T GetValue<T> (Dictionary<string, object> dic, string key, T defaultVal = default(T))
|
|
8
|
+
{
|
|
9
|
+
if (dic == null || dic.Keys.Count == 0) return default(T);
|
|
10
|
+
if (!dic.TryGetValue(key, out var outputValue))
|
|
11
|
+
return defaultVal;
|
|
12
|
+
if(typeof(T) == typeof(int)){
|
|
13
|
+
return (T)(object)int.Parse(outputValue.ToString());
|
|
14
|
+
}
|
|
15
|
+
if(typeof(T) == typeof(double)){
|
|
16
|
+
return (T)(object)double.Parse(outputValue.ToString());
|
|
17
|
+
}
|
|
18
|
+
if(typeof(T) == typeof(long)){
|
|
19
|
+
return (T)(object)long.Parse(outputValue.ToString());
|
|
20
|
+
}
|
|
21
|
+
if(typeof(T) == typeof(bool)){
|
|
22
|
+
return (T)outputValue;
|
|
23
|
+
}
|
|
24
|
+
return (T) outputValue;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
using System;
|
|
2
|
+
using System.Collections.Generic;
|
|
3
|
+
|
|
4
|
+
namespace TapSDK.Core
|
|
5
|
+
{
|
|
6
|
+
public class TapError
|
|
7
|
+
{
|
|
8
|
+
public int code;
|
|
9
|
+
|
|
10
|
+
public string errorDescription;
|
|
11
|
+
|
|
12
|
+
public TapError(string json)
|
|
13
|
+
{
|
|
14
|
+
if (string.IsNullOrEmpty(json))
|
|
15
|
+
{
|
|
16
|
+
return;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
var dic = Json.Deserialize(json) as Dictionary<string, object>;
|
|
20
|
+
code = SafeDictionary.GetValue<int>(dic, "code");
|
|
21
|
+
errorDescription = SafeDictionary.GetValue<string>(dic, "error_description");
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
public TapError()
|
|
25
|
+
{
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
public static TapError SafeConstructorTapError(string json)
|
|
29
|
+
{
|
|
30
|
+
return string.IsNullOrEmpty(json) ? null : new TapError(json);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
public static TapError UndefinedError()
|
|
34
|
+
{
|
|
35
|
+
return new TapError(TapErrorCode.ERROR_CODE_UNDEFINED, "UnKnown Error");
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
public static TapError LoginCancelError()
|
|
39
|
+
{
|
|
40
|
+
return new TapError(TapErrorCode.ERROR_CODE_LOGIN_CANCEL, "Login Cancel");
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
public TapError(int code, string errorDescription)
|
|
44
|
+
{
|
|
45
|
+
this.code = code;
|
|
46
|
+
this.errorDescription = errorDescription;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
private static TapErrorCode ParseCode(int parseCode)
|
|
50
|
+
{
|
|
51
|
+
return Enum.IsDefined(typeof(TapErrorCode), parseCode)
|
|
52
|
+
? (TapErrorCode) Enum.ToObject(typeof(TapErrorCode), parseCode)
|
|
53
|
+
: TapErrorCode.ERROR_CODE_UNDEFINED;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
public TapError(TapErrorCode code, string errorDescription)
|
|
57
|
+
{
|
|
58
|
+
this.code = (int) code;
|
|
59
|
+
this.errorDescription = errorDescription;
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
namespace TapSDK.Core
|
|
2
|
+
{
|
|
3
|
+
public enum TapErrorCode
|
|
4
|
+
{
|
|
5
|
+
/*
|
|
6
|
+
* 未知错误
|
|
7
|
+
*/
|
|
8
|
+
ERROR_CODE_UNDEFINED = 80000,
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* SDK 未初始化
|
|
12
|
+
*/
|
|
13
|
+
ERROR_CODE_UNINITIALIZED = 80001,
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* 绑定取消
|
|
17
|
+
*/
|
|
18
|
+
ERROR_CODE_BIND_CANCEL = 80002,
|
|
19
|
+
/**
|
|
20
|
+
* 绑定错误
|
|
21
|
+
*/
|
|
22
|
+
ERROR_CODE_BIND_ERROR = 80003,
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* 登陆错误
|
|
26
|
+
*/
|
|
27
|
+
ERROR_CODE_LOGOUT_INVALID_LOGIN_STATE = 80004,
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* 登陆被踢出
|
|
31
|
+
*/
|
|
32
|
+
ERROR_CODE_LOGOUT_KICKED = 80007,
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* 桥接回调错误
|
|
36
|
+
*/
|
|
37
|
+
ERROR_CODE_BRIDGE_EXECUTE = 80080,
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* 登录取消
|
|
41
|
+
*/
|
|
42
|
+
ERROR_CODE_LOGIN_CANCEL = 80081
|
|
43
|
+
}
|
|
44
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
using System;
|
|
2
|
+
|
|
3
|
+
namespace TapSDK.Core
|
|
4
|
+
{
|
|
5
|
+
public class TapException : Exception
|
|
6
|
+
{
|
|
7
|
+
public int code;
|
|
8
|
+
|
|
9
|
+
public int Code {
|
|
10
|
+
get => code;
|
|
11
|
+
set {
|
|
12
|
+
code = value;
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
public string message;
|
|
17
|
+
|
|
18
|
+
public TapException(int code, string message) : base(message)
|
|
19
|
+
{
|
|
20
|
+
this.code = code;
|
|
21
|
+
this.message = message;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
namespace TapSDK.Core
|
|
2
|
+
{
|
|
3
|
+
public enum TapLanguage
|
|
4
|
+
{
|
|
5
|
+
AUTO = 0,
|
|
6
|
+
ZH_HANS = 1,
|
|
7
|
+
EN = 2,
|
|
8
|
+
ZH_HANT = 3,
|
|
9
|
+
JA = 4,
|
|
10
|
+
KO = 5,
|
|
11
|
+
TH = 6,
|
|
12
|
+
ID = 7,
|
|
13
|
+
DE = 8,
|
|
14
|
+
ES = 9,
|
|
15
|
+
FR = 10,
|
|
16
|
+
PT = 11,
|
|
17
|
+
RU = 12,
|
|
18
|
+
TR = 13,
|
|
19
|
+
VI = 14
|
|
20
|
+
}
|
|
21
|
+
}
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
using UnityEngine;
|
|
2
|
+
|
|
3
|
+
namespace TapSDK.Core
|
|
4
|
+
{
|
|
5
|
+
public class TapLocalizeManager
|
|
6
|
+
{
|
|
7
|
+
private static volatile TapLocalizeManager _instance;
|
|
8
|
+
private static readonly object ObjLock = new object();
|
|
9
|
+
|
|
10
|
+
public static TapLocalizeManager Instance
|
|
11
|
+
{
|
|
12
|
+
get
|
|
13
|
+
{
|
|
14
|
+
if (_instance != null) return _instance;
|
|
15
|
+
lock (ObjLock)
|
|
16
|
+
{
|
|
17
|
+
if (_instance == null)
|
|
18
|
+
{
|
|
19
|
+
_instance = new TapLocalizeManager();
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
return _instance;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
private TapLanguage _language = TapLanguage.AUTO;
|
|
28
|
+
private bool _regionIsCn;
|
|
29
|
+
|
|
30
|
+
public static void SetCurrentRegion(bool isCn)
|
|
31
|
+
{
|
|
32
|
+
Instance._regionIsCn = isCn;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
public static void SetCurrentLanguage(TapLanguage language)
|
|
36
|
+
{
|
|
37
|
+
Instance._language = language;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
public static TapLanguage GetCurrentLanguage()
|
|
41
|
+
{
|
|
42
|
+
if (Instance._language != TapLanguage.AUTO) return Instance._language;
|
|
43
|
+
Instance._language = GetSystemLanguage();
|
|
44
|
+
if (Instance._language == TapLanguage.AUTO)
|
|
45
|
+
{
|
|
46
|
+
Instance._language = Instance._regionIsCn ? TapLanguage.ZH_HANS : TapLanguage.EN;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
return Instance._language;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
public static string GetCurrentLanguageString() {
|
|
53
|
+
TapLanguage lang = GetCurrentLanguage();
|
|
54
|
+
switch (lang) {
|
|
55
|
+
case TapLanguage.ZH_HANS:
|
|
56
|
+
return "zh_CN";
|
|
57
|
+
case TapLanguage.EN:
|
|
58
|
+
return "en_US";
|
|
59
|
+
case TapLanguage.ZH_HANT:
|
|
60
|
+
return "zh_TW";
|
|
61
|
+
case TapLanguage.JA:
|
|
62
|
+
return "ja_JP";
|
|
63
|
+
case TapLanguage.KO:
|
|
64
|
+
return "ko_KR";
|
|
65
|
+
case TapLanguage.TH:
|
|
66
|
+
return "th_TH";
|
|
67
|
+
case TapLanguage.ID:
|
|
68
|
+
return "id_ID";
|
|
69
|
+
default:
|
|
70
|
+
return null;
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
public static string GetCurrentLanguageString2() {
|
|
75
|
+
TapLanguage lang = GetCurrentLanguage();
|
|
76
|
+
switch (lang) {
|
|
77
|
+
case TapLanguage.ZH_HANS:
|
|
78
|
+
return "zh-CN";
|
|
79
|
+
case TapLanguage.EN:
|
|
80
|
+
return "en-US";
|
|
81
|
+
case TapLanguage.ZH_HANT:
|
|
82
|
+
return "zh-TW";
|
|
83
|
+
case TapLanguage.JA:
|
|
84
|
+
return "ja-JP";
|
|
85
|
+
case TapLanguage.KO:
|
|
86
|
+
return "ko-KR";
|
|
87
|
+
case TapLanguage.TH:
|
|
88
|
+
return "th-TH";
|
|
89
|
+
case TapLanguage.ID:
|
|
90
|
+
return "id-ID";
|
|
91
|
+
default:
|
|
92
|
+
return null;
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
private static TapLanguage GetSystemLanguage()
|
|
97
|
+
{
|
|
98
|
+
var lang = TapLanguage.AUTO;
|
|
99
|
+
var sysLanguage = Application.systemLanguage;
|
|
100
|
+
switch (sysLanguage)
|
|
101
|
+
{
|
|
102
|
+
case SystemLanguage.ChineseSimplified:
|
|
103
|
+
lang = TapLanguage.ZH_HANS;
|
|
104
|
+
break;
|
|
105
|
+
case SystemLanguage.English:
|
|
106
|
+
lang = TapLanguage.EN;
|
|
107
|
+
break;
|
|
108
|
+
case SystemLanguage.ChineseTraditional:
|
|
109
|
+
lang = TapLanguage.ZH_HANT;
|
|
110
|
+
break;
|
|
111
|
+
case SystemLanguage.Japanese:
|
|
112
|
+
lang = TapLanguage.JA;
|
|
113
|
+
break;
|
|
114
|
+
case SystemLanguage.Korean:
|
|
115
|
+
lang = TapLanguage.KO;
|
|
116
|
+
break;
|
|
117
|
+
case SystemLanguage.Thai:
|
|
118
|
+
lang = TapLanguage.TH;
|
|
119
|
+
break;
|
|
120
|
+
case SystemLanguage.Indonesian:
|
|
121
|
+
lang = TapLanguage.ID;
|
|
122
|
+
break;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
return lang;
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
}
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
using System;
|
|
2
|
+
using System.Threading.Tasks;
|
|
3
|
+
using TapSDK.Core.Internal;
|
|
4
|
+
using UnityEngine;
|
|
5
|
+
using System.Reflection;
|
|
6
|
+
|
|
7
|
+
namespace TapSDK.Core {
|
|
8
|
+
public class TapTapEvent {
|
|
9
|
+
|
|
10
|
+
private static ITapEventPlatform platformWrapper;
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
static TapTapEvent() {
|
|
14
|
+
platformWrapper = PlatformTypeUtils.CreatePlatformImplementationObject(typeof(ITapEventPlatform),
|
|
15
|
+
"TapSDK.Core") as ITapEventPlatform;
|
|
16
|
+
if(platformWrapper == null) {
|
|
17
|
+
Debug.LogError("PlatformWrapper is null");
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
public static void SetUserID(string userID){
|
|
22
|
+
platformWrapper?.SetUserID(userID);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
public static void SetUserID(string userID, string properties){
|
|
26
|
+
platformWrapper?.SetUserID(userID,properties);
|
|
27
|
+
}
|
|
28
|
+
public static void ClearUser(){
|
|
29
|
+
platformWrapper?.ClearUser();
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
public static string GetDeviceId(){
|
|
33
|
+
if(platformWrapper != null) {
|
|
34
|
+
return platformWrapper?.GetDeviceId();
|
|
35
|
+
}
|
|
36
|
+
return "";
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
public static void LogEvent(string name, string properties){
|
|
40
|
+
platformWrapper?.LogEvent(name, properties);
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
public static void DeviceInitialize(string properties){
|
|
44
|
+
platformWrapper?.DeviceInitialize(properties);
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
public static void DeviceUpdate(string properties){
|
|
48
|
+
platformWrapper?.DeviceUpdate(properties);
|
|
49
|
+
}
|
|
50
|
+
public static void DeviceAdd(string properties){
|
|
51
|
+
platformWrapper?.DeviceAdd(properties);
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
public static void UserInitialize(string properties){
|
|
55
|
+
platformWrapper?.UserInitialize(properties);
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
public static void UserUpdate(string properties){
|
|
59
|
+
platformWrapper?.UserUpdate(properties);
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
public static void UserAdd(string properties){
|
|
63
|
+
platformWrapper?.UserAdd(properties);
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
public static void AddCommonProperty(string key, string value){
|
|
67
|
+
platformWrapper?.AddCommonProperty(key, value);
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
public static void AddCommon(string properties){
|
|
71
|
+
platformWrapper?.AddCommon(properties);
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
public static void ClearCommonProperty(string key){
|
|
75
|
+
platformWrapper?.ClearCommonProperty(key);
|
|
76
|
+
}
|
|
77
|
+
public static void ClearCommonProperties(string[] keys){
|
|
78
|
+
platformWrapper?.ClearCommonProperties(keys);
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
public static void ClearAllCommonProperties(){
|
|
82
|
+
platformWrapper?.ClearAllCommonProperties();
|
|
83
|
+
}
|
|
84
|
+
public static void LogChargeEvent(string orderID, string productName, long amount, string currencyType, string paymentMethod, string properties){
|
|
85
|
+
platformWrapper?.LogChargeEvent(orderID, productName, amount, currencyType, paymentMethod, properties);
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
public static void RegisterDynamicProperties(Func<string> callback){
|
|
89
|
+
platformWrapper?.RegisterDynamicProperties(callback);
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
}
|
|
93
|
+
}
|