com.taptap.sdk.core 4.5.4 → 4.5.6

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 (29) hide show
  1. package/Mobile/Editor/NativeDependencies.xml +2 -2
  2. package/Mobile/Runtime/TapCoreMobile.cs +5 -0
  3. package/Runtime/Internal/Platform/ITapCorePlatform.cs +2 -0
  4. package/Runtime/Internal/Utils/EventManager.cs +2 -0
  5. package/Runtime/Public/TapTapSDK.cs +7 -1
  6. package/Runtime/Public/TapTapSdkOptions.cs +5 -0
  7. package/Standalone/Plugins/x86_64/taptap_api.dll +0 -0
  8. package/Standalone/Plugins/x86_64/taptap_api.dll.meta +52 -0
  9. package/Standalone/Resources/Prefabs/TapClient/TapClientConnectTipPanel.prefab +983 -0
  10. package/Standalone/Resources/Prefabs/TapClient/TapClientConnectTipPanel.prefab.meta +7 -0
  11. package/Standalone/Resources/Prefabs/TapClient.meta +8 -0
  12. package/Standalone/Resources/Prefabs.meta +8 -0
  13. package/Standalone/Resources/Texures/TapClientConnectError.png +0 -0
  14. package/Standalone/Resources/Texures/TapClientConnectError.png.meta +128 -0
  15. package/Standalone/Resources/Texures.meta +8 -0
  16. package/Standalone/Resources.meta +8 -0
  17. package/Standalone/Runtime/Internal/Openlog/TapCoreTracker.cs +107 -0
  18. package/Standalone/Runtime/Internal/Openlog/TapCoreTracker.cs.meta +11 -0
  19. package/Standalone/Runtime/Internal/TapClientBridge.cs +219 -0
  20. package/Standalone/Runtime/Internal/TapClientBridge.cs.meta +11 -0
  21. package/Standalone/Runtime/Internal/TapClientBridgePoll.cs +36 -0
  22. package/Standalone/Runtime/Internal/TapClientBridgePoll.cs.meta +11 -0
  23. package/Standalone/Runtime/Internal/UI/TapClientConnectTipController.cs +55 -0
  24. package/Standalone/Runtime/Internal/UI/TapClientConnectTipController.cs.meta +11 -0
  25. package/Standalone/Runtime/Internal/UI/TapUnderLineText.cs +76 -0
  26. package/Standalone/Runtime/Internal/UI/TapUnderLineText.cs.meta +11 -0
  27. package/Standalone/Runtime/Internal/UI.meta +8 -0
  28. package/Standalone/Runtime/Public/TapCoreStandalone.cs +352 -0
  29. package/package.json +1 -1
