com.beanbag.tiktokminigames 1.0.0
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/DefaultTemplate/backgroundlandscape.png +0 -0
- package/DefaultTemplate/backgroundlandscape.png.meta +159 -0
- package/DefaultTemplate/backgroundportrait.png +0 -0
- package/DefaultTemplate/backgroundportrait.png.meta +159 -0
- package/DefaultTemplate/game.js +151 -0
- package/DefaultTemplate/game.js.meta +7 -0
- package/DefaultTemplate/images/unity_logo.png +0 -0
- package/DefaultTemplate/images/unity_logo.png.meta +159 -0
- package/DefaultTemplate/images.meta +8 -0
- package/DefaultTemplate/plugin-config.js +23 -0
- package/DefaultTemplate/plugin-config.js.meta +7 -0
- package/DefaultTemplate/plugin.js +1 -0
- package/DefaultTemplate/plugin.js.meta +7 -0
- package/DefaultTemplate/unity-namespace.js +11 -0
- package/DefaultTemplate/unity-namespace.js.meta +7 -0
- package/DefaultTemplate/webgl-wasm-split.js +17 -0
- package/DefaultTemplate/webgl-wasm-split.js.meta +7 -0
- package/DefaultTemplate.meta +8 -0
- package/Editor/Extras/Integration/DouYinMiniGameSettings.cs +30 -0
- package/Editor/Extras/Integration/DouYinMiniGameSettings.cs.meta +11 -0
- package/Editor/Extras/Integration/DouYinMiniGameSettingsEditor.cs +354 -0
- package/Editor/Extras/Integration/DouYinMiniGameSettingsEditor.cs.meta +3 -0
- package/Editor/Extras/Integration/DouYinSubplatformInterface.cs +153 -0
- package/Editor/Extras/Integration/DouYinSubplatformInterface.cs.meta +3 -0
- package/Editor/Extras/Integration.meta +8 -0
- package/Editor/Extras/Providers/TTMiniGameSupportProvider.cs +148 -0
- package/Editor/Extras/Providers/TTMiniGameSupportProvider.cs.meta +3 -0
- package/Editor/Extras/Providers.meta +3 -0
- package/Editor/Extras/TTEditorSupportProviderRegister.cs +15 -0
- package/Editor/Extras/TTEditorSupportProviderRegister.cs.meta +3 -0
- package/Editor/Extras.meta +3 -0
- package/Editor/ttsdk_tools.dll +0 -0
- package/Editor/ttsdk_tools.dll.meta +33 -0
- package/Editor/ttsdk_tools.pdb +0 -0
- package/Editor/ttsdk_tools.pdb.meta +7 -0
- package/Editor.meta +8 -0
- package/LitJson/TTLitJson.dll +0 -0
- package/LitJson/TTLitJson.dll.meta +33 -0
- package/LitJson/TTLitJson.pdb +0 -0
- package/LitJson/TTLitJson.pdb.meta +7 -0
- package/LitJson.meta +8 -0
- package/TTSDK/ttsdk.dll +0 -0
- package/TTSDK/ttsdk.dll.meta +33 -0
- package/TTSDK/ttsdk.pdb +0 -0
- package/TTSDK/ttsdk.pdb.meta +7 -0
- package/TTSDK.meta +8 -0
- package/WebGL/AssetBundle/DownloadHandlerTTAssetBundle.cs +85 -0
- package/WebGL/AssetBundle/DownloadHandlerTTAssetBundle.cs.meta +3 -0
- package/WebGL/AssetBundle/TTAssetBundle.cs +72 -0
- package/WebGL/AssetBundle/TTAssetBundle.cs.meta +3 -0
- package/WebGL/AssetBundle/TTAssetBundleExtensions.cs +25 -0
- package/WebGL/AssetBundle/TTAssetBundleExtensions.cs.meta +3 -0
- package/WebGL/AssetBundle/TTAssetBundleProviders.cs.txt +1301 -0
- package/WebGL/AssetBundle/TTAssetBundleProviders.cs.txt.meta +3 -0
- package/WebGL/AssetBundle/TTAssetBundleRequest.cs +96 -0
- package/WebGL/AssetBundle/TTAssetBundleRequest.cs.meta +3 -0
- package/WebGL/AssetBundle.meta +8 -0
- package/WebGL/Compatibility/UnityCacheCompatibility.cs +49 -0
- package/WebGL/Compatibility/UnityCacheCompatibility.cs.meta +3 -0
- package/WebGL/Compatibility/UnityWebRequestCompatibility.cs +18 -0
- package/WebGL/Compatibility/UnityWebRequestCompatibility.cs.meta +3 -0
- package/WebGL/Compatibility.meta +3 -0
- package/WebGL/FileSystem/TTFileSystemManager.cs +460 -0
- package/WebGL/FileSystem/TTFileSystemManager.cs.meta +11 -0
- package/WebGL/FileSystem/TTFileSystemManagerDefault.cs +1039 -0
- package/WebGL/FileSystem/TTFileSystemManagerDefault.cs.meta +11 -0
- package/WebGL/FileSystem/TTFileSystemManagerWebGL.cs +1278 -0
- package/WebGL/FileSystem/TTFileSystemManagerWebGL.cs.meta +11 -0
- package/WebGL/FileSystem.meta +3 -0
- package/WebGL/Input/Input.cs +230 -0
- package/WebGL/Input/Input.cs.meta +3 -0
- package/WebGL/Input/TTPCInputHandler.cs +199 -0
- package/WebGL/Input/TTPCInputHandler.cs.meta +3 -0
- package/WebGL/Input.meta +3 -0
- package/WebGL/Network/TTUDPSocketHandler.cs +130 -0
- package/WebGL/Network/TTUDPSocketHandler.cs.meta +11 -0
- package/WebGL/Network.meta +3 -0
- package/WebGL/TTAssetBundle.jslib +33 -0
- package/WebGL/TTAssetBundle.jslib.meta +32 -0
- package/WebGL/TTCallbackHandler.cs +139 -0
- package/WebGL/TTCallbackHandler.cs.meta +3 -0
- package/WebGL/TTModel.cs +582 -0
- package/WebGL/TTModel.cs.meta +11 -0
- package/WebGL/TTSDK.jslib +592 -0
- package/WebGL/TTSDK.jslib.meta +32 -0
- package/WebGL/TTSDKType.cs +10 -0
- package/WebGL/TTSDKType.cs.meta +3 -0
- package/WebGL/TTStorageManager.cs +155 -0
- package/WebGL/TTStorageManager.cs.meta +11 -0
- package/WebGL/TTUNBridge.jslib +117 -0
- package/WebGL/TTUNBridge.jslib.meta +32 -0
- package/WebGL/TTVersionAttribute.cs +21 -0
- package/WebGL/TTVersionAttribute.cs.meta +11 -0
- package/WebGL/TTWebGL.asmdef +18 -0
- package/WebGL/TTWebGL.asmdef.meta +7 -0
- package/WebGL/TTWebGLInterface.cs +63 -0
- package/WebGL/TTWebGLInterface.cs.meta +11 -0
- package/WebGL.meta +8 -0
- package/package.json +13 -0
- package/package.json.meta +7 -0
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
using System.Runtime.InteropServices;
|
|
2
|
+
using UnityEngine.Scripting;
|
|
3
|
+
|
|
4
|
+
namespace TTSDK
|
|
5
|
+
{
|
|
6
|
+
public static class TTStorage
|
|
7
|
+
{
|
|
8
|
+
public static void SetIntSync(string key, int value)
|
|
9
|
+
{
|
|
10
|
+
StarkStorageSetIntSync(key, value);
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
public static int GetIntSync(string key, int defaultValue)
|
|
14
|
+
{
|
|
15
|
+
return StarkStorageGetIntSync(key, defaultValue);
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
public static void SetFloatSync(string key, float value)
|
|
19
|
+
{
|
|
20
|
+
StarkStorageSetFloatSync(key, value);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
public static float GetFloatSync(string key, float defaultValue)
|
|
24
|
+
{
|
|
25
|
+
return StarkStorageGetFloatSync(key, defaultValue);
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
public static void SetStringSync(string key, string value)
|
|
29
|
+
{
|
|
30
|
+
StarkStorageSetStringSync(key, value);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
public static string GetStringSync(string key, string defaultValue)
|
|
34
|
+
{
|
|
35
|
+
return StarkStorageGetStringSync(key, defaultValue);
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
public static bool HasKeySync(string key)
|
|
39
|
+
{
|
|
40
|
+
return StarkStorageHasKeySync(key);
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
public static void DeleteKeySync(string key)
|
|
44
|
+
{
|
|
45
|
+
StarkStorageDeleteKeySync(key);
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
public static void DeleteAllSync()
|
|
49
|
+
{
|
|
50
|
+
StarkStorageDeleteAllSync();
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
#if UNITY_WEBGL && !UNITY_EDITOR
|
|
54
|
+
[DllImport("__Internal")]
|
|
55
|
+
private static extern void StarkStorageSetIntSync(string key, int value);
|
|
56
|
+
#else
|
|
57
|
+
static void StarkStorageSetIntSync(string key, int value)
|
|
58
|
+
{
|
|
59
|
+
UnityEngine.PlayerPrefs.SetInt(key, value);
|
|
60
|
+
}
|
|
61
|
+
#endif
|
|
62
|
+
|
|
63
|
+
#if UNITY_WEBGL && !UNITY_EDITOR
|
|
64
|
+
[DllImport("__Internal")]
|
|
65
|
+
private static extern int StarkStorageGetIntSync(string key, int defaultValue);
|
|
66
|
+
#else
|
|
67
|
+
static int StarkStorageGetIntSync(string key, int defaultValue)
|
|
68
|
+
{
|
|
69
|
+
return UnityEngine.PlayerPrefs.GetInt(key, defaultValue);
|
|
70
|
+
}
|
|
71
|
+
#endif
|
|
72
|
+
|
|
73
|
+
#if UNITY_WEBGL && !UNITY_EDITOR
|
|
74
|
+
[DllImport("__Internal")]
|
|
75
|
+
private static extern void StarkStorageSetStringSync(string key, string value);
|
|
76
|
+
#else
|
|
77
|
+
static void StarkStorageSetStringSync(string key, string value)
|
|
78
|
+
{
|
|
79
|
+
UnityEngine.PlayerPrefs.SetString(key, value);
|
|
80
|
+
}
|
|
81
|
+
#endif
|
|
82
|
+
|
|
83
|
+
|
|
84
|
+
#if UNITY_WEBGL && !UNITY_EDITOR
|
|
85
|
+
[DllImport("__Internal")]
|
|
86
|
+
private static extern string StarkStorageGetStringSync(string key, string defaultValue);
|
|
87
|
+
#else
|
|
88
|
+
static string StarkStorageGetStringSync(string key, string defaultValue)
|
|
89
|
+
{
|
|
90
|
+
return UnityEngine.PlayerPrefs.GetString(key, defaultValue);
|
|
91
|
+
}
|
|
92
|
+
#endif
|
|
93
|
+
|
|
94
|
+
|
|
95
|
+
#if UNITY_WEBGL && !UNITY_EDITOR
|
|
96
|
+
[DllImport("__Internal")]
|
|
97
|
+
private static extern void StarkStorageSetFloatSync(string key, float value);
|
|
98
|
+
#else
|
|
99
|
+
static void StarkStorageSetFloatSync(string key, float value)
|
|
100
|
+
{
|
|
101
|
+
UnityEngine.PlayerPrefs.SetFloat(key, value);
|
|
102
|
+
}
|
|
103
|
+
#endif
|
|
104
|
+
|
|
105
|
+
|
|
106
|
+
#if UNITY_WEBGL && !UNITY_EDITOR
|
|
107
|
+
[DllImport("__Internal")]
|
|
108
|
+
private static extern float StarkStorageGetFloatSync(string key, float defaultValue);
|
|
109
|
+
#else
|
|
110
|
+
static float StarkStorageGetFloatSync(string key, float defaultValue)
|
|
111
|
+
{
|
|
112
|
+
return UnityEngine.PlayerPrefs.GetFloat(key, defaultValue);
|
|
113
|
+
}
|
|
114
|
+
#endif
|
|
115
|
+
|
|
116
|
+
|
|
117
|
+
#if UNITY_WEBGL && !UNITY_EDITOR
|
|
118
|
+
[DllImport("__Internal")]
|
|
119
|
+
private static extern void StarkStorageDeleteAllSync();
|
|
120
|
+
#else
|
|
121
|
+
static void StarkStorageDeleteAllSync()
|
|
122
|
+
{
|
|
123
|
+
UnityEngine.PlayerPrefs.DeleteAll();
|
|
124
|
+
}
|
|
125
|
+
#endif
|
|
126
|
+
|
|
127
|
+
|
|
128
|
+
#if UNITY_WEBGL && !UNITY_EDITOR
|
|
129
|
+
[DllImport("__Internal")]
|
|
130
|
+
private static extern void StarkStorageDeleteKeySync(string key);
|
|
131
|
+
#else
|
|
132
|
+
static void StarkStorageDeleteKeySync(string key)
|
|
133
|
+
{
|
|
134
|
+
UnityEngine.PlayerPrefs.DeleteKey(key);
|
|
135
|
+
}
|
|
136
|
+
#endif
|
|
137
|
+
|
|
138
|
+
|
|
139
|
+
#if UNITY_WEBGL && !UNITY_EDITOR
|
|
140
|
+
[DllImport("__Internal")]
|
|
141
|
+
private static extern bool StarkStorageHasKeySync(string key);
|
|
142
|
+
#else
|
|
143
|
+
static bool StarkStorageHasKeySync(string key)
|
|
144
|
+
{
|
|
145
|
+
return UnityEngine.PlayerPrefs.HasKey(key);
|
|
146
|
+
}
|
|
147
|
+
#endif
|
|
148
|
+
|
|
149
|
+
#if UNITY_WEBGL && !UNITY_EDITOR
|
|
150
|
+
[Preserve]
|
|
151
|
+
[DllImport("__Internal")]
|
|
152
|
+
private static extern void StarkPointerStringify();
|
|
153
|
+
#endif
|
|
154
|
+
}
|
|
155
|
+
}
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
mergeInto(LibraryManager.library, {
|
|
2
|
+
// ============================================================
|
|
3
|
+
// StarkSafeProxy: Wraps window.StarkSDK in a recursive Proxy
|
|
4
|
+
// so ALL method calls are automatically error-safe.
|
|
5
|
+
// No per-function try-catch needed in any jslib file.
|
|
6
|
+
// ============================================================
|
|
7
|
+
$StarkSafeProxy__postset: "StarkSafeProxy();",
|
|
8
|
+
$StarkSafeProxy: function () {
|
|
9
|
+
if (typeof Proxy === "undefined") return;
|
|
10
|
+
|
|
11
|
+
function makeSafe(target, path) {
|
|
12
|
+
return new Proxy(target, {
|
|
13
|
+
get: function (t, prop) {
|
|
14
|
+
if (typeof prop === "symbol") return t[prop];
|
|
15
|
+
var val;
|
|
16
|
+
try {
|
|
17
|
+
val = t[prop];
|
|
18
|
+
} catch (e) {
|
|
19
|
+
return undefined;
|
|
20
|
+
}
|
|
21
|
+
if (typeof val === "function") {
|
|
22
|
+
return function () {
|
|
23
|
+
try {
|
|
24
|
+
return val.apply(t, arguments);
|
|
25
|
+
} catch (e) {
|
|
26
|
+
console.error(
|
|
27
|
+
"[" + path + "." + prop + "] error:",
|
|
28
|
+
e.message || e
|
|
29
|
+
);
|
|
30
|
+
}
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
if (val != null && typeof val === "object") {
|
|
34
|
+
return makeSafe(val, path + "." + prop);
|
|
35
|
+
}
|
|
36
|
+
return val;
|
|
37
|
+
},
|
|
38
|
+
set: function (t, prop, v) {
|
|
39
|
+
t[prop] = v;
|
|
40
|
+
return true;
|
|
41
|
+
},
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
var _raw = window.StarkSDK || null;
|
|
46
|
+
var _safe = _raw ? makeSafe(_raw, "StarkSDK") : null;
|
|
47
|
+
Object.defineProperty(window, "StarkSDK", {
|
|
48
|
+
get: function () {
|
|
49
|
+
return _safe;
|
|
50
|
+
},
|
|
51
|
+
set: function (v) {
|
|
52
|
+
_raw = v;
|
|
53
|
+
_safe = v ? makeSafe(v, "StarkSDK") : v;
|
|
54
|
+
},
|
|
55
|
+
configurable: true,
|
|
56
|
+
enumerable: true,
|
|
57
|
+
});
|
|
58
|
+
},
|
|
59
|
+
|
|
60
|
+
// ============================================================
|
|
61
|
+
// Bridge utilities & functions
|
|
62
|
+
// ============================================================
|
|
63
|
+
StarkPointerStringify__deps: ["$StarkSafeProxy"],
|
|
64
|
+
StarkPointerStringify: function (str) {
|
|
65
|
+
if (typeof UTF8ToString !== "undefined") {
|
|
66
|
+
return UTF8ToString(str);
|
|
67
|
+
}
|
|
68
|
+
return Pointer_stringify(str);
|
|
69
|
+
},
|
|
70
|
+
unityCallJs: function (msg) {
|
|
71
|
+
if (typeof UNBridgeCore === "undefined") return;
|
|
72
|
+
try {
|
|
73
|
+
UNBridgeCore.handleMsgFromUnity(_StarkPointerStringify(msg));
|
|
74
|
+
} catch (e) {
|
|
75
|
+
console.error("[TTUNBridge] unityCallJs error:", e.message || e);
|
|
76
|
+
}
|
|
77
|
+
},
|
|
78
|
+
unityCallJsSync: function (msg) {
|
|
79
|
+
if (typeof UNBridgeCore === "undefined") return 0;
|
|
80
|
+
try {
|
|
81
|
+
var result = UNBridgeCore.handleMsgFromUnitySync(
|
|
82
|
+
_StarkPointerStringify(msg)
|
|
83
|
+
);
|
|
84
|
+
if (!result) return 0;
|
|
85
|
+
var bufferSize = lengthBytesUTF8(result) + 1;
|
|
86
|
+
var buffer = _malloc(bufferSize);
|
|
87
|
+
stringToUTF8(result, buffer, bufferSize);
|
|
88
|
+
return buffer;
|
|
89
|
+
} catch (e) {
|
|
90
|
+
console.error("[TTUNBridge] unityCallJsSync error:", e.message || e);
|
|
91
|
+
return 0;
|
|
92
|
+
}
|
|
93
|
+
},
|
|
94
|
+
h5HasAPI: function (apiName) {
|
|
95
|
+
try {
|
|
96
|
+
if (typeof UNBridgeCore === "undefined") return false;
|
|
97
|
+
return UNBridge.h5HasAPI(_StarkPointerStringify(apiName));
|
|
98
|
+
} catch (e) {
|
|
99
|
+
console.error("[TTUNBridge] h5HasAPI error:", e.message || e);
|
|
100
|
+
return false;
|
|
101
|
+
}
|
|
102
|
+
},
|
|
103
|
+
unityMixCallJs: function (msg) {
|
|
104
|
+
if (typeof UNBridgeCore === "undefined") return 0;
|
|
105
|
+
try {
|
|
106
|
+
var result = UNBridgeCore.onUnityMixCall(_StarkPointerStringify(msg));
|
|
107
|
+
if (!result) return 0;
|
|
108
|
+
var bufferSize = lengthBytesUTF8(result) + 1;
|
|
109
|
+
var buffer = _malloc(bufferSize);
|
|
110
|
+
stringToUTF8(result, buffer, bufferSize);
|
|
111
|
+
return buffer;
|
|
112
|
+
} catch (e) {
|
|
113
|
+
console.error("[TTUNBridge] unityMixCallJs error:", e.message || e);
|
|
114
|
+
return 0;
|
|
115
|
+
}
|
|
116
|
+
},
|
|
117
|
+
});
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
fileFormatVersion: 2
|
|
2
|
+
guid: 5eb4a9465cc0f47118c08538402ee376
|
|
3
|
+
PluginImporter:
|
|
4
|
+
externalObjects: {}
|
|
5
|
+
serializedVersion: 2
|
|
6
|
+
iconMap: {}
|
|
7
|
+
executionOrder: {}
|
|
8
|
+
defineConstraints: []
|
|
9
|
+
isPreloaded: 0
|
|
10
|
+
isOverridable: 0
|
|
11
|
+
isExplicitlyReferenced: 0
|
|
12
|
+
validateReferences: 1
|
|
13
|
+
platformData:
|
|
14
|
+
- first:
|
|
15
|
+
Any:
|
|
16
|
+
second:
|
|
17
|
+
enabled: 0
|
|
18
|
+
settings: {}
|
|
19
|
+
- first:
|
|
20
|
+
Editor: Editor
|
|
21
|
+
second:
|
|
22
|
+
enabled: 0
|
|
23
|
+
settings:
|
|
24
|
+
DefaultValueInitialized: true
|
|
25
|
+
- first:
|
|
26
|
+
WebGL: WebGL
|
|
27
|
+
second:
|
|
28
|
+
enabled: 1
|
|
29
|
+
settings: {}
|
|
30
|
+
userData:
|
|
31
|
+
assetBundleName:
|
|
32
|
+
assetBundleVariant:
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
using System;
|
|
2
|
+
|
|
3
|
+
namespace TTSDK
|
|
4
|
+
{
|
|
5
|
+
[AttributeUsage(AttributeTargets.All, AllowMultiple = false, Inherited = true)]
|
|
6
|
+
public class TTVersionAttribute : Attribute
|
|
7
|
+
{
|
|
8
|
+
public string MinTTContainerAndroidVersion { get; set; }
|
|
9
|
+
|
|
10
|
+
public int MinAndroidOSVersion { get; set; }
|
|
11
|
+
|
|
12
|
+
public string WebGLMethod { get; set; }
|
|
13
|
+
|
|
14
|
+
public bool IsSupportWebGL { get; set; }
|
|
15
|
+
|
|
16
|
+
/// <summary>
|
|
17
|
+
/// 最低客户端版本(宿主版本),如 "43.8.0"
|
|
18
|
+
/// </summary>
|
|
19
|
+
public string MinClientVersion { get; set; }
|
|
20
|
+
}
|
|
21
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "TTWebGL",
|
|
3
|
+
"rootNamespace": "",
|
|
4
|
+
"references": [
|
|
5
|
+
"GUID:986ad24dedab349ad9a8cb6ed29f9532",
|
|
6
|
+
"GUID:343deaaf83e0cee4ca978e7df0b80d21",
|
|
7
|
+
"GUID:2bafac87e7f4b9b418d9448d219b01ab"
|
|
8
|
+
],
|
|
9
|
+
"includePlatforms": [],
|
|
10
|
+
"excludePlatforms": [],
|
|
11
|
+
"allowUnsafeCode": false,
|
|
12
|
+
"overrideReferences": false,
|
|
13
|
+
"precompiledReferences": [],
|
|
14
|
+
"autoReferenced": true,
|
|
15
|
+
"defineConstraints": [],
|
|
16
|
+
"versionDefines": [],
|
|
17
|
+
"noEngineReferences": false
|
|
18
|
+
}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
using System;
|
|
2
|
+
using System.Runtime.InteropServices;
|
|
3
|
+
using UnityEngine.Scripting;
|
|
4
|
+
|
|
5
|
+
[assembly: Preserve]
|
|
6
|
+
|
|
7
|
+
namespace TTSDK
|
|
8
|
+
{
|
|
9
|
+
public delegate void GetFontDataDelegate(IntPtr pBuffer, int length);
|
|
10
|
+
public class TTWebGLInterface
|
|
11
|
+
{
|
|
12
|
+
#if (UNITY_WEBPLAYER || UNITY_WEBGL)
|
|
13
|
+
//以下接口为Web使用,用于调用JS代码。
|
|
14
|
+
[method: Preserve]
|
|
15
|
+
[DllImport("__Internal")]
|
|
16
|
+
public static extern void unityCallJs(string msg);
|
|
17
|
+
|
|
18
|
+
[method: Preserve]
|
|
19
|
+
[DllImport("__Internal")]
|
|
20
|
+
public static extern string unityCallJsSync(string msg);
|
|
21
|
+
|
|
22
|
+
[method: Preserve]
|
|
23
|
+
[DllImport("__Internal")]
|
|
24
|
+
public static extern bool h5HasAPI(string apiName);
|
|
25
|
+
|
|
26
|
+
[method: Preserve]
|
|
27
|
+
[DllImport("__Internal")]
|
|
28
|
+
public static extern string unityMixCallJs(string msg);
|
|
29
|
+
|
|
30
|
+
[DllImport("__Internal")]
|
|
31
|
+
public static extern void StarkGetSystemFont(GetFontDataDelegate onFontData);
|
|
32
|
+
#else
|
|
33
|
+
public static void unityCallJs(string msg)
|
|
34
|
+
{
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
public static string unityCallJsSync(string msg)
|
|
38
|
+
{
|
|
39
|
+
return "";
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
public static bool h5HasAPI(string apiName)
|
|
43
|
+
{
|
|
44
|
+
return false;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
public static string unityMixCallJs(string msg)
|
|
48
|
+
{
|
|
49
|
+
return "";
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
public static void StarkGetSystemFont(GetFontDataDelegate onFontData)
|
|
53
|
+
{
|
|
54
|
+
onFontData?.Invoke(IntPtr.Zero, 0);
|
|
55
|
+
}
|
|
56
|
+
#endif
|
|
57
|
+
#if UNITY_WEBGL && !UNITY_EDITOR
|
|
58
|
+
[Preserve]
|
|
59
|
+
[DllImport("__Internal")]
|
|
60
|
+
private static extern void StarkPointerStringify();
|
|
61
|
+
#endif
|
|
62
|
+
}
|
|
63
|
+
}
|
package/WebGL.meta
ADDED
package/package.json
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "com.beanbag.tiktokminigames",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"displayName": "Tiktok Mini Games",
|
|
5
|
+
"description": "The helps to enable tiktok mini game ads, TTSDK Plugin Latest updates:[6.5.5]",
|
|
6
|
+
"unity": "2019.1",
|
|
7
|
+
"author": {
|
|
8
|
+
"name": "Bean Bag",
|
|
9
|
+
"author": "Usman Arshad"
|
|
10
|
+
},
|
|
11
|
+
"type": "tool",
|
|
12
|
+
"hideInEditor": true
|
|
13
|
+
}
|