Auto-publish release WXSDK.

This commit is contained in:
nebulaliu 2024-10-10 19:17:47 +08:00
parent d819a70c1b
commit a35ef24071
105 changed files with 224 additions and 147 deletions

View File

@ -6,8 +6,7 @@ Removed - 删除功能/接口
Fixed - 修复问题
Others - 其他
-->
## 2024-8-28 【预发布】
PackageManager(git URL): https://github.com/wechat-miniprogram/minigame-tuanjie-transform-sdk.git#pre-v0.1.19
## 2024-10-8 【重要更新】
### Feature
* 普通: UDPSocket.write适配
* 普通: 部分JS API接口更新
@ -15,6 +14,11 @@ PackageManager(git URL): https://github.com/wechat-miniprogram/minigame-tuanjie-
### Fixed
* 普通: 修复.net8 OnApplicationFocus/Pause适配
* 普通: 修复插件自动调节dpr后获取不到实际dpr
* 普通修复音频设置timeSamples不生效
* 重要: 修复iOS18微信系统字体丢失
* 重要修复10S17.5以上音频退后台无法恢复
* 重要修复音频PC端异常循环播
* 重要: 修复游戏圈文案默认显示'打开游戏圈'的问题
## 2024-8-13 【重要更新】
### Feature

View File

@ -1432,10 +1432,10 @@ namespace WeChatWASM
}
catch (Exception e)
{
Debug.LogWarning("[可选]生成Boot info 失败!错误:" + e.Message);
Debug.LogWarning("[可选]生成Boot info 失败!错误:" + e.Message);
}
return sb.ToString();
}

View File

@ -18,6 +18,8 @@ namespace WeChatWASM
public class WXSettingsHelper
{
public static string projectRootPath;
public WXSettingsHelper()
{
Type weixinMiniGamePackageHelpersType = Type.GetType("UnityEditor.WeixinPackageHelpers,UnityEditor");
@ -50,11 +52,17 @@ namespace WeChatWASM
//loadData();
foldInstantGame = WXConvertCore.IsInstantGameAutoStreaming();
projectRootPath = System.IO.Path.GetFullPath(Application.dataPath + "/../");
_dstCache = "";
}
//private static WXEditorScriptObject config = UnityUtil.GetEditorConf();
private static WXEditorScriptObject config;
private static bool m_EnablePerfTool = false;
private static string _dstCache;
public void OnFocus()
{
loadData();
@ -101,13 +109,13 @@ namespace WeChatWASM
formInputData[targetDst] = "";
}
EditorGUILayout.LabelField(string.Empty, GUILayout.Width(10));
GUILayout.Label("导出路径", GUILayout.Width(140));
GUILayout.Label(new GUIContent("导出路径(?)", "支持输入相对于项目根目录的相对路径wxbuild"), GUILayout.Width(140));
formInputData[targetDst] = GUILayout.TextField(formInputData[targetDst], GUILayout.MaxWidth(EditorGUIUtility.currentViewWidth - 270));
if (GUILayout.Button(new GUIContent("打开"), GUILayout.Width(40)))
{
if (!formInputData[targetDst].Trim().Equals(string.Empty))
{
EditorUtility.RevealInFinder(formInputData[targetDst]);
EditorUtility.RevealInFinder(GetAbsolutePath(formInputData[targetDst]));
}
GUIUtility.ExitGUI();
}
@ -290,8 +298,8 @@ namespace WeChatWASM
EditorGUILayout.BeginHorizontal();
if (GUILayout.Button(new GUIContent("更多配置项"), GUILayout.Width(100), GUILayout.Height(25)))
{
var config = AssetDatabase.LoadAssetAtPath<UnityEngine.Object>("Assets/WX-WASM-SDK-V2/Editor/MiniGameConfig.asset");
Selection.activeObject = config;
var minigameConfig = AssetDatabase.LoadAssetAtPath<UnityEngine.Object>("Assets/WX-WASM-SDK-V2/Editor/MiniGameConfig.asset");
Selection.activeObject = minigameConfig;
GUIUtility.ExitGUI();
}
if (GUILayout.Button(new GUIContent("WebGL转小游戏(不常用)"), GUILayout.Width(150), GUILayout.Height(25)))
@ -380,7 +388,8 @@ namespace WeChatWASM
{
// SDKFilePath = Path.Combine(Application.dataPath, "WX-WASM-SDK-V2", "Runtime", "wechat-default", "unity-sdk", "index.js");
SDKFilePath = Path.Combine(UnityUtil.GetWxSDKRootPath(), "Runtime", "wechat-default", "unity-sdk", "index.js");
var config = UnityUtil.GetEditorConf();
config = UnityUtil.GetEditorConf();
_dstCache = config.ProjectConf.DST;
// Instant Game
if (WXConvertCore.IsInstantGameAutoStreaming())
@ -422,7 +431,7 @@ namespace WeChatWASM
this.setData("compressDataPackage", config.ProjectConf.compressDataPackage);
this.setData("videoUrl", config.ProjectConf.VideoUrl);
this.setData("orientation", (int)config.ProjectConf.Orientation);
this.setData("dst", config.ProjectConf.DST);
this.setData("dst", _dstCache);
this.setData("bundleHashLength", config.ProjectConf.bundleHashLength.ToString());
this.setData("bundlePathIdentifier", config.ProjectConf.bundlePathIdentifier);
this.setData("bundleExcludeExtensions", config.ProjectConf.bundleExcludeExtensions);
@ -495,7 +504,8 @@ namespace WeChatWASM
config.ProjectConf.compressDataPackage = this.getDataCheckbox("compressDataPackage");
config.ProjectConf.VideoUrl = this.getDataInput("videoUrl");
config.ProjectConf.Orientation = (WXScreenOritation)this.getDataPop("orientation");
config.ProjectConf.DST = this.getDataInput("dst");
_dstCache = this.getDataInput("dst");
config.ProjectConf.DST = GetAbsolutePath(_dstCache);
config.ProjectConf.bundleHashLength = int.Parse(this.getDataInput("bundleHashLength"));
config.ProjectConf.bundlePathIdentifier = this.getDataInput("bundlePathIdentifier");
config.ProjectConf.bundleExcludeExtensions = this.getDataInput("bundleExcludeExtensions");
@ -727,7 +737,38 @@ namespace WeChatWASM
}
}
}
public static bool IsAbsolutePath(string path)
{
// 检查是否为空或空白
if (string.IsNullOrWhiteSpace(path))
{
return false;
}
// 在 Windows 上,检查驱动器字母或网络路径
if (Application.platform == RuntimePlatform.WindowsEditor && Path.IsPathRooted(path))
{
return true;
}
// 在 Unix/Linux 和 macOS 上,检查是否以 '/' 开头
if (Application.platform == RuntimePlatform.OSXEditor && path.StartsWith("/"))
{
return true;
}
return false; // 否则为相对路径
}
public static string GetAbsolutePath(string path)
{
if (IsAbsolutePath(path))
{
return path;
}
return Path.Combine(projectRootPath, path);
}
}
}

View File

@ -2,7 +2,7 @@
{
public class WXPluginVersion
{
public static string pluginVersion = "202410080706"; // 这一行不要改他,导出的时候会自动替换
public static string pluginVersion = "202410101117"; // 这一行不要改他,导出的时候会自动替换
}
public class WXPluginConf

Binary file not shown.

View File

@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: b1f260667675a9a7d0a655237a4c3430
guid: 5fac5595894223b50f9fc68c56c9e96f
DefaultImporter:
externalObjects: {}
userData:

View File

@ -30,7 +30,7 @@ mergeInto(LibraryManager.library, {
GameGlobal.memprofiler = emscriptenMemoryProfiler
GameGlobal.memprofiler.onDump = function () {
var fs = wx.getFileSystemManager();
var allocation_used=GameGlobal.memprofiler.allocationsAtLoc;
var allocation_used = GameGlobal.memprofiler.allocationsAtLoc;
if (typeof allocation_used === "undefined") allocation_used=GameGlobal.memprofiler.allocationSiteStatistics;
var calls = [];
for (var i in allocation_used) {
@ -995,13 +995,13 @@ mergeInto(LibraryManager.library, {
var sdk = _WXPointer_stringify_adaptor(sdkName);
var func = _WXPointer_stringify_adaptor(functionName);
var formattedArgs = JSON.parse(_WXPointer_stringify_adaptor(args));
GameGlobal[sdk][func](...formattedArgs);
GameGlobal[sdk][func].apply(GameGlobal[sdk], formattedArgs);
},
WX_CallJSFunctionWithReturn: function (sdkName, functionName, args) {
var sdk = _WXPointer_stringify_adaptor(sdkName);
var func = _WXPointer_stringify_adaptor(functionName);
var formattedArgs = JSON.parse(_WXPointer_stringify_adaptor(args));
var res = GameGlobal[sdk][func](...formattedArgs);
var res = GameGlobal[sdk][func].apply(GameGlobal[sdk], formattedArgs);
var resStr = JSON.stringify(res);
var bufferSize = lengthBytesUTF8(resStr || '') + 1;
var buffer = _malloc(bufferSize);

Binary file not shown.

View File

@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: 57aa93b43d006f13c8e05e350d6cd32f
guid: 67898c3a6fa50ff285b422af9e2d550d
DefaultImporter:
externalObjects: {}
userData:

Binary file not shown.

View File

@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: fa414b40926610979325ff6d05eada8c
guid: 2dc94a95f54ccc8279acbf4fd11438e3
DefaultImporter:
externalObjects: {}
userData:

View File

@ -7,7 +7,7 @@ namespace WeChatWASM
{
public class WXRuntimeExtDef
{
[RuntimeInitializeOnLoadMethod(RuntimeInitializeLoadType.BeforeSplashScreen)]
[RuntimeInitializeOnLoadMethod(RuntimeInitializeLoadType.BeforeSceneLoad)]
static void OnWXRuntimeExtDefLoadRuntimeMethod()
{
Init();

View File

@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: 44a7e1e416ef5132a57ccfa3939eca38
guid: ebd882cd3c826e6eadcf62e23d54f19b
DefaultImporter:
externalObjects: {}
userData:

View File

@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: a8c126ddc61c8cc6ed296c38f7f1e957
guid: d86ad6de6c17765b70876d120cdd20c3
DefaultImporter:
externalObjects: {}
userData:

View File

@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: 98eb2eb98064d124aae821b0310bacf2
guid: f35b4bcbe80fccb78230fe66165dbb18
DefaultImporter:
externalObjects: {}
userData:

View File

@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: d7844e1d7d7626fe49436142ee66a9e6
guid: 509de1a212fdc1abd7b3175a4d603390
DefaultImporter:
externalObjects: {}
userData:

View File

@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: 277f37fd525363bcd0ac1e76c7190146
guid: ab977e7528dd2cbe7ec93326dd7ed8fa
DefaultImporter:
externalObjects: {}
userData:

View File

@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: 6f7065a76a20ec762f47e6af22bd76d9
guid: 9fd793350e5da62dd8fe8957e1509b64
DefaultImporter:
externalObjects: {}
userData:

View File

@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: 1c01ed2e5319c00de34c7913548e1b60
guid: ea42f7abd8914b4292eba71ddcfaac6f
DefaultImporter:
externalObjects: {}
userData:

View File

@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: 3d4add50de1d58ec65ecc3bec54d3de1
guid: 5f0094804806b5c4be6afda3cb358b63
DefaultImporter:
externalObjects: {}
userData:

View File

@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: 471715336cf16bf9aa11245d6cb64343
guid: a0e0e7a1cb238bcc9087706a8bf87d72
DefaultImporter:
externalObjects: {}
userData:

View File

@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: dc92d9012b6b5518e4ee161dd9ee324f
guid: 492f0c6e53ebdd5ae894cb9c8f5b03e0
DefaultImporter:
externalObjects: {}
userData:

View File

@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: e408a2e1dafb6b88fe6fea613212ccdc
guid: 8746d909e43fd9667a125d29054b41f3
DefaultImporter:
externalObjects: {}
userData:

View File

@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: fca653978f3fe1e0541ebe4d81db4271
guid: c72428786b23bc703ac8fd8036ca944f
DefaultImporter:
externalObjects: {}
userData:

View File

@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: ac9029b2e489f669e74be2600ee58343
guid: d94bded9ead037022e990c154e1bbb94
DefaultImporter:
externalObjects: {}
userData:

View File

@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: f0bd9aa7e524c03c5dd7d51bc605a57a
guid: c19d61b9a41af1cc75a36f578ab72997
DefaultImporter:
externalObjects: {}
userData:

View File

@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: bcc0d1cce30fa211c0684b1cab7aa4ab
guid: 91e625f9af0ae752568d45d2f93d4219
DefaultImporter:
externalObjects: {}
userData:

View File

@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: 423a761412c9bb3c2fa7e3b745917f8c
guid: a089d716f244ee248d49d1c48cfd9702
DefaultImporter:
externalObjects: {}
userData:

View File

@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: e9f20942a9f85ab47412b9fce3937954
guid: 811423bad3b2de6069fcdc49dd02b96d
DefaultImporter:
externalObjects: {}
userData:

View File

@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: 0b69c585d2010389e4455b910717079f
guid: 4642dd163f1afa756a6791fcddbd8573
DefaultImporter:
externalObjects: {}
userData:

View File

@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: 21a2b3bbc3c4c4394354fe38eaebe2f1
guid: 44fad17947a9ba506ff72965a061015a
DefaultImporter:
externalObjects: {}
userData:

View File

@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: 4d933c70f2eadac74f8f05b07b3265f5
guid: 9369d8a183183142fa183088bd3e36a8
DefaultImporter:
externalObjects: {}
userData:

View File

@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: a044c9fb8bcc674808b1922fc08d517a
guid: aee3ad5cbb8692ab05076f8378513b8f
DefaultImporter:
externalObjects: {}
userData:

View File

@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: e05acefc59d97fe85f2d4c5db3ad919e
guid: 356c3bd096aaf8bf23f1652448ccde9e
DefaultImporter:
externalObjects: {}
userData:

View File

@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: d49e7b1725866a315e43d17ef34ffe02
guid: 52bee2c08198be28c87eeea525b4b9b1
DefaultImporter:
externalObjects: {}
userData:

View File

@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: 9fa840e35fcb24b74a5d7ba50fb15c61
guid: 7dbec4a6f262a7807fb3442a8e282da4
DefaultImporter:
externalObjects: {}
userData:

View File

@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: dbc5a57b21ae6ff0474262aa85d04a9f
guid: c407d5f62cdfb883292cfaa1d57e0362
DefaultImporter:
externalObjects: {}
userData:

View File

@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: 582c265cbb4802baaeb8b4951551027d
guid: e72180d5d6cf8c9f913f6dfb65661437
DefaultImporter:
externalObjects: {}
userData:

View File

@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: 5b3878e7fa96b761a24d659858f80a57
guid: 002e25c1f6886dd694c6837fcc226e6c
DefaultImporter:
externalObjects: {}
userData:

View File

@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: ad740f946e41fcc1eb2a431f058be6d7
guid: fbe5f4d6c11c7e5deec645c65d79f273
DefaultImporter:
externalObjects: {}
userData:

View File

@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: 70169de3f7f88310e8a581b1d4ee7cd5
guid: 818861678b01be1037e65d4d61d595e0
DefaultImporter:
externalObjects: {}
userData:

View File

@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: d92d43031458152693c68d32566ca073
guid: fad379e544f109d9ec8dc5828de469a5
DefaultImporter:
externalObjects: {}
userData:

View File

@ -1,6 +1,4 @@
// @ts-nocheck
/* eslint-disable no-unused-vars */
/* eslint-disable no-undef */
const unityNamespace = {
canvas: GameGlobal.canvas,
// cache width
@ -138,6 +136,7 @@ function bindGloblException() {
});
// 上报初始信息
function printSystemInfo(appBaseInfo, deviceInfo) {
// eslint-disable-next-line @typescript-eslint/naming-convention
const { version, SDKVersion } = appBaseInfo;
const { platform, system } = deviceInfo;
unityNamespace.version = version;

View File

@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: 11aed45104c833a22c3f244a3d1e3591
guid: b2d6fe35d161d52675e945b7b1337a4c
DefaultImporter:
externalObjects: {}
userData:

View File

@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: 8be8a5e031b65ccdd4964fac6fadd791
guid: 99eb9510bf678bf963669a4749f91871
DefaultImporter:
externalObjects: {}
userData:

View File

@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: 37c799c396873071f6eb977f96c2abd5
guid: c5a1ef9d2ce334140f76d46aeaeb32c2
DefaultImporter:
externalObjects: {}
userData:

View File

@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: 37e21b438d686abe321627746a8a0ea4
guid: 80d082b29b64400e1adfc5493243db9c
DefaultImporter:
externalObjects: {}
userData:

View File

@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: 8f1ec5dc506b985667e29b95461c737d
guid: 717a8076f2465922c308bb349446c5de
DefaultImporter:
externalObjects: {}
userData:

View File

@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: 288b902e490b8deeb4f5a9fbacdbdd94
guid: a42f6d69f3d9ba6fd31d8ac4284357f9
DefaultImporter:
externalObjects: {}
userData:

View File

@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: 97555a13c2ad9d2a5028a2045a4a1a49
guid: 2288028ed2072aedac0b7ec4a6c41600
DefaultImporter:
externalObjects: {}
userData:

View File

@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: 8e7ab8fe88edbd8067c59fe238e64a70
guid: db2a912fd6f5d42270c51b7052811748
DefaultImporter:
externalObjects: {}
userData:

View File

@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: 328cd64e28047419abd725446a57bd03
guid: cd6eab62ac3ac9f190b50b1bc621afcc
DefaultImporter:
externalObjects: {}
userData:

View File

@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: 02d563b4452e1007500b8f1a82ad59c6
guid: da5174bc14a7e662876ced8d10ec237e
DefaultImporter:
externalObjects: {}
userData:

View File

@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: d8d8260bbc052f164588d3e5683220b5
guid: 3af49286dc6d9967ccc772266944ac42
DefaultImporter:
externalObjects: {}
userData:

View File

@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: c21bc9b30537e30c57d58da5f12d5aa1
guid: 7af1f88483447ed246b1cd77a71d50e8
DefaultImporter:
externalObjects: {}
userData:

View File

@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: 79c014c85810762878fb9fba6d6db4f6
guid: 39060ee92dc9dc5d507b1ab6326d3113
DefaultImporter:
externalObjects: {}
userData:

View File

@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: c2c4c40648ddc3e939370bd89d3508f9
guid: 185a749e3968175dbce69f9ea46d9675
DefaultImporter:
externalObjects: {}
userData:

View File

@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: 48e1f02e9b0b91f9c537510dd6b54716
guid: b750c6e5e8ac2f8ff984fe3c0c9f5cd2
DefaultImporter:
externalObjects: {}
userData:

View File

@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: cc598f0b5a617250e913512b28f32801
guid: 21c993941d72c6865ef6b49b1d68b068
DefaultImporter:
externalObjects: {}
userData:

View File

@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: 42abf1423fd47313211d9aef0fc5d845
guid: 3961e33f1ce8b6a627bb2b1e620070b0
DefaultImporter:
externalObjects: {}
userData:

View File

@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: 05cd7b2d8a5c623ddede1517790281bc
guid: 586bb4da3e4e75c43f754c35fe9ffb00
DefaultImporter:
externalObjects: {}
userData:

View File

@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: b6624fa1bb3493bc3f3e4f05984deee4
guid: 86d1916914f33a587476d588b503bfa2
DefaultImporter:
externalObjects: {}
userData:

View File

@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: 21b69774392f14c148c8bea5c247b378
guid: 5667b25079909abab89294e8eea5964a
DefaultImporter:
externalObjects: {}
userData:

View File

@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: 665edb287fe85eacb5c0e2947f80101e
guid: 60ac02e2913cd8637a96d8e0bf31d553
DefaultImporter:
externalObjects: {}
userData:

View File

@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: 7b3701d66ad840d6ce5fba1ce2c225d5
guid: e2a784dd123ed0cca16bd8860ba709fb
DefaultImporter:
externalObjects: {}
userData:

View File

@ -89,81 +89,94 @@ const fontOptions = {
},
CustomUnicodeRange: $CustomUnicodeRange,
};
function handleGetFontData(config, forceLoad = false) {
function handleGetFontData(config, forceFallback) {
const canGetWxCommonFont = !!GameGlobal.manager?.font?.getCommonFont;
if (!config && !canGetWxCommonFont) {
return Promise.reject('invalid usage');
}
// eslint-disable-next-line @typescript-eslint/no-misused-promises
if (!getFontPromise || forceLoad) {
if (!getFontPromise || forceFallback) {
getFontPromise = new Promise((resolve, reject) => {
if (!canGetWxCommonFont && !!config) {
if ((!canGetWxCommonFont || forceFallback) && !!config) {
const xhr = new GameGlobal.unityNamespace.UnityLoader.UnityCache.XMLHttpRequest();
xhr.open('GET', config.fallbackUrl, true);
xhr.responseType = 'arraybuffer';
xhr.open('GET', config.fallbackUrl, true);
xhr.responseType = 'arraybuffer';
xhr.onload = () => {
if ((xhr.status === 200 || xhr.status === 0) && xhr.response) {
const notoFontData = xhr.response;
fontDataCache = notoFontData;
isReadFromCache = xhr.isReadFromCache;
resolve();
const notoFontData = xhr.response;
fontDataCache = notoFontData;
isReadFromCache = xhr.isReadFromCache;
resolve();
}
};
xhr.onerror = reject;
xhr.send();
xhr.onerror = reject;
xhr.send();
return;
}
let unicodeRange = [];
let unicodeRange = [];
Object.keys(fontOptions).forEach((key) => {
if (fontOptions[key].include) {
unicodeRange.push(fontOptions[key].unicodeRange);
unicodeRange.push(fontOptions[key].unicodeRange);
}
});
unicodeRange = unicodeRange.concat(fontOptions.CustomUnicodeRange);
unicodeRange = unicodeRange.concat(fontOptions.CustomUnicodeRange);
GameGlobal.manager.font.getCommonFont({
success(fontData) {
if (isIOS) {
fixCmapTable(fontData);
}
if (isAndroid) {
const tempData = splitTTCToBufferOnlySC(fontData);
if (tempData) {
fontData = tempData;
fontData = tempData;
}
}
fontDataCache = fontData;
resolve();
fontDataCache = fontData;
resolve();
},
fail: reject,
}, unicodeRange);
fail: reject,
}, unicodeRange);
});
}
return getFontPromise;
return getFontPromise;
}
function WXGetFontRawData(conf, callbackId) {
const config = formatJsonStr(conf);
const loadFromRemote = !GameGlobal.manager?.font?.getCommonFont;
GameGlobal.manager.TimeLogger.timeStart('WXGetFontRawData');
handleGetFontData(config).then(() => {
function WXGetFontRawData(conf, callbackId, forceFallback = false) {
const config = formatJsonStr(conf);
const loadFromRemote = !GameGlobal.manager?.font?.getCommonFont;
GameGlobal.manager.TimeLogger.timeStart('WXGetFontRawData');
handleGetFontData(config, forceFallback).then(() => {
if (fontDataCache) {
GameGlobal.manager.font.reportGetFontCost(GameGlobal.manager.TimeLogger.timeEnd('WXGetFontRawData'), { loadFromRemote, isReadFromCache, preloadWXFont: GameGlobal.unityNamespace.preloadWXFont });
const { ascent, descent, lineGap, unitsPerEm } = readMetrics(fontDataCache) || {};
tempCacheObj[callbackId] = fontDataCache;
moduleHelper.send('GetFontRawDataCallback', JSON.stringify({ callbackId, type: 'success', res: JSON.stringify({ byteLength: fontDataCache.byteLength, ascent, descent, lineGap, unitsPerEm }) }));
GameGlobal.manager.Logger.pluginLog(`[font] load font from ${loadFromRemote ? `network, url=${config.fallbackUrl}` : 'local'}`);
fontDataCache = null;
GameGlobal.manager.font.reportGetFontCost(GameGlobal.manager.TimeLogger.timeEnd('WXGetFontRawData'), { loadFromRemote: forceFallback || loadFromRemote, isReadFromCache, preloadWXFont: GameGlobal.unityNamespace.preloadWXFont });
const { ascent, descent, lineGap, unitsPerEm } = readMetrics(fontDataCache) || {};
tempCacheObj[callbackId] = fontDataCache;
moduleHelper.send('GetFontRawDataCallback', JSON.stringify({ callbackId, type: 'success', res: JSON.stringify({ byteLength: fontDataCache.byteLength, ascent, descent, lineGap, unitsPerEm }) }));
GameGlobal.manager.Logger.pluginLog(`[font] load font from ${forceFallback || loadFromRemote ? `network, url=${config.fallbackUrl}` : 'local'}`);
fontDataCache = null;
}
else {
GameGlobal.manager.Logger.pluginError('[font] load font error: empty content');
}
})
.catch((err) => {
GameGlobal.manager.Logger.pluginError('[font] load font error: ', err);
if (err.errmsg === 'no support font' && forceFallback === false) {
WXGetFontRawData(conf, callbackId, true);
}
else {
GameGlobal.manager.Logger.pluginError('[font] load font error: ', err);
}
});
}
function WXShareFontBuffer(buffer, offset, callbackId) {

View File

@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: 20ba3d24ca45406882d87c30309e072b
guid: 2d28821d3607bc193a0033d02fb7fadf
DefaultImporter:
externalObjects: {}
userData:

View File

@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: d7a76d71627b5e97314fcf3cb54ef8fe
guid: 4cab12438d0711a09c78c043d8161ff3
DefaultImporter:
externalObjects: {}
userData:

View File

@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: 4a125bd5351b97f74e3b5f349e4053d5
guid: eb375f62fc3570c809acf9bb6ac0dbf8
DefaultImporter:
externalObjects: {}
userData:

View File

@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: 1ce1e19c6a89d0be31c757f1e5ab0a03
guid: 0c9fe8260963dbecea9dfd6e3ca5bb61
DefaultImporter:
externalObjects: {}
userData:

View File

@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: 7706abe8371bf5bcdcc88b6e24259b86
guid: 275089b85c9c0f8b7861515eeeb61f06
DefaultImporter:
externalObjects: {}
userData:

View File

@ -25,6 +25,10 @@ export default {
config.type = typeEnum[config.type];
// @ts-ignore
config.icon = iconEnum[config.icon];
if (!config.text) {
config.text = '';
}
const id = uid();
gameClubButtonList[id] = wx.createGameClubButton(config);
return id;

View File

@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: 43b8eb5313337c61950a44b41eb6d72b
guid: e690cf9e9ebccbc20a6c0a9d59f3df90
DefaultImporter:
externalObjects: {}
userData:

View File

@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: 0f7a23834543a8c77d2d1790d0801fec
guid: 80766c8723ce705a865586e3943e27c2
DefaultImporter:
externalObjects: {}
userData:

View File

@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: 38646574248504f5b7d734483adf66ba
guid: d0ae7819e22f7e2888c4962253bc3c11
DefaultImporter:
externalObjects: {}
userData:

View File

@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: 1b18c50ea896e41cd31100e6e88e5d71
guid: 1cc790c843e7519152d2b51da51980f8
DefaultImporter:
externalObjects: {}
userData:

View File

@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: 0ae7d52d9bf63f0d07f717fc90c83d62
guid: 37a85413738478f0ba914fb6a55a8c28
DefaultImporter:
externalObjects: {}
userData:

View File

@ -1,3 +1,4 @@
/* eslint-disable @typescript-eslint/naming-convention */
let FrameworkData = null;
const keyboardSetting = {
value: '',
@ -13,6 +14,7 @@ const keyboardConfirmlistener = function (res) {
keyboardSetting.value = res.value;
_JS_MobileKeyboard_Hide(false);
};
// eslint-disable-next-line @typescript-eslint/no-unused-vars
const keyboardCompletelistener = function (res) {
removeKeyboardListeners();
};
@ -87,6 +89,7 @@ function _JS_MobileKeyboard_SetText(text) {
}
keyboardSetting.value = FrameworkData.UTF8ToString(text);
}
// eslint-disable-next-line @typescript-eslint/no-unused-vars
function _JS_MobileKeyboard_SetTextSelection(start, length) {
}
@ -99,7 +102,7 @@ function _JS_MobileKeyboard_Show(text, keyboardType, autocorrection, multiline,
mobile_input_hide_delay = null;
}
if (hasExistingMobileInput) {
if (keyboardSetting.multiple != !!multiline) {
if (keyboardSetting.multiple !== !!multiline) {
_JS_MobileKeyboard_Hide(false);
return;
}

View File

@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: 78208776132b56e2d5f9d2343b943056
guid: 0e7bbb431167c8d21920b50adeaf94c3
DefaultImporter:
externalObjects: {}
userData:

View File

@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: 05566ffda7a016ee34212dd4403ea1ce
guid: 535b97d69db838fa243000b68ac9c280
DefaultImporter:
externalObjects: {}
userData:

View File

@ -22,7 +22,12 @@ function hookUnityRender() {
if (!textureObject) {
textureObject = gl.createTexture();
gl.bindTexture(gl.TEXTURE_2D, textureObject);
gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, gl.RGBA, gl.UNSIGNED_BYTE, getSharedCanvas());
if (GameGlobal.unityNamespace.unityColorSpace === 'Linear') {
gl.texImage2D(gl.TEXTURE_2D, 0, gl.SRGB8_ALPHA8, gl.RGBA, gl.UNSIGNED_BYTE, getSharedCanvas());
}
else {
gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, gl.RGBA, gl.UNSIGNED_BYTE, getSharedCanvas());
}
gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.LINEAR);
gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.LINEAR);
gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE);
@ -31,7 +36,12 @@ function hookUnityRender() {
else {
gl.bindTexture(gl.TEXTURE_2D, textureObject);
gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, gl.RGBA, gl.UNSIGNED_BYTE, getSharedCanvas());
if (GameGlobal.unityNamespace.unityColorSpace === 'Linear') {
gl.texImage2D(gl.TEXTURE_2D, 0, gl.SRGB8_ALPHA8, gl.RGBA, gl.UNSIGNED_BYTE, getSharedCanvas());
}
else {
gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, gl.RGBA, gl.UNSIGNED_BYTE, getSharedCanvas());
}
}
GL.textures[textureId] = textureObject;
timerId = requestAnimationFrame(hookUnityRender);

View File

@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: e00b2bc56897cf34fe0e5e9f01cf859f
guid: 8451f9e741ab6084784221fc3fb7b258
DefaultImporter:
externalObjects: {}
userData:

View File

@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: 883a5927606cd035636ce9cde6826013
guid: 9544a53304b177128b29a4263c154242
DefaultImporter:
externalObjects: {}
userData:

View File

@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: 63c39eca6eea7ffde1d6df27a9a7b091
guid: 513c9fd06a80a818996ad7a43d684da3
DefaultImporter:
externalObjects: {}
userData:

View File

@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: 831e033db393e20865c9af9e9bd6fae1
guid: 138b31a586d41b198418818a20c611a4
DefaultImporter:
externalObjects: {}
userData:

View File

@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: ac3f128015ad7b912c5304514cb63ff5
guid: 22c3d6c142be91eb41dcc6a5871f12e3
DefaultImporter:
externalObjects: {}
userData:

View File

@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: 79267e7b3197ac6f478019c75e75193a
guid: 4d2b3324d18233fdf3675a864071ff58
DefaultImporter:
externalObjects: {}
userData:

View File

@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: 68db380480c460248d3fcc94e5980401
guid: 2be181bc8e1934edb2dd5dd5454cc72e
DefaultImporter:
externalObjects: {}
userData:

View File

@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: 5ff8df7518d27555ad16c33efe1053bc
guid: 130cb9cb196ebb140658474808f2d1af
DefaultImporter:
externalObjects: {}
userData:

View File

@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: ba07f9e0fcb6ea38cd2a170a36b7cfa4
guid: 5ce68999fe328cba6dd2715078a47d41
DefaultImporter:
externalObjects: {}
userData:

View File

@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: c43d006a718a052cf9a79756a059cb9f
guid: 25ccaebfa1bfa4d08f1a060b04409cf8
DefaultImporter:
externalObjects: {}
userData:

View File

@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: 6c63b2187c1e68183683fb9915b3e7c3
guid: eb1d07f847d9dc9e6346812fca8345d6
DefaultImporter:
externalObjects: {}
userData:

View File

@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: 443b7ad0bfb906dc992f60a98d382673
guid: de10ead5334711ab9c5651ff44903015
DefaultImporter:
externalObjects: {}
userData:

View File

@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: a65298b6e7a184b5929029919a93ec95
guid: 18a61a8d29fcff3e03536e2672beb805
DefaultImporter:
externalObjects: {}
userData:

View File

@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: 807c4219d420de8a473cbf5219f8f539
guid: 1cb8023e7f80f4f8ed228288d85a2328
DefaultImporter:
externalObjects: {}
userData:

View File

@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: b2117f3150e02282fe0820cf4260be04
guid: 0787bf5ed4e4baf4cf0383953f231d06
DefaultImporter:
externalObjects: {}
userData:

View File

@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: 0bcc64f8d742efdde00a537553db1b67
guid: f4c9f0176a340fe1005f5fdab1e26b54
DefaultImporter:
externalObjects: {}
userData:

View File

@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: ed5eccc8123e9750b0c795f4493438ef
guid: e5196ba0c07aaa615463ea6a011506fe
DefaultImporter:
externalObjects: {}
userData:

View File

@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: 0b5db98a5dfa7901396e46810a193e49
guid: 7dc53d57b223acd84ba872663f2eb614
DefaultImporter:
externalObjects: {}
userData:

Some files were not shown because too many files have changed in this diff Show More