@@ -0,0 +1,7 @@
1
+ fileFormatVersion: 2
2
+ guid: 09d3bfcab13a8417ab5749aa9b8e6ee3
3
+ PrefabImporter:
4
+ externalObjects: {}
5
+ userData:
6
+ assetBundleName:
7
+ assetBundleVariant:
@@ -0,0 +1,8 @@
1
+ fileFormatVersion: 2
2
+ guid: dee90da2b109147dc8d87fd85190d5c3
3
+ folderAsset: yes
4
+ DefaultImporter:
5
+ externalObjects: {}
6
+ userData:
7
+ assetBundleName:
8
+ assetBundleVariant:
@@ -0,0 +1,8 @@
1
+ fileFormatVersion: 2
2
+ guid: 68d6a0d056b944c799867350b4d1f258
3
+ folderAsset: yes
4
+ DefaultImporter:
5
+ externalObjects: {}
6
+ userData:
7
+ assetBundleName:
8
+ assetBundleVariant:
@@ -0,0 +1,128 @@
1
+ fileFormatVersion: 2
2
+ guid: caf855ae07df04c859a1c5c64ea0802d
3
+ TextureImporter:
4
+ internalIDToNameTable: []
5
+ externalObjects: {}
6
+ serializedVersion: 11
7
+ mipmaps:
8
+ mipMapMode: 0
9
+ enableMipMap: 0
10
+ sRGBTexture: 1
11
+ linearTexture: 0
12
+ fadeOut: 0
13
+ borderMipMap: 0
14
+ mipMapsPreserveCoverage: 0
15
+ alphaTestReferenceValue: 0.5
16
+ mipMapFadeDistanceStart: 1
17
+ mipMapFadeDistanceEnd: 3
18
+ bumpmap:
19
+ convertToNormalMap: 0
20
+ externalNormalMap: 0
21
+ heightScale: 0.25
22
+ normalMapFilter: 0
23
+ isReadable: 0
24
+ streamingMipmaps: 0
25
+ streamingMipmapsPriority: 0
26
+ grayScaleToAlpha: 0
27
+ generateCubemap: 6
28
+ cubemapConvolution: 0
29
+ seamlessCubemap: 0
30
+ textureFormat: 1
31
+ maxTextureSize: 2048
32
+ textureSettings:
33
+ serializedVersion: 2
34
+ filterMode: 1
35
+ aniso: 1
36
+ mipBias: 0
37
+ wrapU: 1
38
+ wrapV: 1
39
+ wrapW: 1
40
+ nPOTScale: 0
41
+ lightmap: 0
42
+ compressionQuality: 50
43
+ spriteMode: 1
44
+ spriteExtrude: 1
45
+ spriteMeshType: 1
46
+ alignment: 0
47
+ spritePivot: {x: 0.5, y: 0.5}
48
+ spritePixelsToUnits: 100
49
+ spriteBorder: {x: 0, y: 0, z: 0, w: 0}
50
+ spriteGenerateFallbackPhysicsShape: 1
51
+ alphaUsage: 1
52
+ alphaIsTransparency: 1
53
+ spriteTessellationDetail: -1
54
+ textureType: 8
55
+ textureShape: 1
56
+ singleChannelComponent: 0
57
+ maxTextureSizeSet: 0
58
+ compressionQualitySet: 0
59
+ textureFormatSet: 0
60
+ applyGammaDecoding: 0
61
+ platformSettings:
62
+ - serializedVersion: 3
63
+ buildTarget: DefaultTexturePlatform
64
+ maxTextureSize: 2048
65
+ resizeAlgorithm: 0
66
+ textureFormat: -1
67
+ textureCompression: 1
68
+ compressionQuality: 50
69
+ crunchedCompression: 0
70
+ allowsAlphaSplitting: 0
71
+ overridden: 0
72
+ androidETC2FallbackOverride: 0
73
+ forceMaximumCompressionQuality_BC6H_BC7: 0
74
+ - serializedVersion: 3
75
+ buildTarget: Standalone
76
+ maxTextureSize: 2048
77
+ resizeAlgorithm: 0
78
+ textureFormat: -1
79
+ textureCompression: 1
80
+ compressionQuality: 50
81
+ crunchedCompression: 0
82
+ allowsAlphaSplitting: 0
83
+ overridden: 0
84
+ androidETC2FallbackOverride: 0
85
+ forceMaximumCompressionQuality_BC6H_BC7: 0
86
+ - serializedVersion: 3
87
+ buildTarget: iPhone
88
+ maxTextureSize: 2048
89
+ resizeAlgorithm: 0
90
+ textureFormat: -1
91
+ textureCompression: 1
92
+ compressionQuality: 50
93
+ crunchedCompression: 0
94
+ allowsAlphaSplitting: 0
95
+ overridden: 0
96
+ androidETC2FallbackOverride: 0
97
+ forceMaximumCompressionQuality_BC6H_BC7: 0
98
+ - serializedVersion: 3
99
+ buildTarget: Android
100
+ maxTextureSize: 2048
101
+ resizeAlgorithm: 0
102
+ textureFormat: -1
103
+ textureCompression: 1
104
+ compressionQuality: 50
105
+ crunchedCompression: 0
106
+ allowsAlphaSplitting: 0
107
+ overridden: 0
108
+ androidETC2FallbackOverride: 0
109
+ forceMaximumCompressionQuality_BC6H_BC7: 0
110
+ spriteSheet:
111
+ serializedVersion: 2
112
+ sprites: []
113
+ outline: []
114
+ physicsShape: []
115
+ bones: []
116
+ spriteID: 5e97eb03825dee720800000000000000
117
+ internalID: 0
118
+ vertices: []
119
+ indices:
120
+ edges: []
121
+ weights: []
122
+ secondaryTextures: []
123
+ spritePackingTag:
124
+ pSDRemoveMatte: 0
125
+ pSDShowRemoveMatteOption: 0
126
+ userData:
127
+ assetBundleName:
128
+ assetBundleVariant:
@@ -0,0 +1,8 @@
1
+ fileFormatVersion: 2
2
+ guid: 6003e1f9e395e4d4eac9caab4a2574a3
3
+ folderAsset: yes
4
+ DefaultImporter:
5
+ externalObjects: {}
6
+ userData:
7
+ assetBundleName:
8
+ assetBundleVariant:
@@ -0,0 +1,8 @@
1
+ fileFormatVersion: 2
2
+ guid: ea0030b0bf2fb40f2900ce45ef0377c6
3
+ folderAsset: yes
4
+ DefaultImporter:
5
+ externalObjects: {}
6
+ userData:
7
+ assetBundleName:
8
+ assetBundleVariant:
@@ -0,0 +1,107 @@
1
+ using System;
2
+ using System.Collections.Generic;
3
+ using Newtonsoft.Json;
4
+
5
+ namespace TapSDK.Core.Standalone.Internal.Openlog
6
+ {
7
+ internal class TapCoreTracker
8
+ {
9
+
10
+ private const string ACTION_INIT = "init";
11
+ private const string ACTION_START = "start";
12
+ private const string ACTION_SUCCESS = "success";
13
+ private const string ACTION_FAIL = "fail";
14
+ private const string ACTION_CANCEL = "cancel";
15
+
16
+ internal static string SUCCESS_TYPE_RESTART = "restart";
17
+ internal static string SUCCESS_TYPE_INIT = "init";
18
+
19
+ internal static string METHOD_LAUNCHER = "isLaunchedFromTapTapPC";
20
+
21
+ private static TapCoreTracker instance;
22
+
23
+ private TapOpenlogStandalone openlog;
24
+
25
+ private TapCoreTracker()
26
+ {
27
+ openlog = new TapOpenlogStandalone("TapSDKCore", TapTapSDK.Version);
28
+ }
29
+
30
+ public static TapCoreTracker Instance
31
+ {
32
+ get
33
+ {
34
+ if (instance == null)
35
+ {
36
+ instance = new TapCoreTracker();
37
+ }
38
+ return instance;
39
+ }
40
+ }
41
+
42
+ internal void TrackInit()
43
+ {
44
+ ReportLog(ACTION_INIT);
45
+ }
46
+
47
+ internal void TrackStart(string funcNace, string seesionId)
48
+ {
49
+ Dictionary<string, string> parameters = new Dictionary<string, string>
50
+ {
51
+ { "func_name", funcNace },
52
+ { "session_id", seesionId },
53
+ };
54
+ ReportLog(ACTION_START, new Dictionary<string, string>()
55
+ {
56
+ { "args", JsonConvert.SerializeObject(parameters) }
57
+ });
58
+ }
59
+
60
+ internal void TrackSuccess(string funcNace, string seesionId, string successType)
61
+ {
62
+ Dictionary<string, string> parameters = new Dictionary<string, string>
63
+ {
64
+ { "func_name", funcNace },
65
+ { "session_id", seesionId },
66
+ { "launch_success_type", successType }
67
+ };
68
+ ReportLog(ACTION_SUCCESS, new Dictionary<string, string>()
69
+ {
70
+ { "args", JsonConvert.SerializeObject(parameters) }
71
+ });
72
+ }
73
+
74
+ internal void TrackCancel(string funcNace, string seesionId)
75
+ {
76
+ Dictionary<string, string> parameters = new Dictionary<string, string>
77
+ {
78
+ { "func_name", funcNace },
79
+ { "session_id", seesionId },
80
+ };
81
+ ReportLog(ACTION_CANCEL, new Dictionary<string, string>()
82
+ {
83
+ { "args", JsonConvert.SerializeObject(parameters) }
84
+ });
85
+ }
86
+
87
+ internal void TrackFailure(string funcNace, string seesionId, int errorCode = -1, string errorMessage = null)
88
+ {
89
+ Dictionary<string, string> parameters = new Dictionary<string, string>
90
+ {
91
+ { "func_name", funcNace },
92
+ { "session_id", seesionId },
93
+ { "error_code", errorCode.ToString() },
94
+ { "error_msg", errorMessage }
95
+ };
96
+ ReportLog(ACTION_FAIL, new Dictionary<string, string>()
97
+ {
98
+ { "args", JsonConvert.SerializeObject(parameters) }
99
+ });
100
+ }
101
+
102
+ private void ReportLog(string action, Dictionary<string, string> parameters = null)
103
+ {
104
+ openlog.LogBusiness(action, parameters);
105
+ }
106
+ }
107
+ }
@@ -0,0 +1,11 @@
1
+ fileFormatVersion: 2
2
+ guid: 105a74e032b41b84a841ec52a2cdbb87
3
+ MonoImporter:
4
+ externalObjects: {}
5
+ serializedVersion: 2
6
+ defaultReferences: []
7
+ executionOrder: 0
8
+ icon: {instanceID: 0}
9
+ userData:
10
+ assetBundleName:
11
+ assetBundleVariant:
@@ -0,0 +1,219 @@
1
+ using System;
2
+ using System.Collections.Generic;
3
+ using System.IO;
4
+ using System.Threading.Tasks;
5
+ using UnityEngine;
6
+ using System.Runtime.InteropServices;
7
+ using System.Text;
8
+
9
+
10
+
11
+ namespace TapSDK.Core.Standalone.Internal
12
+ {
13
+
14
+ internal enum TapSDKInitResult
15
+ {
16
+ // 初始化成功
17
+ kTapSDKInitResult_OK = 0,
18
+ // 其他错误
19
+ kTapSDKInitResult_FailedGeneric = 1,
20
+ // 未找到 TapTap,用户可能未安装,请引导用户下载安装 TapTap
21
+ kTapSDKInitResult_NoPlatform = 2,
22
+ // 已安装 TapTap,游戏未通过 TapTap 启动
23
+ kTapSDKInitResult_NotLaunchedByPlatform = 3,
24
+ };
25
+
26
+ internal enum TapCallbackID
27
+ {
28
+ kTapCallbackIDUnknown = 0,
29
+
30
+ // [1, 2000), reserved for TapTap platform events
31
+ kTapCallbackIDSystemStateChanged = 1,
32
+
33
+ // [2001, 4000), reserved for TapTap user events
34
+ kTapCallbackIDAuthorizeFinished = 2001,
35
+ };
36
+
37
+ // 系统事件类型
38
+ internal enum SystemState
39
+ {
40
+ kSystemState_Unknown = 0, // 未知
41
+ kSystemState_PlatformExit = 1, // 平台退出
42
+ };
43
+
44
+ // 是否触发授权的返回结果
45
+ internal enum AuthorizeResult
46
+ {
47
+ kAuthorizeResult_UNKNOWN = 0, // 未知
48
+ kAuthorizeResult_OK = 1, // 成功触发授权
49
+ kAuthorizeResult_FAILED = 2, // 授权失败
50
+ };
51
+
52
+ // 完成授权后的返回结果
53
+ internal enum Result
54
+ {
55
+ kResult_OK = 0,
56
+ kResult_Failed = 1,
57
+ kResult_Canceled = 2,
58
+ };
59
+
60
+
61
+ public class TapClientBridge
62
+ {
63
+
64
+ #if UNITY_STANDALONE_WIN
65
+ public const string DLL_NAME = "taptap_api";
66
+ #endif
67
+
68
+ #if UNITY_STANDALONE_WIN
69
+ [global::System.Runtime.InteropServices.DllImport(TapClientBridge.DLL_NAME, CharSet =CharSet.Ansi, CallingConvention = CallingConvention.Cdecl)]
70
+ internal static extern bool TapSDK_RestartAppIfNecessary([MarshalAs( UnmanagedType.LPStr )]string clientId);
71
+
72
+ [global::System.Runtime.InteropServices.DllImport(TapClientBridge.DLL_NAME, CharSet =CharSet.Ansi, CallingConvention = CallingConvention.Cdecl)]
73
+ internal static extern int TapSDK_Init(StringBuilder errMsg, [MarshalAs( UnmanagedType.LPStr )]string pubKey);
74
+
75
+ [global::System.Runtime.InteropServices.DllImport(TapClientBridge.DLL_NAME, CharSet =CharSet.Ansi, CallingConvention = CallingConvention.Cdecl)]
76
+ internal static extern void TapSDK_Shutdown();
77
+
78
+ // 定义与 C 兼容的委托
79
+ [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
80
+ internal delegate void CallbackDelegate(int id, IntPtr userData);
81
+
82
+ // 系统状态返回结果结构体
83
+ [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi)]
84
+ internal struct SystemStateResponse
85
+ {
86
+ public SystemState state; // 枚举直接映射
87
+ }
88
+
89
+ [global::System.Runtime.InteropServices.DllImport(TapClientBridge.DLL_NAME, CharSet =CharSet.Ansi, CallingConvention = CallingConvention.Cdecl)]
90
+ internal static extern void TapSDK_RegisterCallback(int callbackId, IntPtr callback);
91
+
92
+ [global::System.Runtime.InteropServices.DllImport(TapClientBridge.DLL_NAME, CharSet =CharSet.Ansi, CallingConvention = CallingConvention.Cdecl)]
93
+ internal static extern void TapSDK_RunCallbacks();
94
+
95
+ [global::System.Runtime.InteropServices.DllImport(TapClientBridge.DLL_NAME, CharSet =CharSet.Ansi, CallingConvention = CallingConvention.Cdecl)]
96
+ internal static extern void TapSDK_UnregisterCallback(int callbackId, IntPtr callback);
97
+
98
+
99
+ // 登录相关接口
100
+
101
+ // 授权返回结果结构体
102
+ [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi)]
103
+ public struct AuthorizeFinishedResponse
104
+ {
105
+ public int is_cancel ; // 是否取消
106
+
107
+ [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 1024)]
108
+ public string callback_uri; // 256 字节的 C 端字符串
109
+
110
+ }
111
+
112
+ [global::System.Runtime.InteropServices.DllImport(TapClientBridge.DLL_NAME, CharSet =CharSet.Ansi, CallingConvention = CallingConvention.Cdecl)]
113
+ internal static extern bool TapUser_GetOpenID(StringBuilder openId);
114
+
115
+ [global::System.Runtime.InteropServices.DllImport(TapClientBridge.DLL_NAME, CharSet =CharSet.Ansi, CallingConvention = CallingConvention.Cdecl)]
116
+ internal static extern bool TapSDK_GetClientID(StringBuilder clientId);
117
+
118
+
119
+ [global::System.Runtime.InteropServices.DllImport(TapClientBridge.DLL_NAME, CharSet =CharSet.Ansi, CallingConvention = CallingConvention.Cdecl)]
120
+ internal static extern int TapUser_AsyncAuthorize([MarshalAs( UnmanagedType.LPStr )] string scopeStrings, [MarshalAs( UnmanagedType.LPStr )] string responseType,
121
+ [MarshalAs( UnmanagedType.LPStr )] string redirectUri, [MarshalAs( UnmanagedType.LPStr )] string codeChallenge, [MarshalAs( UnmanagedType.LPStr )] string state,
122
+ [MarshalAs( UnmanagedType.LPStr )] string codeChallengeMethod, [MarshalAs( UnmanagedType.LPStr )] string versonCode, [MarshalAs( UnmanagedType.LPStr )] string sdkUa, [MarshalAs( UnmanagedType.LPStr )] string info);
123
+
124
+
125
+ // 初始化检查
126
+ internal static TapSDKInitResult CheckInitState(out string errMessage, string key)
127
+ {
128
+ StringBuilder errMsgBuffer = new StringBuilder(1024); // 分配 1024 字节缓冲区
129
+ int result = TapSDK_Init(errMsgBuffer, key);
130
+ errMessage = errMsgBuffer.ToString();
131
+ TapLogger.Debug("CheckInitState result = " + result);
132
+ return (TapSDKInitResult)result;
133
+ }
134
+
135
+ // 预防 GC 回收的静态变量
136
+ private static CallbackDelegate _callbackInstance ;
137
+
138
+ private static CallbackDelegate _userCallbackInstance ;
139
+
140
+ // 提供 C# 端的注册方法
141
+ /* 授权 callback 实现示例:
142
+ void MyCallback(TapCallbackID id, IntPtr userData){
143
+ AuthorizeFinishedResponse response = Marshal.PtrToStructure<AuthorizeFinishedResponse>(userData);
144
+ }
145
+ 系统状态 callback 实现示例:
146
+ void SystemStateCallback(TapCallbackID id, IntPtr state){
147
+ SystemStateResponse response = Marshal.PtrToStructure<SystemStateResponse>(userData);
148
+ }
149
+ */
150
+ internal static void RegisterCallback(int callbackId, CallbackDelegate callback)
151
+ {
152
+
153
+ TapLogger.Debug("start set delegate");
154
+ IntPtr funcPtr = Marshal.GetFunctionPointerForDelegate(callback);
155
+ if (callbackId == (int)TapCallbackID.kTapCallbackIDSystemStateChanged){
156
+ if(_callbackInstance!= null){
157
+ UnRegisterCallback(_callbackInstance, false);
158
+ }
159
+ _callbackInstance = callback; // 防止被 GC 回收
160
+ }else {
161
+ if(_userCallbackInstance!= null){
162
+ UnRegisterCallback(_userCallbackInstance, true);
163
+ }
164
+ _userCallbackInstance = callback;
165
+ }
166
+ TapLogger.Debug("start set delegate ptr " + funcPtr);
167
+ TapSDK_RegisterCallback(callbackId, funcPtr);
168
+ TapLogger.Debug("start set delegate ptr finish");
169
+ }
170
+
171
+ // 移除回调
172
+ internal static void UnRegisterCallback(CallbackDelegate callback, bool isUser)
173
+ {
174
+
175
+ IntPtr funcPtr = Marshal.GetFunctionPointerForDelegate(callback);
176
+ if (isUser){
177
+ _userCallbackInstance = null;
178
+ }else {
179
+ _callbackInstance = null;
180
+ }
181
+ TapLogger.Debug("start remove delegate ptr " + funcPtr);
182
+ TapSDK_UnregisterCallback(isUser? (int)TapCallbackID.kTapCallbackIDAuthorizeFinished :(int)TapCallbackID.kTapCallbackIDSystemStateChanged,funcPtr);
183
+ }
184
+
185
+ internal static AuthorizeResult LoginWithScopes(string[] scopeStrings, string responseType, string redirectUri,
186
+ string codeChallenge, string state, string codeChallengeMethod, string versonCode, string sdkUa, string info) {
187
+ try
188
+ {
189
+ TapLogger.Debug("login start ==== "+ string.Join(",", scopeStrings));
190
+ int result = TapUser_AsyncAuthorize(string.Join(",", scopeStrings), responseType, redirectUri,
191
+ codeChallenge, state, codeChallengeMethod, versonCode, sdkUa, info);
192
+ TapLogger.Debug("login end === " + result);
193
+ return (AuthorizeResult)result;
194
+ }catch(Exception ex){
195
+ TapLogger.Debug("login crash = " + ex.StackTrace);
196
+ return AuthorizeResult.kAuthorizeResult_UNKNOWN;
197
+ }
198
+ }
199
+
200
+ internal static bool GetTapUserOpenId(out string openId){
201
+ StringBuilder openIdBuffer = new StringBuilder(256); // 分配一个足够大的缓冲区
202
+ bool success = TapUser_GetOpenID(openIdBuffer); // 调用 C 函数
203
+ openId = openIdBuffer.ToString();
204
+ return success;
205
+ }
206
+
207
+ internal static bool GetClientId(out string clientId){
208
+ StringBuilder clientIDBuffer = new StringBuilder(256); // 分配一个足够大的缓冲区
209
+ bool success = TapSDK_GetClientID(clientIDBuffer); // 调用 C 函数
210
+ clientId = clientIDBuffer.ToString();
211
+ return success;
212
+ }
213
+
214
+ #endif
215
+ }
216
+
217
+
218
+
219
+ }
@@ -0,0 +1,11 @@
1
+ fileFormatVersion: 2
2
+ guid: 350ab3505547544ccb1c7b08617026e5
3
+ MonoImporter:
4
+ externalObjects: {}
5
+ serializedVersion: 2
6
+ defaultReferences: []
7
+ executionOrder: 0
8
+ icon: {instanceID: 0}
9
+ userData:
10
+ assetBundleName:
11
+ assetBundleVariant:
@@ -0,0 +1,36 @@
1
+
2
+ using UnityEngine;
3
+
4
+ namespace TapSDK.Core.Standalone.Internal
5
+ {
6
+ /// <summary>
7
+ /// 防沉迷轮询器
8
+ /// </summary>
9
+ internal class TapClientBridgePoll : MonoBehaviour
10
+ {
11
+ static readonly string TAP_CLIENT_POLL_NAME = "TapClientBridgePoll";
12
+
13
+ static TapClientBridgePoll current;
14
+
15
+
16
+ internal static void StartUp()
17
+ {
18
+ TapLogger.Debug("TapClientBridgePoll StartUp " );
19
+ if (current == null)
20
+ {
21
+ GameObject pollGo = new GameObject(TAP_CLIENT_POLL_NAME);
22
+ DontDestroyOnLoad(pollGo);
23
+ current = pollGo.AddComponent<TapClientBridgePoll>();
24
+ }
25
+ }
26
+
27
+
28
+ private void Update()
29
+ {
30
+ #if UNITY_STANDALONE_WIN
31
+ TapClientBridge.TapSDK_RunCallbacks();
32
+ #endif
33
+ }
34
+ }
35
+
36
+ }
@@ -0,0 +1,11 @@
1
+ fileFormatVersion: 2
2
+ guid: c81a3a82ec1f94dd39440d2a1421e4d9
3
+ MonoImporter:
4
+ externalObjects: {}
5
+ serializedVersion: 2
6
+ defaultReferences: []
7
+ executionOrder: 0
8
+ icon: {instanceID: 0}
9
+ userData:
10
+ assetBundleName:
11
+ assetBundleVariant:
@@ -0,0 +1,55 @@
1
+ using System;
2
+ using UnityEngine.UI;
3
+ using UnityEngine;
4
+ using TapSDK.UI;
5
+
6
+ namespace TapSDK.Core.Standalone.Internal {
7
+ public class TapClientConnectTipController : BasePanelController
8
+ {
9
+ public Button installTipButton;
10
+ public Button okButton;
11
+
12
+ public Text tipText;
13
+
14
+
15
+ /// <summary>
16
+ /// bind ugui components for every panel
17
+ /// </summary>
18
+ protected override void BindComponents()
19
+ {
20
+ okButton = transform.Find("Root/OKButton").GetComponent<Button>();
21
+ installTipButton = transform.Find("Root/InstallTipBtn").GetComponent<Button>();
22
+ }
23
+
24
+ protected override void OnLoadSuccess()
25
+ {
26
+ base.OnLoadSuccess();
27
+
28
+ installTipButton.onClick.AddListener(OnInstallButtonClicked);
29
+ okButton.onClick.AddListener(OnOKButtonClicked);
30
+ }
31
+
32
+ internal void Show(TapSDKInitResult errorType)
33
+ {
34
+ if (errorType == TapSDKInitResult.kTapSDKInitResult_NoPlatform){
35
+ tipText.text = "获取游戏信息失败,请下载 TapTap 客户端后重新启动游戏";
36
+ }else if (errorType == TapSDKInitResult.kTapSDKInitResult_NotLaunchedByPlatform){
37
+ tipText.text = "获取游戏信息失败,请从 TapTap 客户端重新启动游戏";
38
+ }else {
39
+ tipText.text = "发生未知错误,请从 TapTap 客户端重新启动游戏";
40
+ }
41
+ }
42
+
43
+ private void OnOKButtonClicked()
44
+ {
45
+ Close();
46
+ Application.Quit();
47
+ }
48
+
49
+ private void OnInstallButtonClicked()
50
+ {
51
+ Application.OpenURL("https://www.taptap.cn/mobile?utm_medium=coop&utm_source=pc_toStart");
52
+ }
53
+
54
+ }
55
+ }
@@ -0,0 +1,11 @@
1
+ fileFormatVersion: 2
2
+ guid: 88db6c5941bac46ba91fe65775ad712f
3
+ MonoImporter:
4
+ externalObjects: {}
5
+ serializedVersion: 2
6
+ defaultReferences: []
7
+ executionOrder: 0
8
+ icon: {instanceID: 0}
9
+ userData:
10
+ assetBundleName:
11
+ assetBundleVariant: