mirror of
https://github.com/wechat-miniprogram/minigame-tuanjie-transform-sdk.git
synced 2025-11-14 21:35:55 +08:00
Auto-publish release WXSDK.
This commit is contained in:
parent
0b60ea5a61
commit
e62f6b2b72
@ -10,6 +10,7 @@ using UnityEngine.Rendering;
|
|||||||
using LitJson;
|
using LitJson;
|
||||||
using UnityEditor.Build;
|
using UnityEditor.Build;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
|
using System.Net;
|
||||||
using static WeChatWASM.LifeCycleEvent;
|
using static WeChatWASM.LifeCycleEvent;
|
||||||
|
|
||||||
namespace WeChatWASM
|
namespace WeChatWASM
|
||||||
@ -937,6 +938,7 @@ namespace WeChatWASM
|
|||||||
ModifyWeChatConfigs(isFromConvert);
|
ModifyWeChatConfigs(isFromConvert);
|
||||||
ModifySDKFile();
|
ModifySDKFile();
|
||||||
ClearFriendRelationCode();
|
ClearFriendRelationCode();
|
||||||
|
GameJsPlugins();
|
||||||
|
|
||||||
// 如果没有StreamingAssets目录,默认生成
|
// 如果没有StreamingAssets目录,默认生成
|
||||||
if (!Directory.Exists(Path.Combine(config.ProjectConf.DST, webglDir, "StreamingAssets")))
|
if (!Directory.Exists(Path.Combine(config.ProjectConf.DST, webglDir, "StreamingAssets")))
|
||||||
@ -992,7 +994,7 @@ namespace WeChatWASM
|
|||||||
var sourceBuffer = File.ReadAllBytes(sourcePath);
|
var sourceBuffer = File.ReadAllBytes(sourcePath);
|
||||||
byte[] outputBuffer = new byte[0];
|
byte[] outputBuffer = new byte[0];
|
||||||
int ret = 0;
|
int ret = 0;
|
||||||
if (sourceBuffer.Length > 50 * 1024 * 1024 && Path.GetExtension(sourcePath) == "wasm") // 50MB以上的wasm压缩率低了可能导致小游戏包超过20MB,需提高压缩率
|
if (sourceBuffer.Length > 50 * 1024 * 1024 && Path.GetExtension(sourcePath) == ".wasm") // 50MB以上的wasm压缩率低了可能导致小游戏包超过20MB,需提高压缩率
|
||||||
{
|
{
|
||||||
ret = BrotliEnc.CompressWasmMT(sourceBuffer, ref outputBuffer, quality, window, maxCpuThreads);
|
ret = BrotliEnc.CompressWasmMT(sourceBuffer, ref outputBuffer, quality, window, maxCpuThreads);
|
||||||
}
|
}
|
||||||
@ -1001,8 +1003,10 @@ namespace WeChatWASM
|
|||||||
ret = BrotliEnc.CompressBufferMT(sourceBuffer, ref outputBuffer, quality, window, maxCpuThreads);
|
ret = BrotliEnc.CompressBufferMT(sourceBuffer, ref outputBuffer, quality, window, maxCpuThreads);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ret == 0) {
|
if (ret == 0)
|
||||||
using (FileStream fileStream = new FileStream(dstPath, FileMode.Create, FileAccess.Write)) {
|
{
|
||||||
|
using (FileStream fileStream = new FileStream(dstPath, FileMode.Create, FileAccess.Write))
|
||||||
|
{
|
||||||
fileStream.Write(outputBuffer, 0, outputBuffer.Length);
|
fileStream.Write(outputBuffer, 0, outputBuffer.Length);
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
@ -1016,7 +1020,7 @@ namespace WeChatWASM
|
|||||||
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 如果没有使用好友关系链的话,自动删掉无用代码
|
/// 更新game.json
|
||||||
/// </summary>
|
/// </summary>
|
||||||
private static void ClearFriendRelationCode()
|
private static void ClearFriendRelationCode()
|
||||||
{
|
{
|
||||||
@ -1025,7 +1029,7 @@ namespace WeChatWASM
|
|||||||
string content = File.ReadAllText(filePath, Encoding.UTF8);
|
string content = File.ReadAllText(filePath, Encoding.UTF8);
|
||||||
JsonData gameJson = JsonMapper.ToObject(content);
|
JsonData gameJson = JsonMapper.ToObject(content);
|
||||||
|
|
||||||
if (!config.SDKOptions.UseFriendRelation || !config.SDKOptions.UseMiniGameChat)
|
if (!config.SDKOptions.UseFriendRelation || !config.SDKOptions.UseMiniGameChat || config.CompileOptions.autoAdaptScreen)
|
||||||
{
|
{
|
||||||
JsonWriter writer = new JsonWriter();
|
JsonWriter writer = new JsonWriter();
|
||||||
writer.IndentValue = 2;
|
writer.IndentValue = 2;
|
||||||
@ -1049,12 +1053,66 @@ namespace WeChatWASM
|
|||||||
UnityEngine.Debug.Log(gameJson["plugins"]);
|
UnityEngine.Debug.Log(gameJson["plugins"]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (config.CompileOptions.autoAdaptScreen)
|
||||||
|
{
|
||||||
|
gameJson["displayMode"] = "desktop";
|
||||||
|
}
|
||||||
|
|
||||||
// 将配置写回到文件夹
|
// 将配置写回到文件夹
|
||||||
gameJson.ToJson(writer);
|
gameJson.ToJson(writer);
|
||||||
File.WriteAllText(filePath, writer.TextWriter.ToString());
|
File.WriteAllText(filePath, writer.TextWriter.ToString());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 更新game.js
|
||||||
|
/// </summary>
|
||||||
|
private static void GameJsPlugins()
|
||||||
|
{
|
||||||
|
var filePath = Path.Combine(config.ProjectConf.DST, miniGameDir, "game.js");
|
||||||
|
|
||||||
|
string content = File.ReadAllText(filePath, Encoding.UTF8);
|
||||||
|
|
||||||
|
Regex regex = new Regex(@"^import .*;$", RegexOptions.Multiline);
|
||||||
|
MatchCollection matches = regex.Matches(content);
|
||||||
|
|
||||||
|
int lastIndex = 0;
|
||||||
|
if (matches.Count > 0)
|
||||||
|
{
|
||||||
|
lastIndex = matches[matches.Count - 1].Index + matches[matches.Count - 1].Length;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool changed = false;
|
||||||
|
StringBuilder sb = new StringBuilder(content);
|
||||||
|
if (config.ProjectConf.needCheckUpdate)
|
||||||
|
{
|
||||||
|
sb.Insert(lastIndex, Environment.NewLine + "import './plugins/check-update';");
|
||||||
|
changed = true;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
File.Delete(Path.Combine(config.ProjectConf.DST, miniGameDir, "plugins", "check-update.js"));
|
||||||
|
}
|
||||||
|
if (config.CompileOptions.autoAdaptScreen)
|
||||||
|
{
|
||||||
|
sb.Insert(lastIndex, Environment.NewLine + "import './plugins/screen-adapter';");
|
||||||
|
changed = true;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
File.Delete(Path.Combine(config.ProjectConf.DST, miniGameDir, "plugins", "screen-adapter.js"));
|
||||||
|
}
|
||||||
|
|
||||||
|
if (changed)
|
||||||
|
{
|
||||||
|
File.WriteAllText(filePath, sb.ToString(), Encoding.UTF8);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Directory.Delete(Path.Combine(config.ProjectConf.DST, miniGameDir, "plugins"), true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
private static void ModifySDKFile()
|
private static void ModifySDKFile()
|
||||||
{
|
{
|
||||||
@ -1245,6 +1303,26 @@ namespace WeChatWASM
|
|||||||
return ret.ToString();
|
return ret.ToString();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 生成Unitynamespace下的bootconfig
|
||||||
|
/// </summary>
|
||||||
|
private static string GenerateBootInfo()
|
||||||
|
{
|
||||||
|
StringBuilder sb = new StringBuilder();
|
||||||
|
// 添加player-connection-ip信息
|
||||||
|
var host = Dns.GetHostEntry(Dns.GetHostName());
|
||||||
|
foreach (var ip in host.AddressList)
|
||||||
|
{
|
||||||
|
if (ip.AddressFamily == System.Net.Sockets.AddressFamily.InterNetwork)
|
||||||
|
{
|
||||||
|
sb.Append($"player-connection-ip={ip.ToString()}");
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return sb.ToString();
|
||||||
|
}
|
||||||
|
|
||||||
public static void ModifyWeChatConfigs(bool isFromConvert = false)
|
public static void ModifyWeChatConfigs(bool isFromConvert = false)
|
||||||
{
|
{
|
||||||
UnityEngine.Debug.LogFormat("[Converter] Starting to modify configs");
|
UnityEngine.Debug.LogFormat("[Converter] Starting to modify configs");
|
||||||
@ -1262,6 +1340,8 @@ namespace WeChatWASM
|
|||||||
var customUnicodeRange = GetCustomUnicodeRange(config.FontOptions.CustomUnicode);
|
var customUnicodeRange = GetCustomUnicodeRange(config.FontOptions.CustomUnicode);
|
||||||
Debug.Log("customUnicodeRange: " + customUnicodeRange);
|
Debug.Log("customUnicodeRange: " + customUnicodeRange);
|
||||||
|
|
||||||
|
var boolConfigInfo = GenerateBootInfo();
|
||||||
|
|
||||||
Rule[] replaceArrayList = ReplaceRules.GenRules(new string[] {
|
Rule[] replaceArrayList = ReplaceRules.GenRules(new string[] {
|
||||||
config.ProjectConf.projectName == string.Empty ? "webgl" : config.ProjectConf.projectName,
|
config.ProjectConf.projectName == string.Empty ? "webgl" : config.ProjectConf.projectName,
|
||||||
config.ProjectConf.Appid,
|
config.ProjectConf.Appid,
|
||||||
@ -1288,7 +1368,6 @@ namespace WeChatWASM
|
|||||||
config.ProjectConf.texturesPath,
|
config.ProjectConf.texturesPath,
|
||||||
config.ProjectConf.needCacheTextures ? "true" : "false",
|
config.ProjectConf.needCacheTextures ? "true" : "false",
|
||||||
config.ProjectConf.loadingBarWidth.ToString(),
|
config.ProjectConf.loadingBarWidth.ToString(),
|
||||||
config.ProjectConf.needCheckUpdate ? "true" : "false",
|
|
||||||
GetColorSpace(),
|
GetColorSpace(),
|
||||||
config.ProjectConf.disableHighPerformanceFallback ? "true" : "false",
|
config.ProjectConf.disableHighPerformanceFallback ? "true" : "false",
|
||||||
config.SDKOptions.PreloadWXFont ? "true" : "false",
|
config.SDKOptions.PreloadWXFont ? "true" : "false",
|
||||||
@ -1322,6 +1401,7 @@ namespace WeChatWASM
|
|||||||
config.FontOptions.Geometric_Shapes ? "true" : "false",
|
config.FontOptions.Geometric_Shapes ? "true" : "false",
|
||||||
config.FontOptions.Mathematical_Operators ? "true" : "false",
|
config.FontOptions.Mathematical_Operators ? "true" : "false",
|
||||||
customUnicodeRange,
|
customUnicodeRange,
|
||||||
|
boolConfigInfo,
|
||||||
});
|
});
|
||||||
|
|
||||||
List<Rule> replaceList = new List<Rule>(replaceArrayList);
|
List<Rule> replaceList = new List<Rule>(replaceArrayList);
|
||||||
|
|||||||
@ -189,6 +189,7 @@ namespace WeChatWASM
|
|||||||
fbWin.minSize = new Vector2(680, 350);
|
fbWin.minSize = new Vector2(680, 350);
|
||||||
fbWin.Show();
|
fbWin.Show();
|
||||||
});
|
});
|
||||||
|
this.formCheckbox("autoAdaptScreen", "自适应屏幕尺寸(?)", "移动端旋转屏幕和PC端拉伸窗口时,自动调整画布尺寸");
|
||||||
this.formCheckbox("showMonitorSuggestModal", "显示优化建议弹窗");
|
this.formCheckbox("showMonitorSuggestModal", "显示优化建议弹窗");
|
||||||
this.formCheckbox("enableProfileStats", "显示性能面板");
|
this.formCheckbox("enableProfileStats", "显示性能面板");
|
||||||
this.formCheckbox("enableRenderAnalysis", "显示渲染日志(dev only)");
|
this.formCheckbox("enableRenderAnalysis", "显示渲染日志(dev only)");
|
||||||
@ -449,6 +450,7 @@ namespace WeChatWASM
|
|||||||
this.setData("loadingBarWidth", config.ProjectConf.loadingBarWidth.ToString());
|
this.setData("loadingBarWidth", config.ProjectConf.loadingBarWidth.ToString());
|
||||||
this.setData("needCheckUpdate", config.ProjectConf.needCheckUpdate);
|
this.setData("needCheckUpdate", config.ProjectConf.needCheckUpdate);
|
||||||
this.setData("disableHighPerformanceFallback", config.ProjectConf.disableHighPerformanceFallback);
|
this.setData("disableHighPerformanceFallback", config.ProjectConf.disableHighPerformanceFallback);
|
||||||
|
this.setData("autoAdaptScreen", config.CompileOptions.autoAdaptScreen);
|
||||||
this.setData("showMonitorSuggestModal", config.CompileOptions.showMonitorSuggestModal);
|
this.setData("showMonitorSuggestModal", config.CompileOptions.showMonitorSuggestModal);
|
||||||
this.setData("enableProfileStats", config.CompileOptions.enableProfileStats);
|
this.setData("enableProfileStats", config.CompileOptions.enableProfileStats);
|
||||||
this.setData("enableRenderAnalysis", config.CompileOptions.enableRenderAnalysis);
|
this.setData("enableRenderAnalysis", config.CompileOptions.enableRenderAnalysis);
|
||||||
@ -518,6 +520,7 @@ namespace WeChatWASM
|
|||||||
config.ProjectConf.loadingBarWidth = int.Parse(this.getDataInput("loadingBarWidth"));
|
config.ProjectConf.loadingBarWidth = int.Parse(this.getDataInput("loadingBarWidth"));
|
||||||
config.ProjectConf.needCheckUpdate = this.getDataCheckbox("needCheckUpdate");
|
config.ProjectConf.needCheckUpdate = this.getDataCheckbox("needCheckUpdate");
|
||||||
config.ProjectConf.disableHighPerformanceFallback = this.getDataCheckbox("disableHighPerformanceFallback");
|
config.ProjectConf.disableHighPerformanceFallback = this.getDataCheckbox("disableHighPerformanceFallback");
|
||||||
|
config.CompileOptions.autoAdaptScreen = this.getDataCheckbox("autoAdaptScreen");
|
||||||
config.CompileOptions.showMonitorSuggestModal = this.getDataCheckbox("showMonitorSuggestModal");
|
config.CompileOptions.showMonitorSuggestModal = this.getDataCheckbox("showMonitorSuggestModal");
|
||||||
config.CompileOptions.enableProfileStats = this.getDataCheckbox("enableProfileStats");
|
config.CompileOptions.enableProfileStats = this.getDataCheckbox("enableProfileStats");
|
||||||
config.CompileOptions.enableRenderAnalysis = this.getDataCheckbox("enableRenderAnalysis");
|
config.CompileOptions.enableRenderAnalysis = this.getDataCheckbox("enableRenderAnalysis");
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
{
|
{
|
||||||
public class WXPluginVersion
|
public class WXPluginVersion
|
||||||
{
|
{
|
||||||
public static string pluginVersion = "202407090855"; // 这一行不要改他,导出的时候会自动替换
|
public static string pluginVersion = "202408130719"; // 这一行不要改他,导出的时候会自动替换
|
||||||
}
|
}
|
||||||
|
|
||||||
public class WXPluginConf
|
public class WXPluginConf
|
||||||
|
|||||||
Binary file not shown.
@ -598,6 +598,11 @@
|
|||||||
CustomNodePath
|
CustomNodePath
|
||||||
</summary>
|
</summary>
|
||||||
</member>
|
</member>
|
||||||
|
<member name="F:WeChatWASM.CompileOptions.autoAdaptScreen">
|
||||||
|
<summary>
|
||||||
|
是否自适应屏幕尺寸变化
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
<member name="F:WeChatWASM.CompileOptions.showMonitorSuggestModal">
|
<member name="F:WeChatWASM.CompileOptions.showMonitorSuggestModal">
|
||||||
<summary>
|
<summary>
|
||||||
是否显示最佳实践检测弹框
|
是否显示最佳实践检测弹框
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
fileFormatVersion: 2
|
fileFormatVersion: 2
|
||||||
guid: c29a7ef69f21a4d3f98e8ae4e5c78c8c
|
guid: b30bbae6b56387c30e9c01eb8f1c6bc4
|
||||||
TextScriptImporter:
|
DefaultImporter:
|
||||||
externalObjects: {}
|
externalObjects: {}
|
||||||
userData:
|
userData:
|
||||||
assetBundleName:
|
assetBundleName:
|
||||||
|
|||||||
Binary file not shown.
@ -8200,6 +8200,11 @@
|
|||||||
分区 ID
|
分区 ID
|
||||||
</summary>
|
</summary>
|
||||||
</member>
|
</member>
|
||||||
|
<member name="F:WeChatWASM.RequestMidasPaymentOption.extraInfo">
|
||||||
|
<summary>
|
||||||
|
其他参数
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
<member name="F:WeChatWASM.MidasPaymentError.errMsg">
|
<member name="F:WeChatWASM.MidasPaymentError.errMsg">
|
||||||
<summary>
|
<summary>
|
||||||
错误信息
|
错误信息
|
||||||
@ -9726,6 +9731,11 @@
|
|||||||
用户态签名
|
用户态签名
|
||||||
</summary>
|
</summary>
|
||||||
</member>
|
</member>
|
||||||
|
<member name="F:WeChatWASM.RequestMidasPaymentGameItemOption.extraInfo">
|
||||||
|
<summary>
|
||||||
|
其他参数
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
<member name="F:WeChatWASM.RequestMidasPaymentGameItemOption.complete">
|
<member name="F:WeChatWASM.RequestMidasPaymentGameItemOption.complete">
|
||||||
<summary>
|
<summary>
|
||||||
接口调用结束的回调函数(调用成功、失败都会执行)
|
接口调用结束的回调函数(调用成功、失败都会执行)
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
fileFormatVersion: 2
|
fileFormatVersion: 2
|
||||||
guid: 229920fab178543bf84dadc7c49ba67f
|
guid: 6e0fe7d5455b6791c4d801acffd76f2c
|
||||||
TextScriptImporter:
|
DefaultImporter:
|
||||||
externalObjects: {}
|
externalObjects: {}
|
||||||
userData:
|
userData:
|
||||||
assetBundleName:
|
assetBundleName:
|
||||||
|
|||||||
Binary file not shown.
@ -8200,6 +8200,11 @@
|
|||||||
分区 ID
|
分区 ID
|
||||||
</summary>
|
</summary>
|
||||||
</member>
|
</member>
|
||||||
|
<member name="F:WeChatWASM.RequestMidasPaymentOption.extraInfo">
|
||||||
|
<summary>
|
||||||
|
其他参数
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
<member name="F:WeChatWASM.MidasPaymentError.errMsg">
|
<member name="F:WeChatWASM.MidasPaymentError.errMsg">
|
||||||
<summary>
|
<summary>
|
||||||
错误信息
|
错误信息
|
||||||
@ -9726,6 +9731,11 @@
|
|||||||
用户态签名
|
用户态签名
|
||||||
</summary>
|
</summary>
|
||||||
</member>
|
</member>
|
||||||
|
<member name="F:WeChatWASM.RequestMidasPaymentGameItemOption.extraInfo">
|
||||||
|
<summary>
|
||||||
|
其他参数
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
<member name="F:WeChatWASM.RequestMidasPaymentGameItemOption.complete">
|
<member name="F:WeChatWASM.RequestMidasPaymentGameItemOption.complete">
|
||||||
<summary>
|
<summary>
|
||||||
接口调用结束的回调函数(调用成功、失败都会执行)
|
接口调用结束的回调函数(调用成功、失败都会执行)
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
fileFormatVersion: 2
|
fileFormatVersion: 2
|
||||||
guid: 58f6f9f7425c24e2588bba8cb3973eb2
|
guid: 7778811782bbb2b02b542404a8d5067e
|
||||||
TextScriptImporter:
|
DefaultImporter:
|
||||||
externalObjects: {}
|
externalObjects: {}
|
||||||
userData:
|
userData:
|
||||||
assetBundleName:
|
assetBundleName:
|
||||||
|
|||||||
@ -106,6 +106,16 @@ if (isIOS && typeof $IOS_DEVICE_PIXEL_RATIO === 'number' && $IOS_DEVICE_PIXEL_RA
|
|||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
window.devicePixelRatio = $IOS_DEVICE_PIXEL_RATIO;
|
window.devicePixelRatio = $IOS_DEVICE_PIXEL_RATIO;
|
||||||
}
|
}
|
||||||
|
else if (isPc) {
|
||||||
|
try {
|
||||||
|
if (window.devicePixelRatio < 2) {
|
||||||
|
window.devicePixelRatio = 2;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (e) {
|
||||||
|
console.warn(e);
|
||||||
|
}
|
||||||
|
}
|
||||||
export default () => new Promise((resolve) => {
|
export default () => new Promise((resolve) => {
|
||||||
if (!isDevtools) {
|
if (!isDevtools) {
|
||||||
if (isPcInvalid
|
if (isPcInvalid
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
fileFormatVersion: 2
|
fileFormatVersion: 2
|
||||||
guid: ef1e05774b412733a889d665fe2a1e7f
|
guid: ec0866ffff83550534a97ed488594001
|
||||||
DefaultImporter:
|
DefaultImporter:
|
||||||
externalObjects: {}
|
externalObjects: {}
|
||||||
userData:
|
userData:
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
fileFormatVersion: 2
|
fileFormatVersion: 2
|
||||||
guid: f1e0c064017999785ab61a303b1ab9bf
|
guid: fff65068a8cb2a0fcaece97325e75772
|
||||||
DefaultImporter:
|
DefaultImporter:
|
||||||
externalObjects: {}
|
externalObjects: {}
|
||||||
userData:
|
userData:
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
fileFormatVersion: 2
|
fileFormatVersion: 2
|
||||||
guid: e3aadc5b1afc92786b01ffda7268f8fd
|
guid: 4c43c69948f021a90cea719225137540
|
||||||
DefaultImporter:
|
DefaultImporter:
|
||||||
externalObjects: {}
|
externalObjects: {}
|
||||||
userData:
|
userData:
|
||||||
|
|||||||
@ -1,41 +1,13 @@
|
|||||||
// @ts-nocheck
|
// @ts-nocheck
|
||||||
/* eslint-disable no-prototype-builtins */
|
|
||||||
/* eslint-disable no-unused-vars */
|
|
||||||
/* eslint-disable no-undef */
|
|
||||||
import './weapp-adapter';
|
import './weapp-adapter';
|
||||||
import './events';
|
import './events';
|
||||||
import 'texture-config.js';
|
import './texture-config';
|
||||||
import unityNamespace from './unity-namespace';
|
import unityNamespace from './unity-namespace';
|
||||||
import '.$DOTNET_RUNTIME_FOLD/$GAME_NAME.wasm.framework.unityweb';
|
import '.$DOTNET_RUNTIME_FOLD/$GAME_NAME.wasm.framework.unityweb';
|
||||||
import './unity-sdk/index.js';
|
import './unity-sdk/index';
|
||||||
import checkVersion from './check-version';
|
import checkVersion from './check-version';
|
||||||
import { launchEventType, scaleMode } from './plugin-config';
|
import { launchEventType, scaleMode } from './plugin-config';
|
||||||
import { preloadWxCommonFont } from './unity-sdk/font/index';
|
import { preloadWxCommonFont } from './unity-sdk/font/index';
|
||||||
function checkUpdate() {
|
|
||||||
const updateManager = wx.getUpdateManager();
|
|
||||||
updateManager.onCheckForUpdate(() => {
|
|
||||||
// 请求完新版本信息的回调
|
|
||||||
// console.log(res.hasUpdate)
|
|
||||||
});
|
|
||||||
updateManager.onUpdateReady(() => {
|
|
||||||
wx.showModal({
|
|
||||||
title: '更新提示',
|
|
||||||
content: '新版本已经准备好,是否重启应用?',
|
|
||||||
success(res) {
|
|
||||||
if (res.confirm) {
|
|
||||||
// 新的版本已经下载好,调用 applyUpdate 应用新版本并重启
|
|
||||||
updateManager.applyUpdate();
|
|
||||||
}
|
|
||||||
},
|
|
||||||
});
|
|
||||||
});
|
|
||||||
updateManager.onUpdateFailed(() => {
|
|
||||||
// 新版本下载失败
|
|
||||||
});
|
|
||||||
}
|
|
||||||
if ($NEED_CHECK_UPDATE) {
|
|
||||||
checkUpdate();
|
|
||||||
}
|
|
||||||
const managerConfig = {
|
const managerConfig = {
|
||||||
DATA_FILE_MD5: '$DATA_MD5',
|
DATA_FILE_MD5: '$DATA_MD5',
|
||||||
CODE_FILE_MD5: '$CODE_MD5',
|
CODE_FILE_MD5: '$CODE_MD5',
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
fileFormatVersion: 2
|
fileFormatVersion: 2
|
||||||
guid: d2e8bf463176e9978ecd0b82ddeeed2c
|
guid: 4e9c0a50391e9417b0a905a38fe4e7a4
|
||||||
DefaultImporter:
|
DefaultImporter:
|
||||||
externalObjects: {}
|
externalObjects: {}
|
||||||
userData:
|
userData:
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
fileFormatVersion: 2
|
fileFormatVersion: 2
|
||||||
guid: b12932d880a4639e2e38dd2029b833b3
|
guid: dbba4c0263b3cfbfa657f3aaba82d3f6
|
||||||
DefaultImporter:
|
DefaultImporter:
|
||||||
externalObjects: {}
|
externalObjects: {}
|
||||||
userData:
|
userData:
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
fileFormatVersion: 2
|
fileFormatVersion: 2
|
||||||
guid: c5d57a3019fcd9baa08adce3a8f3b3df
|
guid: 9a7e4d5b8324b8298fc67e8c32ed51cd
|
||||||
DefaultImporter:
|
DefaultImporter:
|
||||||
externalObjects: {}
|
externalObjects: {}
|
||||||
userData:
|
userData:
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
fileFormatVersion: 2
|
fileFormatVersion: 2
|
||||||
guid: f59a3250e317dff4c9e9dfee14b6d5ef
|
guid: 139388bac2416bdd9c125bc0cbfa8b40
|
||||||
DefaultImporter:
|
DefaultImporter:
|
||||||
externalObjects: {}
|
externalObjects: {}
|
||||||
userData:
|
userData:
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
fileFormatVersion: 2
|
fileFormatVersion: 2
|
||||||
guid: 25b2278361ff40cc8c2f1c588e247206
|
guid: 67a45c002afdf4d6b3a2b19efc5df095
|
||||||
DefaultImporter:
|
DefaultImporter:
|
||||||
externalObjects: {}
|
externalObjects: {}
|
||||||
userData:
|
userData:
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
fileFormatVersion: 2
|
fileFormatVersion: 2
|
||||||
guid: 54bc0baec6d9e4865afe1115290b3a04
|
guid: ac5ca57abd608430319bdcfcb3928d0a
|
||||||
DefaultImporter:
|
DefaultImporter:
|
||||||
externalObjects: {}
|
externalObjects: {}
|
||||||
userData:
|
userData:
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
fileFormatVersion: 2
|
fileFormatVersion: 2
|
||||||
guid: 9df2e9117c9824506c55dbe16032524f
|
guid: 822aad16f03f2cc8aff6ed76eb6c93cd
|
||||||
DefaultImporter:
|
DefaultImporter:
|
||||||
externalObjects: {}
|
externalObjects: {}
|
||||||
userData:
|
userData:
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
fileFormatVersion: 2
|
fileFormatVersion: 2
|
||||||
guid: f8ebd603489f43a3719b4ce8b85e6020
|
guid: 8f3e6be3b4bfaf1f90ce36d054449510
|
||||||
DefaultImporter:
|
DefaultImporter:
|
||||||
externalObjects: {}
|
externalObjects: {}
|
||||||
userData:
|
userData:
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
fileFormatVersion: 2
|
fileFormatVersion: 2
|
||||||
guid: 5ef0f4c12904864831c830490c7669e2
|
guid: e785b48b5c28dd75ca4750d66cbe9a1e
|
||||||
DefaultImporter:
|
DefaultImporter:
|
||||||
externalObjects: {}
|
externalObjects: {}
|
||||||
userData:
|
userData:
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
fileFormatVersion: 2
|
fileFormatVersion: 2
|
||||||
guid: 270e5285cd720d27c65310bc71ac06a5
|
guid: 0090feabbdfb7402b1038c2d49364c44
|
||||||
DefaultImporter:
|
DefaultImporter:
|
||||||
externalObjects: {}
|
externalObjects: {}
|
||||||
userData:
|
userData:
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
fileFormatVersion: 2
|
fileFormatVersion: 2
|
||||||
guid: 5e2cb9e7271c0fe8045f18be94df5305
|
guid: 2d8ba2e59af124aeea32144b04dabe3f
|
||||||
DefaultImporter:
|
DefaultImporter:
|
||||||
externalObjects: {}
|
externalObjects: {}
|
||||||
userData:
|
userData:
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
fileFormatVersion: 2
|
fileFormatVersion: 2
|
||||||
guid: 952547e88dfd81ebb71334f8045f0096
|
guid: e67652c317dd3371b249d69581e5a96d
|
||||||
DefaultImporter:
|
DefaultImporter:
|
||||||
externalObjects: {}
|
externalObjects: {}
|
||||||
userData:
|
userData:
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
fileFormatVersion: 2
|
fileFormatVersion: 2
|
||||||
guid: 99c588e770fbf36ec61e5ede6b5e79d0
|
guid: 7f77c13104f64ecd2744d127bc010d33
|
||||||
DefaultImporter:
|
DefaultImporter:
|
||||||
externalObjects: {}
|
externalObjects: {}
|
||||||
userData:
|
userData:
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
fileFormatVersion: 2
|
fileFormatVersion: 2
|
||||||
guid: 3d7560e20aa29667f1fbff12a3ddf653
|
guid: 1a6829574a4edc81d19aa53d4e69a5bf
|
||||||
DefaultImporter:
|
DefaultImporter:
|
||||||
externalObjects: {}
|
externalObjects: {}
|
||||||
userData:
|
userData:
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
fileFormatVersion: 2
|
fileFormatVersion: 2
|
||||||
guid: 978111221b303d88333534756fdb0faf
|
guid: d6d881ad79c7c488a1f639bab3f2d6c1
|
||||||
DefaultImporter:
|
DefaultImporter:
|
||||||
externalObjects: {}
|
externalObjects: {}
|
||||||
userData:
|
userData:
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
fileFormatVersion: 2
|
fileFormatVersion: 2
|
||||||
guid: 05f26105d156e58ca85e72a1fbfe4848
|
guid: bb49e265e57f97528505d890fee8a484
|
||||||
DefaultImporter:
|
DefaultImporter:
|
||||||
externalObjects: {}
|
externalObjects: {}
|
||||||
userData:
|
userData:
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
fileFormatVersion: 2
|
fileFormatVersion: 2
|
||||||
guid: ea131b33657841c7fd108d04cb3f6378
|
guid: 767eaf55c07047dd8bc1245fed636e2b
|
||||||
DefaultImporter:
|
DefaultImporter:
|
||||||
externalObjects: {}
|
externalObjects: {}
|
||||||
userData:
|
userData:
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
fileFormatVersion: 2
|
fileFormatVersion: 2
|
||||||
guid: 3c6387c3f8edc113fdfb050df73111db
|
guid: 26c690e29270f0013ff360c367d7dc60
|
||||||
DefaultImporter:
|
DefaultImporter:
|
||||||
externalObjects: {}
|
externalObjects: {}
|
||||||
userData:
|
userData:
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
fileFormatVersion: 2
|
fileFormatVersion: 2
|
||||||
guid: f82ce62a9a39759dd82c32576cb948c6
|
guid: 8c038276fd34326aa23dfbce9bbfe12f
|
||||||
DefaultImporter:
|
DefaultImporter:
|
||||||
externalObjects: {}
|
externalObjects: {}
|
||||||
userData:
|
userData:
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
fileFormatVersion: 2
|
fileFormatVersion: 2
|
||||||
guid: df27f41ea72568476ae114439699ff1e
|
guid: 18d7df3ca95ecaa1c26450207b6f911a
|
||||||
DefaultImporter:
|
DefaultImporter:
|
||||||
externalObjects: {}
|
externalObjects: {}
|
||||||
userData:
|
userData:
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
fileFormatVersion: 2
|
fileFormatVersion: 2
|
||||||
guid: 7bebdf36fcef92da9351c4b2791367c2
|
guid: 2a4135f2feb5cf0b600aab9192df1a92
|
||||||
DefaultImporter:
|
DefaultImporter:
|
||||||
externalObjects: {}
|
externalObjects: {}
|
||||||
userData:
|
userData:
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
fileFormatVersion: 2
|
fileFormatVersion: 2
|
||||||
guid: 65eed8270a046d1377d0317834b884f0
|
guid: 1cf87b79222b89625405206c42404457
|
||||||
DefaultImporter:
|
DefaultImporter:
|
||||||
externalObjects: {}
|
externalObjects: {}
|
||||||
userData:
|
userData:
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
fileFormatVersion: 2
|
fileFormatVersion: 2
|
||||||
guid: bddc28bb29db8d87b73f947745cbbf4d
|
guid: 88f55401ef5d3eacdddad9dbe25922f8
|
||||||
DefaultImporter:
|
DefaultImporter:
|
||||||
externalObjects: {}
|
externalObjects: {}
|
||||||
userData:
|
userData:
|
||||||
|
|||||||
23
Runtime/wechat-default/plugins/check-update.js
Normal file
23
Runtime/wechat-default/plugins/check-update.js
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
function checkUpdate() {
|
||||||
|
const updateManager = wx.getUpdateManager();
|
||||||
|
updateManager.onCheckForUpdate(() => {
|
||||||
|
// 请求完新版本信息的回调
|
||||||
|
// console.log(res.hasUpdate)
|
||||||
|
});
|
||||||
|
updateManager.onUpdateReady(() => {
|
||||||
|
wx.showModal({
|
||||||
|
title: '更新提示',
|
||||||
|
content: '新版本已经准备好,是否重启应用?',
|
||||||
|
success(res) {
|
||||||
|
if (res.confirm) {
|
||||||
|
// 新的版本已经下载好,调用 applyUpdate 应用新版本并重启
|
||||||
|
updateManager.applyUpdate();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
});
|
||||||
|
});
|
||||||
|
updateManager.onUpdateFailed(() => {
|
||||||
|
// 新版本下载失败
|
||||||
|
});
|
||||||
|
}
|
||||||
|
checkUpdate();
|
||||||
7
Runtime/wechat-default/plugins/check-update.js.meta
Normal file
7
Runtime/wechat-default/plugins/check-update.js.meta
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: ff2c7a9bd8dc0307e3db42e910e50f19
|
||||||
|
DefaultImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
9
Runtime/wechat-default/plugins/screen-adapter.js
Normal file
9
Runtime/wechat-default/plugins/screen-adapter.js
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
wx.onWindowResize((res) => {
|
||||||
|
window.innerWidth = res.windowWidth;
|
||||||
|
window.innerHeight = res.windowHeight;
|
||||||
|
});
|
||||||
|
wx.onDeviceOrientationChange(() => {
|
||||||
|
const info = wx.getWindowInfo ? wx.getWindowInfo() : wx.getSystemInfoSync();
|
||||||
|
window.innerWidth = info.screenWidth;
|
||||||
|
window.innerHeight = info.screenHeight;
|
||||||
|
});
|
||||||
7
Runtime/wechat-default/plugins/screen-adapter.js.meta
Normal file
7
Runtime/wechat-default/plugins/screen-adapter.js.meta
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: b62746af426016b452af3752e1de4e14
|
||||||
|
DefaultImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
@ -33,7 +33,7 @@
|
|||||||
"packNpmRelationList": []
|
"packNpmRelationList": []
|
||||||
},
|
},
|
||||||
"compileType": "game",
|
"compileType": "game",
|
||||||
"libVersion": "3.2.5",
|
"libVersion": "3.5.1",
|
||||||
"appid": "$APP_ID",
|
"appid": "$APP_ID",
|
||||||
"projectname": "$PROJECT_NAME",
|
"projectname": "$PROJECT_NAME",
|
||||||
"simulatorType": "wechat",
|
"simulatorType": "wechat",
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
fileFormatVersion: 2
|
fileFormatVersion: 2
|
||||||
guid: ff83841af267b7c1ac9265dbff653414
|
guid: f3139808756e282e4c0cb02e3b35576b
|
||||||
DefaultImporter:
|
DefaultImporter:
|
||||||
externalObjects: {}
|
externalObjects: {}
|
||||||
userData:
|
userData:
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
fileFormatVersion: 2
|
fileFormatVersion: 2
|
||||||
guid: 41d5fe449fa202e94f320aaaa5534373
|
guid: 780ad9065e8d46c54a20c30223d73a33
|
||||||
DefaultImporter:
|
DefaultImporter:
|
||||||
externalObjects: {}
|
externalObjects: {}
|
||||||
userData:
|
userData:
|
||||||
|
|||||||
@ -51,6 +51,8 @@ const unityNamespace = {
|
|||||||
useDotnetRuntime: $USE_DOTNET_RUNTIME,
|
useDotnetRuntime: $USE_DOTNET_RUNTIME,
|
||||||
// 是否用了多线程brotli压缩
|
// 是否用了多线程brotli压缩
|
||||||
useBrotliMT: $USE_BROTLI_MT,
|
useBrotliMT: $USE_BROTLI_MT,
|
||||||
|
// Boot config配置,包含例如wait-for-native-debugger、player-connection-ip等信息
|
||||||
|
bootConfig: '$BOOT_CONFIG_INFO',
|
||||||
};
|
};
|
||||||
// 最佳实践检测配置
|
// 最佳实践检测配置
|
||||||
unityNamespace.monitorConfig = {
|
unityNamespace.monitorConfig = {
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
fileFormatVersion: 2
|
fileFormatVersion: 2
|
||||||
guid: 0c1b5f8f4f2ebaf26a64486efb12b5c2
|
guid: b4597c91b97c9f7fded2df0352ea56fb
|
||||||
DefaultImporter:
|
DefaultImporter:
|
||||||
externalObjects: {}
|
externalObjects: {}
|
||||||
userData:
|
userData:
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
fileFormatVersion: 2
|
fileFormatVersion: 2
|
||||||
guid: d6234c76e3da63550189a594744521c7
|
guid: b82a90b1fe901491e223529c5b95f4e5
|
||||||
DefaultImporter:
|
DefaultImporter:
|
||||||
externalObjects: {}
|
externalObjects: {}
|
||||||
userData:
|
userData:
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
fileFormatVersion: 2
|
fileFormatVersion: 2
|
||||||
guid: e19a5df2519a8f3e0316df4a5ad50f35
|
guid: a2a4e3bfd84f239d311e539eee194b78
|
||||||
DefaultImporter:
|
DefaultImporter:
|
||||||
externalObjects: {}
|
externalObjects: {}
|
||||||
userData:
|
userData:
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
fileFormatVersion: 2
|
fileFormatVersion: 2
|
||||||
guid: 0c0af3e59778cb19bd5f681910a80b39
|
guid: f91414089c098abca04a7f781dab2587
|
||||||
DefaultImporter:
|
DefaultImporter:
|
||||||
externalObjects: {}
|
externalObjects: {}
|
||||||
userData:
|
userData:
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
fileFormatVersion: 2
|
fileFormatVersion: 2
|
||||||
guid: 5a663dfab9a0254bb34b5518b6e1b1b2
|
guid: 482037e18c7ff696ad24da8e86bb9f70
|
||||||
DefaultImporter:
|
DefaultImporter:
|
||||||
externalObjects: {}
|
externalObjects: {}
|
||||||
userData:
|
userData:
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
fileFormatVersion: 2
|
fileFormatVersion: 2
|
||||||
guid: ff33b5ab6f7d8defab1e6e2a379de8d3
|
guid: 032b63ca2f3d057eae02bfb3ae42b56d
|
||||||
DefaultImporter:
|
DefaultImporter:
|
||||||
externalObjects: {}
|
externalObjects: {}
|
||||||
userData:
|
userData:
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
fileFormatVersion: 2
|
fileFormatVersion: 2
|
||||||
guid: 6875bb1305b63e68ff1c5ef071e67648
|
guid: c60c3dcf3becf03a44b452976ea56675
|
||||||
DefaultImporter:
|
DefaultImporter:
|
||||||
externalObjects: {}
|
externalObjects: {}
|
||||||
userData:
|
userData:
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
fileFormatVersion: 2
|
fileFormatVersion: 2
|
||||||
guid: 52c5044bebe9d29e1372c94ee55096f0
|
guid: 4bb8f2bc78dff5c2c3828484e8061fda
|
||||||
DefaultImporter:
|
DefaultImporter:
|
||||||
externalObjects: {}
|
externalObjects: {}
|
||||||
userData:
|
userData:
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
fileFormatVersion: 2
|
fileFormatVersion: 2
|
||||||
guid: 5ff433e1c227f4c43ff31879fb4fcea0
|
guid: 23d040392e73b91536f53eef6eecc2b7
|
||||||
DefaultImporter:
|
DefaultImporter:
|
||||||
externalObjects: {}
|
externalObjects: {}
|
||||||
userData:
|
userData:
|
||||||
|
|||||||
@ -16,7 +16,7 @@ function jsAudioCreateUncompressedSoundClip(buffer, error, length) {
|
|||||||
},
|
},
|
||||||
getLength() {
|
getLength() {
|
||||||
if (!this.buffer) {
|
if (!this.buffer) {
|
||||||
console.log('Trying to get length of sound which is not loaded.');
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
const sampleRateRatio = 44100 / this.buffer.sampleRate;
|
const sampleRateRatio = 44100 / this.buffer.sampleRate;
|
||||||
@ -157,6 +157,7 @@ export class AudioChannelInstance {
|
|||||||
loopStart = 0;
|
loopStart = 0;
|
||||||
loopEnd = 0;
|
loopEnd = 0;
|
||||||
deleyTime = 0;
|
deleyTime = 0;
|
||||||
|
deleyOffset = 0;
|
||||||
constructor(callback, userData) {
|
constructor(callback, userData) {
|
||||||
if (WEBAudio.audioContext) {
|
if (WEBAudio.audioContext) {
|
||||||
this.gain = WEBAudio.audioContext.createGain();
|
this.gain = WEBAudio.audioContext.createGain();
|
||||||
@ -292,6 +293,7 @@ export class AudioChannelInstance {
|
|||||||
this.source.mediaElement.onCanplay(fn);
|
this.source.mediaElement.onCanplay(fn);
|
||||||
this.source.mediaElement.loop = this.loop;
|
this.source.mediaElement.loop = this.loop;
|
||||||
this.deleyTime = startTime;
|
this.deleyTime = startTime;
|
||||||
|
this.deleyOffset = startOffset;
|
||||||
this.source.start(startTime, startOffset);
|
this.source.start(startTime, startOffset);
|
||||||
this.source.playbackStartTime = startTime - startOffset / this.source.playbackRateValue;
|
this.source.playbackStartTime = startTime - startOffset / this.source.playbackRateValue;
|
||||||
}
|
}
|
||||||
@ -426,8 +428,9 @@ export class AudioChannelInstance {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (this.source.mediaElement) {
|
if (this.source.mediaElement) {
|
||||||
this.source.start(this.deleyTime);
|
this.source.start(this.deleyTime, this.deleyOffset);
|
||||||
delete this.deleyTime;
|
delete this.deleyTime;
|
||||||
|
delete this.deleyOffset;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
const pausedSource = this.source;
|
const pausedSource = this.source;
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
fileFormatVersion: 2
|
fileFormatVersion: 2
|
||||||
guid: a0ed3d76b35ec064690eac5bd6392934
|
guid: 89699662ceb95db59a5a098c2ff63f9f
|
||||||
DefaultImporter:
|
DefaultImporter:
|
||||||
externalObjects: {}
|
externalObjects: {}
|
||||||
userData:
|
userData:
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
fileFormatVersion: 2
|
fileFormatVersion: 2
|
||||||
guid: 8fd89a583d0c3722daef35746a4c490c
|
guid: e2476f6f9a4c94a27bd2178f4a507ee6
|
||||||
DefaultImporter:
|
DefaultImporter:
|
||||||
externalObjects: {}
|
externalObjects: {}
|
||||||
userData:
|
userData:
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
fileFormatVersion: 2
|
fileFormatVersion: 2
|
||||||
guid: 7e34ae191c36201bfa651ba9d61c92e8
|
guid: 4f9312fa76de85868e34d2367c24c1a2
|
||||||
DefaultImporter:
|
DefaultImporter:
|
||||||
externalObjects: {}
|
externalObjects: {}
|
||||||
userData:
|
userData:
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
fileFormatVersion: 2
|
fileFormatVersion: 2
|
||||||
guid: 3cc69f207ffe533fb1dd21f5b392cc73
|
guid: 8290ff59b40ed2f343c5accae58ba367
|
||||||
DefaultImporter:
|
DefaultImporter:
|
||||||
externalObjects: {}
|
externalObjects: {}
|
||||||
userData:
|
userData:
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
fileFormatVersion: 2
|
fileFormatVersion: 2
|
||||||
guid: 048dce3511a995c3ec8b05e825854abd
|
guid: 35226d5ce1f1b47f5e7570c6c4f6d31e
|
||||||
DefaultImporter:
|
DefaultImporter:
|
||||||
externalObjects: {}
|
externalObjects: {}
|
||||||
userData:
|
userData:
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
fileFormatVersion: 2
|
fileFormatVersion: 2
|
||||||
guid: 474d26287484fca66d4be3177a4ba764
|
guid: 4482b82c4ce275f0afda4b7f9f981ba0
|
||||||
DefaultImporter:
|
DefaultImporter:
|
||||||
externalObjects: {}
|
externalObjects: {}
|
||||||
userData:
|
userData:
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
fileFormatVersion: 2
|
fileFormatVersion: 2
|
||||||
guid: 7b4c5581af30639a14d8af49919871c2
|
guid: a8e1a8000529385d0c11d2278ae5fa0b
|
||||||
DefaultImporter:
|
DefaultImporter:
|
||||||
externalObjects: {}
|
externalObjects: {}
|
||||||
userData:
|
userData:
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
fileFormatVersion: 2
|
fileFormatVersion: 2
|
||||||
guid: d9326af94c682af91644b67086f0d3f0
|
guid: d417fb70586cf0964a0a0c8288603213
|
||||||
DefaultImporter:
|
DefaultImporter:
|
||||||
externalObjects: {}
|
externalObjects: {}
|
||||||
userData:
|
userData:
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
fileFormatVersion: 2
|
fileFormatVersion: 2
|
||||||
guid: c286ed9a8c5afe3d53d29594b1302ab6
|
guid: 7756de5e38476121913cedc1af7de6e2
|
||||||
DefaultImporter:
|
DefaultImporter:
|
||||||
externalObjects: {}
|
externalObjects: {}
|
||||||
userData:
|
userData:
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
fileFormatVersion: 2
|
fileFormatVersion: 2
|
||||||
guid: 8610febb4006de328d42233330bf20a8
|
guid: bea163bf1096d68983607fcbb580cfff
|
||||||
DefaultImporter:
|
DefaultImporter:
|
||||||
externalObjects: {}
|
externalObjects: {}
|
||||||
userData:
|
userData:
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
fileFormatVersion: 2
|
fileFormatVersion: 2
|
||||||
guid: 70a500cddb8fbacd1f31c00961a3f578
|
guid: 0d37b75d5b23e62e3796dd44ba480751
|
||||||
DefaultImporter:
|
DefaultImporter:
|
||||||
externalObjects: {}
|
externalObjects: {}
|
||||||
userData:
|
userData:
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
fileFormatVersion: 2
|
fileFormatVersion: 2
|
||||||
guid: bd3b09e41050f8ed146ce307c7ccfd40
|
guid: 81193fc853faff828207c667c43932fb
|
||||||
DefaultImporter:
|
DefaultImporter:
|
||||||
externalObjects: {}
|
externalObjects: {}
|
||||||
userData:
|
userData:
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
fileFormatVersion: 2
|
fileFormatVersion: 2
|
||||||
guid: 916b0449cd9060e6d054d5ad3828330a
|
guid: 7c3746722f427b907df1bfabaa8090bc
|
||||||
DefaultImporter:
|
DefaultImporter:
|
||||||
externalObjects: {}
|
externalObjects: {}
|
||||||
userData:
|
userData:
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
fileFormatVersion: 2
|
fileFormatVersion: 2
|
||||||
guid: d3912a68d8b848831b119018390b60b8
|
guid: e0fed3da0a1e3da34d7196c9827cd24e
|
||||||
DefaultImporter:
|
DefaultImporter:
|
||||||
externalObjects: {}
|
externalObjects: {}
|
||||||
userData:
|
userData:
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
fileFormatVersion: 2
|
fileFormatVersion: 2
|
||||||
guid: c708723af593ab14bb881e5316a0ff40
|
guid: b623046ac9bb1b98865a5e875d417523
|
||||||
DefaultImporter:
|
DefaultImporter:
|
||||||
externalObjects: {}
|
externalObjects: {}
|
||||||
userData:
|
userData:
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
fileFormatVersion: 2
|
fileFormatVersion: 2
|
||||||
guid: 29996be1d858a84fdb0d5c3f3e834693
|
guid: ab60ebea6b96120967bc0f508b4f7e92
|
||||||
DefaultImporter:
|
DefaultImporter:
|
||||||
externalObjects: {}
|
externalObjects: {}
|
||||||
userData:
|
userData:
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
fileFormatVersion: 2
|
fileFormatVersion: 2
|
||||||
guid: f7043b95c5a326d4da423b3fb59b32d8
|
guid: 1f0c909b1f71ead9f9b5dce6fe59ff4f
|
||||||
DefaultImporter:
|
DefaultImporter:
|
||||||
externalObjects: {}
|
externalObjects: {}
|
||||||
userData:
|
userData:
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
fileFormatVersion: 2
|
fileFormatVersion: 2
|
||||||
guid: 2a51bb7c7f15449fac0dc9bedd289c6d
|
guid: 2c6b226268cd8cc08ae625a16ca6657d
|
||||||
DefaultImporter:
|
DefaultImporter:
|
||||||
externalObjects: {}
|
externalObjects: {}
|
||||||
userData:
|
userData:
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
fileFormatVersion: 2
|
fileFormatVersion: 2
|
||||||
guid: 6e3a6dc48d3bf4a038ea6ff49aefc620
|
guid: 00f79fe8e05d7c35df8e01714f644b6a
|
||||||
DefaultImporter:
|
DefaultImporter:
|
||||||
externalObjects: {}
|
externalObjects: {}
|
||||||
userData:
|
userData:
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
fileFormatVersion: 2
|
fileFormatVersion: 2
|
||||||
guid: 60635ffb7b8c9b6b0e5c741463b2d3b6
|
guid: e599ae5ffd44cf66c835f151f0d6f525
|
||||||
DefaultImporter:
|
DefaultImporter:
|
||||||
externalObjects: {}
|
externalObjects: {}
|
||||||
userData:
|
userData:
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
fileFormatVersion: 2
|
fileFormatVersion: 2
|
||||||
guid: cdd65501cbf1aae76a23408d9c0c3c2d
|
guid: 750cb6c90d5bba81dc6951dc2acc3343
|
||||||
DefaultImporter:
|
DefaultImporter:
|
||||||
externalObjects: {}
|
externalObjects: {}
|
||||||
userData:
|
userData:
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
fileFormatVersion: 2
|
fileFormatVersion: 2
|
||||||
guid: 0361edb442abba14478c4071497df4f6
|
guid: 2603c04cfef21d653fba3506f2d02337
|
||||||
DefaultImporter:
|
DefaultImporter:
|
||||||
externalObjects: {}
|
externalObjects: {}
|
||||||
userData:
|
userData:
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
fileFormatVersion: 2
|
fileFormatVersion: 2
|
||||||
guid: 6026a42438747bd9fc13130cfee5aefc
|
guid: 0d8579b4f1206596d7c6d813a30b9a9a
|
||||||
DefaultImporter:
|
DefaultImporter:
|
||||||
externalObjects: {}
|
externalObjects: {}
|
||||||
userData:
|
userData:
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
fileFormatVersion: 2
|
fileFormatVersion: 2
|
||||||
guid: ee00e7218296806dced2b0583058ed84
|
guid: 41877fbdf2033be7ffb6316dc14ff48d
|
||||||
DefaultImporter:
|
DefaultImporter:
|
||||||
externalObjects: {}
|
externalObjects: {}
|
||||||
userData:
|
userData:
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
fileFormatVersion: 2
|
fileFormatVersion: 2
|
||||||
guid: 313a43b01b2c92c3f22f0951abbe30fb
|
guid: 760a6e7336c024d477254ca8bab5a8e3
|
||||||
DefaultImporter:
|
DefaultImporter:
|
||||||
externalObjects: {}
|
externalObjects: {}
|
||||||
userData:
|
userData:
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
fileFormatVersion: 2
|
fileFormatVersion: 2
|
||||||
guid: 75ce46f306e8b61b1c331096c0e2ff38
|
guid: 4c38faac6860be324af6ecbd453f5ed4
|
||||||
DefaultImporter:
|
DefaultImporter:
|
||||||
externalObjects: {}
|
externalObjects: {}
|
||||||
userData:
|
userData:
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
fileFormatVersion: 2
|
fileFormatVersion: 2
|
||||||
guid: eb155f6c5b430d27e5531ae8aed32cd9
|
guid: 295f3b8c536e85017490e183832aea17
|
||||||
DefaultImporter:
|
DefaultImporter:
|
||||||
externalObjects: {}
|
externalObjects: {}
|
||||||
userData:
|
userData:
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
fileFormatVersion: 2
|
fileFormatVersion: 2
|
||||||
guid: 8a8e1c92cbbd05376929664303f8c81d
|
guid: 26a3ad56079cdb62abca33a8496de95e
|
||||||
DefaultImporter:
|
DefaultImporter:
|
||||||
externalObjects: {}
|
externalObjects: {}
|
||||||
userData:
|
userData:
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
fileFormatVersion: 2
|
fileFormatVersion: 2
|
||||||
guid: 1624a43ad63a6f3f6612d7240cca767d
|
guid: 05a13f7c0071e4e20904fa7c4e29efdb
|
||||||
DefaultImporter:
|
DefaultImporter:
|
||||||
externalObjects: {}
|
externalObjects: {}
|
||||||
userData:
|
userData:
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
fileFormatVersion: 2
|
fileFormatVersion: 2
|
||||||
guid: 727d001b99acea03fb7a1ad7838b7d4a
|
guid: 61f7fae5a7a1265899d9bf633032cf24
|
||||||
DefaultImporter:
|
DefaultImporter:
|
||||||
externalObjects: {}
|
externalObjects: {}
|
||||||
userData:
|
userData:
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
fileFormatVersion: 2
|
fileFormatVersion: 2
|
||||||
guid: 07107145bb96bb65d83959e91308bf4c
|
guid: bec5c579b585f0209e42a59cb336f6e3
|
||||||
DefaultImporter:
|
DefaultImporter:
|
||||||
externalObjects: {}
|
externalObjects: {}
|
||||||
userData:
|
userData:
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
fileFormatVersion: 2
|
fileFormatVersion: 2
|
||||||
guid: ce748c50d77531fabda542f383f1b810
|
guid: 569d4521115fd975031aa15f4088f245
|
||||||
DefaultImporter:
|
DefaultImporter:
|
||||||
externalObjects: {}
|
externalObjects: {}
|
||||||
userData:
|
userData:
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
fileFormatVersion: 2
|
fileFormatVersion: 2
|
||||||
guid: ca56775df93651e3865b2fcc0f3c7ca7
|
guid: 65dd406a591aa089de338d82864c6bfc
|
||||||
DefaultImporter:
|
DefaultImporter:
|
||||||
externalObjects: {}
|
externalObjects: {}
|
||||||
userData:
|
userData:
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
fileFormatVersion: 2
|
fileFormatVersion: 2
|
||||||
guid: d776fbd7b720a70b3e6db35c6d9a959c
|
guid: 455f16dd478afbe75a28ec7228211c1e
|
||||||
DefaultImporter:
|
DefaultImporter:
|
||||||
externalObjects: {}
|
externalObjects: {}
|
||||||
userData:
|
userData:
|
||||||
|
|||||||
@ -6,7 +6,7 @@ let wxOnTouchStartCallback;
|
|||||||
function handleTouchEvent(res, callback) {
|
function handleTouchEvent(res, callback) {
|
||||||
const dataPtr = convertOnTouchStartListenerResultToPointer({
|
const dataPtr = convertOnTouchStartListenerResultToPointer({
|
||||||
touches: res.touches.map(v => formatTouchEvent(v, res.type)),
|
touches: res.touches.map(v => formatTouchEvent(v, res.type)),
|
||||||
changedTouches: res.changedTouches.map(v => formatTouchEvent(v, res.type)),
|
changedTouches: res.changedTouches.map(v => formatTouchEvent(v, res.type, 1)),
|
||||||
timeStamp: parseInt(res.timeStamp.toString(), 10),
|
timeStamp: parseInt(res.timeStamp.toString(), 10),
|
||||||
});
|
});
|
||||||
GameGlobal.Module.dynCall_viii(callback, dataPtr, res.touches.length, res.changedTouches.length);
|
GameGlobal.Module.dynCall_viii(callback, dataPtr, res.touches.length, res.changedTouches.length);
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
fileFormatVersion: 2
|
fileFormatVersion: 2
|
||||||
guid: 3d18e551a93d8a46a9aabb23b002e0af
|
guid: 9a8ff8cd09a3a8c45bd92f8b882ade4b
|
||||||
DefaultImporter:
|
DefaultImporter:
|
||||||
externalObjects: {}
|
externalObjects: {}
|
||||||
userData:
|
userData:
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
fileFormatVersion: 2
|
fileFormatVersion: 2
|
||||||
guid: c85f7ab7471c36deec7ad0f034324dd3
|
guid: c725eb8541e693c9181c10800170da9d
|
||||||
DefaultImporter:
|
DefaultImporter:
|
||||||
externalObjects: {}
|
externalObjects: {}
|
||||||
userData:
|
userData:
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
fileFormatVersion: 2
|
fileFormatVersion: 2
|
||||||
guid: c41c7a4aef98e941c9fdf0f5bc32b43a
|
guid: cfe6971a4fd2d591bc15b5688d942a13
|
||||||
DefaultImporter:
|
DefaultImporter:
|
||||||
externalObjects: {}
|
externalObjects: {}
|
||||||
userData:
|
userData:
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
fileFormatVersion: 2
|
fileFormatVersion: 2
|
||||||
guid: 639b9f3533adb6d485e67cd47c1afd85
|
guid: 945bfc0566e291be37956bbb002ad06f
|
||||||
DefaultImporter:
|
DefaultImporter:
|
||||||
externalObjects: {}
|
externalObjects: {}
|
||||||
userData:
|
userData:
|
||||||
|
|||||||
@ -31,9 +31,10 @@ const interfaceTypeMap = {
|
|||||||
object: 'object',
|
object: 'object',
|
||||||
};
|
};
|
||||||
export const uid = () => realUid(20, true);
|
export const uid = () => realUid(20, true);
|
||||||
export function formatIdentifier(identifier, eventType) {
|
export function formatIdentifier(identifier, eventType, changed) {
|
||||||
if (clearIdTicker[identifier]) {
|
if (changed && clearIdTicker[identifier]) {
|
||||||
clearTimeout(clearIdTicker[identifier]);
|
clearTimeout(clearIdTicker[identifier]);
|
||||||
|
delete clearIdTicker[identifier];
|
||||||
}
|
}
|
||||||
let id = identifierCache.indexOf(identifier);
|
let id = identifierCache.indexOf(identifier);
|
||||||
if (id <= -1) {
|
if (id <= -1) {
|
||||||
@ -49,7 +50,7 @@ export function formatIdentifier(identifier, eventType) {
|
|||||||
identifierCache.push(identifier);
|
identifierCache.push(identifier);
|
||||||
id = identifierCache.length - 1;
|
id = identifierCache.length - 1;
|
||||||
}
|
}
|
||||||
if (eventType === 'touchend' || eventType === 'touchcancel') {
|
if (changed && (eventType === 'touchend' || eventType === 'touchcancel')) {
|
||||||
clearIdTicker[identifier] = setTimeout(() => {
|
clearIdTicker[identifier] = setTimeout(() => {
|
||||||
identifierCache[id] = null;
|
identifierCache[id] = null;
|
||||||
delete clearIdTicker[identifier];
|
delete clearIdTicker[identifier];
|
||||||
@ -57,12 +58,12 @@ export function formatIdentifier(identifier, eventType) {
|
|||||||
}
|
}
|
||||||
return id;
|
return id;
|
||||||
}
|
}
|
||||||
export function formatTouchEvent(v, type) {
|
export function formatTouchEvent(v, type, changed) {
|
||||||
return {
|
return {
|
||||||
clientX: v.clientX * window.devicePixelRatio,
|
clientX: v.clientX * window.devicePixelRatio,
|
||||||
clientY: (window.innerHeight - v.clientY) * window.devicePixelRatio,
|
clientY: (window.innerHeight - v.clientY) * window.devicePixelRatio,
|
||||||
force: v.force,
|
force: v.force,
|
||||||
identifier: formatIdentifier(v.identifier, type),
|
identifier: formatIdentifier(v.identifier, type, changed),
|
||||||
pageX: v.pageX * window.devicePixelRatio,
|
pageX: v.pageX * window.devicePixelRatio,
|
||||||
pageY: (window.innerHeight - v.pageY) * window.devicePixelRatio,
|
pageY: (window.innerHeight - v.pageY) * window.devicePixelRatio,
|
||||||
};
|
};
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
fileFormatVersion: 2
|
fileFormatVersion: 2
|
||||||
guid: 50f25d1bf930a4138ee02b546a0a13a1
|
guid: e6efaa2251c24a414d2452c14b0043fc
|
||||||
DefaultImporter:
|
DefaultImporter:
|
||||||
externalObjects: {}
|
externalObjects: {}
|
||||||
userData:
|
userData:
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
fileFormatVersion: 2
|
fileFormatVersion: 2
|
||||||
guid: 91056eef69ebecd3bf93114483cbe303
|
guid: 8ebc42cef7902e0b535a087372f30745
|
||||||
DefaultImporter:
|
DefaultImporter:
|
||||||
externalObjects: {}
|
externalObjects: {}
|
||||||
userData:
|
userData:
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user