mirror of
https://github.com/wechat-miniprogram/minigame-tuanjie-transform-sdk.git
synced 2026-04-22 01:35:56 +08:00
Auto-publish.
This commit is contained in:
parent
45e7581c92
commit
9c0db26b4a
@ -6,13 +6,7 @@ Removed - 删除功能/接口
|
||||
Fixed - 修复问题
|
||||
Others - 其他
|
||||
-->
|
||||
## v0.1.27 【普通更新】
|
||||
### Feature
|
||||
* 普通:新增 JS_Sound_GetPosition 方法用于获取音频播放位置
|
||||
* 普通:WebGL2变更为正式特性
|
||||
* 普通:支持小游戏试玩导出
|
||||
|
||||
## v0.1.26 【普通更新】
|
||||
## v0.1.26 【预发布】
|
||||
### Feature
|
||||
* 普通:增加禁止多点触控的配置
|
||||
### Fixed
|
||||
|
||||
8
Editor/BuildProfile.meta
Normal file
8
Editor/BuildProfile.meta
Normal file
@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: DytLvSj8UC9CKob0XUy9Y3usKDmX8US1YgxYmBxa1iAZ/I8JbM5wZwE=
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
8
Editor/BuildProfile/lib.meta
Normal file
8
Editor/BuildProfile/lib.meta
Normal file
@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: XSwesi78AS28ymfR2HEhHpEBAC2DHupI1hIKP7HApjHRaZgGw+DTwWI=
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
BIN
Editor/BuildProfile/lib/libwx-metal-cpp.bc
Normal file
BIN
Editor/BuildProfile/lib/libwx-metal-cpp.bc
Normal file
Binary file not shown.
7
Editor/BuildProfile/lib/libwx-metal-cpp.bc.meta
Normal file
7
Editor/BuildProfile/lib/libwx-metal-cpp.bc.meta
Normal file
@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: c113acfee35db6b5c61fd4a76596cfd3
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
38
Editor/BuildProfile/lib/mtl_library.jslib
Normal file
38
Editor/BuildProfile/lib/mtl_library.jslib
Normal file
@ -0,0 +1,38 @@
|
||||
mergeInto(LibraryManager.library, {
|
||||
// 定义供 C/C++ 调用的 JS 函数
|
||||
js_batchRender_malloc: function(data, size, isSync) {
|
||||
// 直接从 WASM 内存创建视图(零拷贝)
|
||||
const targetBuffer = new Uint8Array(Module.HEAPU8.buffer, data, size);
|
||||
//console.log("processBinaryData invoke");
|
||||
const extBuffer = new ArrayBuffer(1);
|
||||
|
||||
if(!isSync){
|
||||
mtl.batchRenderAsync(targetBuffer, extBuffer);
|
||||
return null;
|
||||
}
|
||||
const response = mtl.batchRender(targetBuffer, extBuffer);
|
||||
if (!response) {
|
||||
return null;
|
||||
}
|
||||
const result = response.buffer;
|
||||
if(!result || result.byteLength == 0){
|
||||
return null;
|
||||
}
|
||||
// 申请内存空间,后续在cpp wasm部分使用,记得释放
|
||||
const ptr = Module._malloc(result.byteLength);
|
||||
// 将数据拷贝到WASM内存
|
||||
Module.HEAPU8.set(new Uint8Array(result), ptr);
|
||||
// 返回结构化的数据信息(指针和长度)
|
||||
const ret = new DataView(new ArrayBuffer(8));
|
||||
ret.setUint32(0, ptr, true); // 指针地址(4字节)
|
||||
ret.setUint32(4, result.byteLength, true); // 数据长度(4字节)
|
||||
// 返回合并后的8字节缓冲区指针,记得也要在cpp部分释放
|
||||
const retPtr = Module._malloc(8);
|
||||
Module.HEAPU8.set(new Uint8Array(ret.buffer), retPtr);
|
||||
return retPtr;
|
||||
|
||||
},
|
||||
js_swapWindow: function(){
|
||||
mtl.swapWindow();
|
||||
}
|
||||
});
|
||||
7
Editor/BuildProfile/lib/mtl_library.jslib.meta
Normal file
7
Editor/BuildProfile/lib/mtl_library.jslib.meta
Normal file
@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: dda1926f3454e003333e8085a4f2c0fd
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@ -17,8 +17,6 @@ namespace WeChatWASM
|
||||
public static string projectRootPath;
|
||||
private static WXPlayableEditorScriptObject config;
|
||||
private static bool m_EnablePerfTool = false;
|
||||
|
||||
private static string _dstCache;
|
||||
public static bool UseIL2CPP
|
||||
{
|
||||
get
|
||||
@ -34,7 +32,6 @@ namespace WeChatWASM
|
||||
public WXPlayableSettingsHelper()
|
||||
{
|
||||
projectRootPath = System.IO.Path.GetFullPath(Application.dataPath + "/../");
|
||||
_dstCache = "";
|
||||
}
|
||||
|
||||
public void OnFocus()
|
||||
@ -156,12 +153,11 @@ namespace WeChatWASM
|
||||
{
|
||||
SDKFilePath = Path.Combine(UnityUtil.GetWxSDKRootPath(), "Runtime", "wechat-playable-default", "unity-sdk", "index.js");
|
||||
config = UnityUtil.GetPlayableEditorConf();
|
||||
_dstCache = config.ProjectConf.DST;
|
||||
|
||||
this.setData("projectName", config.ProjectConf.projectName);
|
||||
this.setData("appid", config.ProjectConf.Appid);
|
||||
this.setData("orientation", (int)config.ProjectConf.Orientation);
|
||||
this.setData("dst", _dstCache);
|
||||
this.setData("dst", config.ProjectConf.relativeDST);
|
||||
|
||||
this.setData("developBuild", config.CompileOptions.DevelopBuild);
|
||||
this.setData("il2CppOptimizeSize", config.CompileOptions.Il2CppOptimizeSize);
|
||||
@ -177,8 +173,8 @@ namespace WeChatWASM
|
||||
config.ProjectConf.projectName = this.getDataInput("projectName");
|
||||
config.ProjectConf.Appid = this.getDataInput("appid");
|
||||
config.ProjectConf.Orientation = (WXScreenOritation)this.getDataPop("orientation");
|
||||
_dstCache = this.getDataInput("dst");
|
||||
config.ProjectConf.DST = GetAbsolutePath(_dstCache);
|
||||
config.ProjectConf.relativeDST = this.getDataInput("dst");
|
||||
config.ProjectConf.DST = GetAbsolutePath(config.ProjectConf.relativeDST);
|
||||
|
||||
config.CompileOptions.DevelopBuild = this.getDataCheckbox("developBuild");
|
||||
config.CompileOptions.Il2CppOptimizeSize = this.getDataCheckbox("il2CppOptimizeSize");
|
||||
|
||||
@ -99,6 +99,22 @@ namespace WeChatWASM
|
||||
#endif
|
||||
}
|
||||
}
|
||||
// 是否使用 iOS Metal 渲染
|
||||
public static bool UseiOSMetal
|
||||
{
|
||||
get
|
||||
{
|
||||
return config.CompileOptions.enableiOSMetal;
|
||||
}
|
||||
}
|
||||
// 用于replaceRules判断是否需要注入相关的修改
|
||||
public static bool UseEmscriptenGLX
|
||||
{
|
||||
get
|
||||
{
|
||||
return config.CompileOptions.enableEmscriptenGLX;
|
||||
}
|
||||
}
|
||||
// public static void SetPlayableEnabled(bool enabled)
|
||||
// {
|
||||
// isPlayableBuild = enabled;
|
||||
@ -112,9 +128,14 @@ namespace WeChatWASM
|
||||
CheckBuildTarget();
|
||||
Init();
|
||||
// 可能有顺序要求?如果没要求,可挪到此函数外
|
||||
if (!isPlayableBuild) {
|
||||
if (!isPlayableBuild)
|
||||
{
|
||||
ProcessWxPerfBinaries();
|
||||
}
|
||||
// iOS metal 的相关特性
|
||||
ProcessWxiOSMetalBinaries();
|
||||
// emscriptenglx的相关特性
|
||||
ProcessWxEmscriptenGLXBinaries();
|
||||
MakeEnvForLuaAdaptor();
|
||||
// JSLib
|
||||
SettingWXTextureMinJSLib();
|
||||
@ -140,7 +161,7 @@ namespace WeChatWASM
|
||||
return WXExportError.BUILD_WEBGL_FAILED;
|
||||
}
|
||||
dynamic config = isPlayableBuild ? UnityUtil.GetPlayableEditorConf() : UnityUtil.GetEditorConf();
|
||||
if (config.ProjectConf.DST == string.Empty)
|
||||
if (config.ProjectConf.relativeDST == string.Empty)
|
||||
{
|
||||
Debug.LogError("请先配置游戏导出路径");
|
||||
return WXExportError.BUILD_WEBGL_FAILED;
|
||||
@ -360,6 +381,39 @@ namespace WeChatWASM
|
||||
AssetDatabase.Refresh();
|
||||
}
|
||||
|
||||
private static void ProcessWxEmscriptenGLXBinaries()
|
||||
{
|
||||
string[] glLibs;
|
||||
string DS = WXAssetsTextTools.DS;
|
||||
if (UnityUtil.GetSDKMode() == UnityUtil.SDKMode.Package)
|
||||
{
|
||||
glLibs = new string[]
|
||||
{
|
||||
$"Packages{DS}com.qq.weixin.minigame{DS}Runtime{DS}Plugins{DS}libemscriptenglx.a",
|
||||
};
|
||||
}
|
||||
else
|
||||
{
|
||||
string glLibRootDir = $"Assets{DS}WX-WASM-SDK-V2{DS}Runtime{DS}Plugins{DS}";
|
||||
glLibs = new string[]
|
||||
{
|
||||
$"{glLibRootDir}libemscriptenglx.a",
|
||||
};
|
||||
}
|
||||
for (int i = 0; i < glLibs.Length; i++)
|
||||
{
|
||||
var importer = AssetImporter.GetAtPath(glLibs[i]) as PluginImporter;
|
||||
#if PLATFORM_WEIXINMINIGAME
|
||||
importer.SetCompatibleWithPlatform(BuildTarget.WeixinMiniGame, config.CompileOptions.enableEmscriptenGLX);
|
||||
#else
|
||||
importer.SetCompatibleWithPlatform(BuildTarget.WebGL, config.CompileOptions.enableEmscriptenGLX);
|
||||
#endif
|
||||
// importer.SaveAndReimport();
|
||||
SetPluginCompatibilityByModifyingMetadataFile(glLibs[i], config.CompileOptions.enableEmscriptenGLX);
|
||||
}
|
||||
AssetDatabase.Refresh();
|
||||
}
|
||||
|
||||
/**
|
||||
* Lua Adaptor Settings.
|
||||
*/
|
||||
@ -400,6 +454,41 @@ namespace WeChatWASM
|
||||
return true;
|
||||
}
|
||||
|
||||
private static void ProcessWxiOSMetalBinaries()
|
||||
{
|
||||
string[] glLibs;
|
||||
string DS = WXAssetsTextTools.DS;
|
||||
if (UnityUtil.GetSDKMode() == UnityUtil.SDKMode.Package)
|
||||
{
|
||||
glLibs = new string[]
|
||||
{
|
||||
$"Packages{DS}com.qq.weixin.minigame{DS}Editor{DS}BuildProfile{DS}lib{DS}libwx-metal-cpp.bc",
|
||||
$"Packages{DS}com.qq.weixin.minigame{DS}Editor{DS}BuildProfile{DS}lib{DS}mtl_library.jslib",
|
||||
};
|
||||
}
|
||||
else
|
||||
{
|
||||
string glLibRootDir = $"Assets{DS}WX-WASM-SDK-V2{DS}Editor{DS}BuildProfile{DS}lib{DS}";
|
||||
glLibs = new string[]
|
||||
{
|
||||
$"{glLibRootDir}libwx-metal-cpp.bc",
|
||||
$"{glLibRootDir}mtl_library.jslib",
|
||||
};
|
||||
}
|
||||
for (int i = 0; i < glLibs.Length; i++)
|
||||
{
|
||||
var importer = AssetImporter.GetAtPath(glLibs[i]) as PluginImporter;
|
||||
#if PLATFORM_WEIXINMINIGAME
|
||||
importer.SetCompatibleWithPlatform(BuildTarget.WeixinMiniGame, config.CompileOptions.enableiOSMetal);
|
||||
#else
|
||||
importer.SetCompatibleWithPlatform(BuildTarget.WebGL, config.CompileOptions.enableiOSMetal);
|
||||
#endif
|
||||
// importer.SaveAndReimport();
|
||||
SetPluginCompatibilityByModifyingMetadataFile(glLibs[i], config.CompileOptions.enableiOSMetal);
|
||||
}
|
||||
AssetDatabase.Refresh();
|
||||
}
|
||||
|
||||
private static string GetLuaAdaptorPath(string filename)
|
||||
{
|
||||
string DS = WXAssetsTextTools.DS;
|
||||
@ -523,6 +612,20 @@ namespace WeChatWASM
|
||||
GraphicsDeviceType[] targets = new GraphicsDeviceType[] { };
|
||||
#if PLATFORM_WEIXINMINIGAME
|
||||
PlayerSettings.SetUseDefaultGraphicsAPIs(BuildTarget.WeixinMiniGame, false);
|
||||
// 启用 iOS Metal 渲染
|
||||
if (UseiOSMetal)
|
||||
{
|
||||
if (config.CompileOptions.Webgl2)
|
||||
{
|
||||
PlayerSettings.SetGraphicsAPIs(BuildTarget.WeixinMiniGame, new GraphicsDeviceType[] { GraphicsDeviceType.Metal, GraphicsDeviceType.OpenGLES3 });
|
||||
}
|
||||
else
|
||||
{
|
||||
PlayerSettings.SetGraphicsAPIs(BuildTarget.WeixinMiniGame, new GraphicsDeviceType[] { GraphicsDeviceType.Metal, GraphicsDeviceType.OpenGLES2 });
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (config.CompileOptions.Webgl2)
|
||||
{
|
||||
PlayerSettings.SetGraphicsAPIs(BuildTarget.WeixinMiniGame, new GraphicsDeviceType[] { GraphicsDeviceType.OpenGLES3 });
|
||||
@ -531,6 +634,7 @@ namespace WeChatWASM
|
||||
{
|
||||
PlayerSettings.SetGraphicsAPIs(BuildTarget.WeixinMiniGame, new GraphicsDeviceType[] { GraphicsDeviceType.OpenGLES2 });
|
||||
}
|
||||
}
|
||||
#else
|
||||
PlayerSettings.SetUseDefaultGraphicsAPIs(BuildTarget.WebGL, false);
|
||||
if (config.CompileOptions.Webgl2)
|
||||
@ -1194,7 +1298,8 @@ namespace WeChatWASM
|
||||
|
||||
public static void convertDataPackageJS()
|
||||
{
|
||||
if (!isPlayableBuild) {
|
||||
if (!isPlayableBuild)
|
||||
{
|
||||
checkNeedRmovePackageParallelPreload();
|
||||
}
|
||||
|
||||
@ -1649,7 +1754,8 @@ namespace WeChatWASM
|
||||
content = content.Replace("$unityVersion$", Application.unityVersion);
|
||||
File.WriteAllText(Path.Combine(dst, "unity-sdk", "index.js"), content, Encoding.UTF8);
|
||||
// content = File.ReadAllText(Path.Combine(Application.dataPath, "WX-WASM-SDK-V2", "Runtime", "wechat-default", "unity-sdk", "storage.js"), Encoding.UTF8);
|
||||
if (!isPlayableBuild) {
|
||||
if (!isPlayableBuild)
|
||||
{
|
||||
content = File.ReadAllText(Path.Combine(UnityUtil.GetWxSDKRootPath(), "Runtime", defaultTemplateDir, "unity-sdk", "storage.js"), Encoding.UTF8);
|
||||
var PreLoadKeys = config.PlayerPrefsKeys.Count > 0 ? JsonMapper.ToJson(config.PlayerPrefsKeys) : "[]";
|
||||
content = content.Replace("'$PreLoadKeys'", PreLoadKeys);
|
||||
@ -1951,11 +2057,16 @@ namespace WeChatWASM
|
||||
config.CompileOptions.enablePerfAnalysis ? "true" : "false",
|
||||
config.ProjectConf.MemorySize.ToString(),
|
||||
config.SDKOptions.disableMultiTouch ? "true" : "false",
|
||||
// Perfstream,暂时设为false
|
||||
"false",
|
||||
config.CompileOptions.enableEmscriptenGLX ? "true" : "false",
|
||||
config.CompileOptions.enableiOSMetal ? "true" : "false"
|
||||
});
|
||||
|
||||
List<Rule> replaceList = new List<Rule>(replaceArrayList);
|
||||
List<string> files = new List<string> { "game.js", "game.json", "project.config.json", "unity-namespace.js", "check-version.js", "unity-sdk/font/index.js" };
|
||||
if (isPlayableBuild) {
|
||||
if (isPlayableBuild)
|
||||
{
|
||||
files = new List<string> { "game.js", "game.json", "project.config.json", "unity-namespace.js", "check-version.js" };
|
||||
}
|
||||
|
||||
|
||||
@ -54,15 +54,11 @@ namespace WeChatWASM
|
||||
foldInstantGame = WXConvertCore.IsInstantGameAutoStreaming();
|
||||
|
||||
projectRootPath = System.IO.Path.GetFullPath(Application.dataPath + "/../");
|
||||
|
||||
_dstCache = "";
|
||||
}
|
||||
|
||||
private static WXEditorScriptObject config;
|
||||
private static bool m_EnablePerfTool = false;
|
||||
|
||||
private static string _dstCache;
|
||||
|
||||
public void OnFocus()
|
||||
{
|
||||
loadData();
|
||||
@ -187,8 +183,10 @@ namespace WeChatWASM
|
||||
this.formCheckbox("il2CppOptimizeSize", "Il2Cpp Optimize Size(?)", "对应于Il2CppCodeGeneration选项,勾选时使用OptimizeSize(默认推荐),生成代码小15%左右,取消勾选则使用OptimizeSpeed。游戏中大量泛型集合的高频访问建议OptimizeSpeed,在使用HybridCLR等第三方组件时只能用OptimizeSpeed。(Dotnet Runtime模式下该选项无效)", !UseIL2CPP);
|
||||
this.formCheckbox("profilingFuncs", "Profiling Funcs");
|
||||
this.formCheckbox("profilingMemory", "Profiling Memory");
|
||||
this.formCheckbox("webgl2", "WebGL2.0");
|
||||
this.formCheckbox("webgl2", "WebGL2.0(beta)");
|
||||
this.formCheckbox("iOSPerformancePlus", "iOSPerformancePlus(?)", "是否使用iOS高性能+渲染方案,有助于提升渲染兼容性、降低WebContent进程内存");
|
||||
this.formCheckbox("EmscriptenGLX", "EmscriptenGLX(?)", "是否使用EmscriptenGLX渲染方案");
|
||||
this.formCheckbox("iOSMetal", "iOSMetal(?)", "是否使用iOSMetal渲染方案,需要开启iOS高性能+模式,有助于提升运行性能,降低iOS功耗");
|
||||
this.formCheckbox("deleteStreamingAssets", "Clear Streaming Assets");
|
||||
this.formCheckbox("cleanBuild", "Clean WebGL Build");
|
||||
// this.formCheckbox("cleanCloudDev", "Clean Cloud Dev");
|
||||
@ -394,7 +392,6 @@ 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");
|
||||
config = UnityUtil.GetEditorConf();
|
||||
_dstCache = config.ProjectConf.DST;
|
||||
|
||||
// Instant Game
|
||||
if (WXConvertCore.IsInstantGameAutoStreaming())
|
||||
@ -436,7 +433,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", _dstCache);
|
||||
this.setData("dst", config.ProjectConf.relativeDST);
|
||||
this.setData("bundleHashLength", config.ProjectConf.bundleHashLength.ToString());
|
||||
this.setData("bundlePathIdentifier", config.ProjectConf.bundlePathIdentifier);
|
||||
this.setData("bundleExcludeExtensions", config.ProjectConf.bundleExcludeExtensions);
|
||||
@ -452,6 +449,8 @@ namespace WeChatWASM
|
||||
this.setData("customNodePath", config.CompileOptions.CustomNodePath);
|
||||
this.setData("webgl2", config.CompileOptions.Webgl2);
|
||||
this.setData("iOSPerformancePlus", config.CompileOptions.enableIOSPerformancePlus);
|
||||
this.setData("iOSMetal", config.CompileOptions.enableiOSMetal);
|
||||
this.setData("EmscriptenGLX", config.CompileOptions.enableEmscriptenGLX);
|
||||
this.setData("fbslim", config.CompileOptions.fbslim);
|
||||
this.setData("useFriendRelation", config.SDKOptions.UseFriendRelation);
|
||||
this.setData("useMiniGameChat", config.SDKOptions.UseMiniGameChat);
|
||||
@ -513,8 +512,8 @@ namespace WeChatWASM
|
||||
config.ProjectConf.compressDataPackage = this.getDataCheckbox("compressDataPackage");
|
||||
config.ProjectConf.VideoUrl = this.getDataInput("videoUrl");
|
||||
config.ProjectConf.Orientation = (WXScreenOritation)this.getDataPop("orientation");
|
||||
_dstCache = this.getDataInput("dst");
|
||||
config.ProjectConf.DST = GetAbsolutePath(_dstCache);
|
||||
config.ProjectConf.relativeDST = this.getDataInput("dst");
|
||||
config.ProjectConf.DST = GetAbsolutePath(config.ProjectConf.relativeDST);
|
||||
config.ProjectConf.bundleHashLength = int.Parse(this.getDataInput("bundleHashLength"));
|
||||
config.ProjectConf.bundlePathIdentifier = this.getDataInput("bundlePathIdentifier");
|
||||
config.ProjectConf.bundleExcludeExtensions = this.getDataInput("bundleExcludeExtensions");
|
||||
@ -530,6 +529,8 @@ namespace WeChatWASM
|
||||
config.CompileOptions.CustomNodePath = this.getDataInput("customNodePath");
|
||||
config.CompileOptions.Webgl2 = this.getDataCheckbox("webgl2");
|
||||
config.CompileOptions.enableIOSPerformancePlus = this.getDataCheckbox("iOSPerformancePlus");
|
||||
config.CompileOptions.enableiOSMetal = this.getDataCheckbox("iOSMetal");
|
||||
config.CompileOptions.enableEmscriptenGLX = this.getDataCheckbox("EmscriptenGLX");
|
||||
config.CompileOptions.fbslim = this.getDataCheckbox("fbslim");
|
||||
config.SDKOptions.UseFriendRelation = this.getDataCheckbox("useFriendRelation");
|
||||
config.SDKOptions.UseMiniGameChat = this.getDataCheckbox("useMiniGameChat");
|
||||
|
||||
@ -125,6 +125,14 @@ namespace WeChatWASM
|
||||
{
|
||||
return WXConvertCore.UseIL2CPP;
|
||||
});
|
||||
WXExtEnvDef.RegisterAction("WXConvertCore.UseiOSMetal", (args) =>
|
||||
{
|
||||
return WXConvertCore.UseiOSMetal;
|
||||
});
|
||||
WXExtEnvDef.RegisterAction("WXConvertCore.UseEmscriptenGLX", (args) =>
|
||||
{
|
||||
return WXConvertCore.UseEmscriptenGLX;
|
||||
});
|
||||
WXExtEnvDef.RegisterAction("UnityUtil.GetWxSDKRootPath", (args) =>
|
||||
{
|
||||
#if UNITY_2018
|
||||
|
||||
@ -2,7 +2,7 @@ namespace WeChatWASM
|
||||
{
|
||||
public class WXPluginVersion
|
||||
{
|
||||
public static string pluginVersion = "202507230322"; // 这一行不要改他,导出的时候会自动替换
|
||||
public static string pluginVersion = "202508071217"; // 这一行不要改他,导出的时候会自动替换
|
||||
}
|
||||
|
||||
public class WXPluginConf
|
||||
|
||||
Binary file not shown.
@ -381,6 +381,11 @@
|
||||
视频url
|
||||
</summary>
|
||||
</member>
|
||||
<member name="F:WeChatWASM.WXProjectConf.relativeDST">
|
||||
<summary>
|
||||
导出路径(相对路径)
|
||||
</summary>
|
||||
</member>
|
||||
<member name="F:WeChatWASM.WXProjectConf.DST">
|
||||
<summary>
|
||||
导出路径(绝对路径)
|
||||
@ -643,6 +648,12 @@
|
||||
是否使用iOS高性能Plus
|
||||
</summary>
|
||||
</member>
|
||||
<member name="F:WeChatWASM.CompileOptions.enableiOSMetal">
|
||||
<summary>
|
||||
是否使用iOS metal指令流
|
||||
</summary>
|
||||
</member>
|
||||
<!-- Badly formed XML comment ignored for member "F:WeChatWASM.CompileOptions.enableEmscriptenGLX" -->
|
||||
<member name="F:WeChatWASM.CompileOptions.brotliMT">
|
||||
<summary>
|
||||
是否使用brotli多线程压缩
|
||||
@ -773,6 +784,11 @@
|
||||
试玩 appid
|
||||
</summary>
|
||||
</member>
|
||||
<member name="F:WeChatWASM.WXPlayableProjectConf.relativeDST">
|
||||
<summary>
|
||||
导出路径(相对路径)
|
||||
</summary>
|
||||
</member>
|
||||
<member name="F:WeChatWASM.WXPlayableProjectConf.DST">
|
||||
<summary>
|
||||
导出路径(绝对路径)
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 4a90389cebd5db8b1ab58b0a3ca5cdc8
|
||||
guid: 0ed14bc9e72d2f21a3e63b9be8744223
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
|
||||
@ -115,8 +115,8 @@ WX_SyncFunction_tnn: function(functionName, returnType, param1, param2){
|
||||
stringToUTF8((res || ''), buffer, bufferSize);
|
||||
return buffer;
|
||||
},
|
||||
WX_ClassOneWayFunction:function(functionName, returnType, successType, failType, completeType, conf) {
|
||||
var res = window.WXWASMSDK.WX_ClassOneWayFunction(_WXPointer_stringify_adaptor(functionName), _WXPointer_stringify_adaptor(returnType), _WXPointer_stringify_adaptor(successType), _WXPointer_stringify_adaptor(failType), _WXPointer_stringify_adaptor(completeType), _WXPointer_stringify_adaptor(conf));
|
||||
WX_ClassConstructor:function(functionName, returnType, successType, failType, completeType, conf) {
|
||||
var res = window.WXWASMSDK.WX_ClassConstructor(_WXPointer_stringify_adaptor(functionName), _WXPointer_stringify_adaptor(returnType), _WXPointer_stringify_adaptor(successType), _WXPointer_stringify_adaptor(failType), _WXPointer_stringify_adaptor(completeType), _WXPointer_stringify_adaptor(conf));
|
||||
var bufferSize = lengthBytesUTF8(res || '') + 1;
|
||||
var buffer = _malloc(bufferSize);
|
||||
stringToUTF8((res || ''), buffer, bufferSize);
|
||||
@ -156,5 +156,7 @@ WX_ClassOneWayNoFunction_vt: function(className, functionName, id, param1) {
|
||||
},
|
||||
WX_ClassOneWayNoFunction_vn: function(className, functionName, id, param1) {
|
||||
window.WXWASMSDK.WX_ClassOneWayNoFunction_vs(_WXPointer_stringify_adaptor(className), _WXPointer_stringify_adaptor(functionName), _WXPointer_stringify_adaptor(id), param1);
|
||||
},WX_ClassOneWayFunction: function(className, id, functionName, successType, failType, completeType, conf, callbackId, usePromise) {
|
||||
window.WXWASMSDK.WX_ClassOneWayFunction(_WXPointer_stringify_adaptor(className), _WXPointer_stringify_adaptor(id), _WXPointer_stringify_adaptor(functionName), _WXPointer_stringify_adaptor(successType), _WXPointer_stringify_adaptor(failType), _WXPointer_stringify_adaptor(completeType), _WXPointer_stringify_adaptor(conf), _WXPointer_stringify_adaptor(callbackId), usePromise);
|
||||
},
|
||||
})
|
||||
55
Runtime/Plugins/WxGameDataMonitor.jslib
Normal file
55
Runtime/Plugins/WxGameDataMonitor.jslib
Normal file
@ -0,0 +1,55 @@
|
||||
mergeInto(LibraryManager.library, {
|
||||
JSStartGameDataMonitor: function() {
|
||||
console.log("call JSStartGameDataMonitor \n");
|
||||
|
||||
if (typeof GameGlobal.manager.getGameDataMonitor === 'function')
|
||||
{
|
||||
GameGlobal.manager.getGameDataMonitor().start();
|
||||
}
|
||||
else
|
||||
{
|
||||
console.log("GameGlobal.manager.getGameDataMonitor is not a function \n");
|
||||
}
|
||||
},
|
||||
JSReportUnityProfileData: function(
|
||||
targetFrameRate, // fps.
|
||||
monoHeapReserved, monoHeapUsed, nativeReserved, nativeUnused, nativeAllocated, // profiler.
|
||||
setPassCalls, drawCalls, vertices, trianglesCount // render.
|
||||
) {
|
||||
console.log("call JSReportUnityProfileData \n");
|
||||
let report_data = {
|
||||
timestamp: new Date().getTime(),
|
||||
fps: {
|
||||
targetFrameRate: targetFrameRate,
|
||||
avgEXFrameTime: _WXGetEXFrameTime(),
|
||||
},
|
||||
profiler: {
|
||||
monoHeapReserved: monoHeapReserved,
|
||||
monoHeapUsed: monoHeapUsed,
|
||||
nativeReserved: nativeReserved,
|
||||
nativeUnused: nativeUnused,
|
||||
nativeAllocated: nativeAllocated,
|
||||
},
|
||||
render: {
|
||||
setPassCalls: setPassCalls,
|
||||
drawCalls: drawCalls,
|
||||
vertices: vertices,
|
||||
trianglesCount: trianglesCount,
|
||||
},
|
||||
webassembly: {
|
||||
totalHeapMemory: _WXGetTotalMemorySize(),
|
||||
dynamicMemory: _WXGetDynamicMemorySize(),
|
||||
usedHeapMemory: _WXGetUsedMemorySize(),
|
||||
unAllocatedMemory: _WXGetUnAllocatedMemorySize(),
|
||||
},
|
||||
assetbundle: {
|
||||
numberInMemory: _WXGetBundleNumberInMemory(),
|
||||
numberOnDisk: _WXGetBundleNumberOnDisk(),
|
||||
sizeInMemory: _WXGetBundleSizeInMemory(),
|
||||
sizeOnDisk: _WXGetBundleSizeOnDisk(),
|
||||
}
|
||||
}
|
||||
|
||||
GameGlobal.manager.getGameDataMonitor().reportUnityProfileData(report_data)
|
||||
},
|
||||
});
|
||||
79
Runtime/Plugins/WxGameDataMonitor.jslib.meta
Normal file
79
Runtime/Plugins/WxGameDataMonitor.jslib.meta
Normal file
@ -0,0 +1,79 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 63a9d4fa9c3846e3704029822b94973f
|
||||
PluginImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
iconMap: {}
|
||||
executionOrder: {}
|
||||
defineConstraints: []
|
||||
isPreloaded: 0
|
||||
isOverridable: 0
|
||||
isExplicitlyReferenced: 0
|
||||
validateReferences: 1
|
||||
platformData:
|
||||
- first:
|
||||
: Any
|
||||
second:
|
||||
enabled: 0
|
||||
settings:
|
||||
Exclude Editor: 1
|
||||
Exclude Linux64: 1
|
||||
Exclude OSXUniversal: 1
|
||||
Exclude WeixinMiniGame: 1
|
||||
Exclude Win: 1
|
||||
Exclude Win64: 1
|
||||
- first:
|
||||
Any:
|
||||
second:
|
||||
enabled: 0
|
||||
settings: {}
|
||||
- first:
|
||||
Editor: Editor
|
||||
second:
|
||||
enabled: 0
|
||||
settings:
|
||||
CPU: AnyCPU
|
||||
DefaultValueInitialized: true
|
||||
OS: AnyOS
|
||||
- first:
|
||||
Facebook: WebGL
|
||||
second:
|
||||
enabled: 0
|
||||
settings: {}
|
||||
- first:
|
||||
Standalone: Linux64
|
||||
second:
|
||||
enabled: 0
|
||||
settings:
|
||||
CPU: AnyCPU
|
||||
- first:
|
||||
Standalone: OSXUniversal
|
||||
second:
|
||||
enabled: 0
|
||||
settings:
|
||||
CPU: None
|
||||
- first:
|
||||
Standalone: Win
|
||||
second:
|
||||
enabled: 0
|
||||
settings:
|
||||
CPU: x86
|
||||
- first:
|
||||
Standalone: Win64
|
||||
second:
|
||||
enabled: 0
|
||||
settings:
|
||||
CPU: x86_64
|
||||
- first:
|
||||
WebGL: WebGL
|
||||
second:
|
||||
enabled: 1
|
||||
settings: {}
|
||||
- first:
|
||||
WeixinMiniGame: WeixinMiniGame
|
||||
second:
|
||||
enabled: 1
|
||||
settings: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
BIN
Runtime/Plugins/libemscriptenglx.a
Normal file
BIN
Runtime/Plugins/libemscriptenglx.a
Normal file
Binary file not shown.
69
Runtime/Plugins/libemscriptenglx.a.meta
Normal file
69
Runtime/Plugins/libemscriptenglx.a.meta
Normal file
@ -0,0 +1,69 @@
|
||||
fileFormatVersion: 2
|
||||
guid: cccbd1d680cfe34fa1fef9e4875e5f23
|
||||
PluginImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
iconMap: {}
|
||||
executionOrder: {}
|
||||
defineConstraints: []
|
||||
isPreloaded: 0
|
||||
isOverridable: 1
|
||||
isExplicitlyReferenced: 0
|
||||
validateReferences: 1
|
||||
platformData:
|
||||
- first:
|
||||
: Any
|
||||
second:
|
||||
enabled: 0
|
||||
settings:
|
||||
Exclude Editor: 0
|
||||
Exclude Linux64: 0
|
||||
Exclude OSXUniversal: 0
|
||||
Exclude WeixinMiniGame: 0
|
||||
Exclude Win: 0
|
||||
Exclude Win64: 0
|
||||
- first:
|
||||
Any:
|
||||
second:
|
||||
enabled: 0
|
||||
settings: {}
|
||||
- first:
|
||||
Editor: Editor
|
||||
second:
|
||||
enabled: 1
|
||||
settings:
|
||||
CPU: AnyCPU
|
||||
DefaultValueInitialized: true
|
||||
OS: AnyOS
|
||||
- first:
|
||||
Standalone: Linux64
|
||||
second:
|
||||
enabled: 1
|
||||
settings:
|
||||
CPU: AnyCPU
|
||||
- first:
|
||||
Standalone: OSXUniversal
|
||||
second:
|
||||
enabled: 1
|
||||
settings:
|
||||
CPU: AnyCPU
|
||||
- first:
|
||||
Standalone: Win
|
||||
second:
|
||||
enabled: 1
|
||||
settings:
|
||||
CPU: AnyCPU
|
||||
- first:
|
||||
Standalone: Win64
|
||||
second:
|
||||
enabled: 1
|
||||
settings:
|
||||
CPU: AnyCPU
|
||||
- first:
|
||||
WeixinMiniGame: WeixinMiniGame
|
||||
second:
|
||||
enabled: 1
|
||||
settings: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Binary file not shown.
Binary file not shown.
@ -1699,26 +1699,6 @@
|
||||
如果返回的是字符串,则数据在这个字段
|
||||
</summary>
|
||||
</member>
|
||||
<member name="F:WeChatWASM.WXStatInfo.mode">
|
||||
<summary>
|
||||
文件的类型和存取的权限,对应 POSIX stat.st_mode
|
||||
</summary>
|
||||
</member>
|
||||
<member name="F:WeChatWASM.WXStatInfo.size">
|
||||
<summary>
|
||||
文件大小,单位:B,对应 POSIX stat.st_size
|
||||
</summary>
|
||||
</member>
|
||||
<member name="F:WeChatWASM.WXStatInfo.lastAccessedTime">
|
||||
<summary>
|
||||
文件最近一次被存取或被执行的时间,UNIX 时间戳,对应 POSIX stat.st_atime
|
||||
</summary>
|
||||
</member>
|
||||
<member name="F:WeChatWASM.WXStatInfo.lastModifiedTime">
|
||||
<summary>
|
||||
文件最后一次被修改的时间,UNIX 时间戳,对应 POSIX stat.st_mtime
|
||||
</summary>
|
||||
</member>
|
||||
<member name="F:WeChatWASM.WXStat.path">
|
||||
<summary>
|
||||
文件的路径
|
||||
@ -3129,19 +3109,24 @@
|
||||
是否结束
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:WeChatWASM.NotifyMiniProgramPlayableStatusOption.complete">
|
||||
<member name="F:WeChatWASM.LoadOption.openlink">
|
||||
<summary>
|
||||
接口调用结束的回调函数(调用成功、失败都会执行)
|
||||
从不同渠道获得的OPENLINK字符串
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:WeChatWASM.NotifyMiniProgramPlayableStatusOption.fail">
|
||||
<member name="F:WeChatWASM.LoadOption.query">
|
||||
<summary>
|
||||
接口调用失败的回调函数
|
||||
选填,部分活动、功能允许接收自定义query参数,请参阅渠道说明,默认可不填
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:WeChatWASM.NotifyMiniProgramPlayableStatusOption.success">
|
||||
<member name="F:WeChatWASM.ShowOption.openlink">
|
||||
<summary>
|
||||
接口调用成功的回调函数
|
||||
从不同渠道获得的OPENLINK字符串
|
||||
</summary>
|
||||
</member>
|
||||
<member name="F:WeChatWASM.ShowOption.query">
|
||||
<summary>
|
||||
选填,部分活动、功能允许接收自定义query参数,请参阅渠道说明,默认可不填
|
||||
</summary>
|
||||
</member>
|
||||
<member name="F:WeChatWASM.Gamepad.axes">
|
||||
@ -4138,26 +4123,6 @@
|
||||
取值为0/1,取值为0表示会把 `App`、`Page` 的生命周期函数和 `wx` 命名空间下的函数调用写入日志,取值为1则不会。默认值是 0
|
||||
</summary>
|
||||
</member>
|
||||
<member name="F:WeChatWASM.LoadOption.openlink">
|
||||
<summary>
|
||||
从不同渠道获得的OPENLINK字符串
|
||||
</summary>
|
||||
</member>
|
||||
<member name="F:WeChatWASM.LoadOption.query">
|
||||
<summary>
|
||||
选填,部分活动、功能允许接收自定义query参数,请参阅渠道说明,默认可不填
|
||||
</summary>
|
||||
</member>
|
||||
<member name="F:WeChatWASM.ShowOption.openlink">
|
||||
<summary>
|
||||
从不同渠道获得的OPENLINK字符串
|
||||
</summary>
|
||||
</member>
|
||||
<member name="F:WeChatWASM.ShowOption.query">
|
||||
<summary>
|
||||
选填,部分活动、功能允许接收自定义query参数,请参阅渠道说明,默认可不填
|
||||
</summary>
|
||||
</member>
|
||||
<member name="F:WeChatWASM.OnCheckForUpdateListenerResult.hasUpdate">
|
||||
<summary>
|
||||
是否有新版本
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
fileFormatVersion: 2
|
||||
guid: a18857814588f027fbba2af025670e61
|
||||
guid: 9ca36f505a62887ca539c0630f04e1a6
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
|
||||
Binary file not shown.
@ -1705,26 +1705,6 @@
|
||||
如果返回的是字符串,则数据在这个字段
|
||||
</summary>
|
||||
</member>
|
||||
<member name="F:WeChatWASM.WXStatInfo.mode">
|
||||
<summary>
|
||||
文件的类型和存取的权限,对应 POSIX stat.st_mode
|
||||
</summary>
|
||||
</member>
|
||||
<member name="F:WeChatWASM.WXStatInfo.size">
|
||||
<summary>
|
||||
文件大小,单位:B,对应 POSIX stat.st_size
|
||||
</summary>
|
||||
</member>
|
||||
<member name="F:WeChatWASM.WXStatInfo.lastAccessedTime">
|
||||
<summary>
|
||||
文件最近一次被存取或被执行的时间,UNIX 时间戳,对应 POSIX stat.st_atime
|
||||
</summary>
|
||||
</member>
|
||||
<member name="F:WeChatWASM.WXStatInfo.lastModifiedTime">
|
||||
<summary>
|
||||
文件最后一次被修改的时间,UNIX 时间戳,对应 POSIX stat.st_mtime
|
||||
</summary>
|
||||
</member>
|
||||
<member name="F:WeChatWASM.WXStat.path">
|
||||
<summary>
|
||||
文件的路径
|
||||
@ -3135,19 +3115,24 @@
|
||||
是否结束
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:WeChatWASM.NotifyMiniProgramPlayableStatusOption.complete">
|
||||
<member name="F:WeChatWASM.LoadOption.openlink">
|
||||
<summary>
|
||||
接口调用结束的回调函数(调用成功、失败都会执行)
|
||||
从不同渠道获得的OPENLINK字符串
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:WeChatWASM.NotifyMiniProgramPlayableStatusOption.fail">
|
||||
<member name="F:WeChatWASM.LoadOption.query">
|
||||
<summary>
|
||||
接口调用失败的回调函数
|
||||
选填,部分活动、功能允许接收自定义query参数,请参阅渠道说明,默认可不填
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:WeChatWASM.NotifyMiniProgramPlayableStatusOption.success">
|
||||
<member name="F:WeChatWASM.ShowOption.openlink">
|
||||
<summary>
|
||||
接口调用成功的回调函数
|
||||
从不同渠道获得的OPENLINK字符串
|
||||
</summary>
|
||||
</member>
|
||||
<member name="F:WeChatWASM.ShowOption.query">
|
||||
<summary>
|
||||
选填,部分活动、功能允许接收自定义query参数,请参阅渠道说明,默认可不填
|
||||
</summary>
|
||||
</member>
|
||||
<member name="F:WeChatWASM.Gamepad.axes">
|
||||
@ -4144,26 +4129,6 @@
|
||||
取值为0/1,取值为0表示会把 `App`、`Page` 的生命周期函数和 `wx` 命名空间下的函数调用写入日志,取值为1则不会。默认值是 0
|
||||
</summary>
|
||||
</member>
|
||||
<member name="F:WeChatWASM.LoadOption.openlink">
|
||||
<summary>
|
||||
从不同渠道获得的OPENLINK字符串
|
||||
</summary>
|
||||
</member>
|
||||
<member name="F:WeChatWASM.LoadOption.query">
|
||||
<summary>
|
||||
选填,部分活动、功能允许接收自定义query参数,请参阅渠道说明,默认可不填
|
||||
</summary>
|
||||
</member>
|
||||
<member name="F:WeChatWASM.ShowOption.openlink">
|
||||
<summary>
|
||||
从不同渠道获得的OPENLINK字符串
|
||||
</summary>
|
||||
</member>
|
||||
<member name="F:WeChatWASM.ShowOption.query">
|
||||
<summary>
|
||||
选填,部分活动、功能允许接收自定义query参数,请参阅渠道说明,默认可不填
|
||||
</summary>
|
||||
</member>
|
||||
<member name="F:WeChatWASM.OnCheckForUpdateListenerResult.hasUpdate">
|
||||
<summary>
|
||||
是否有新版本
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
fileFormatVersion: 2
|
||||
guid: b521413075c053e47a06a3b8bc3b7725
|
||||
guid: 98c51e6d190976d3d86edb3a07300118
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
|
||||
@ -4036,32 +4036,6 @@ namespace WeChatWASM
|
||||
return WXSDKManagerHandler.Instance.GetLogManager(option);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// [[PageManager](https://developers.weixin.qq.com/minigame/dev/api/open-api/openlink/PageManager.html) wx.createPageManager()](https://developers.weixin.qq.com/minigame/dev/api/open-api/openlink/wx.createPageManager.html)
|
||||
/// 需要基础库: `3.6.7`
|
||||
/// 小游戏开放页面管理器,用于启动微信内置的各种小游戏活动、功能页面。具体OPENLINK值由不同的能力渠道获得。
|
||||
/// **示例代码**
|
||||
/// ```js
|
||||
/// const pageManager = wx.createPageManager();
|
||||
/// pageManager.load({
|
||||
/// openlink: 'xxxxxxx-xxxxxx', // 由不同渠道获得的OPENLINK值
|
||||
/// }).then((res) => {
|
||||
/// // 加载成功,res 可能携带不同活动、功能返回的特殊回包信息(具体请参阅渠道说明)
|
||||
/// console.log(res);
|
||||
/// // 加载成功后按需显示
|
||||
/// pageManager.show();
|
||||
/// }).catch((err) => {
|
||||
/// // 加载失败,请查阅 err 给出的错误信息
|
||||
/// console.error(err);
|
||||
/// })
|
||||
/// ```
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public static WXPageManager CreatePageManager()
|
||||
{
|
||||
return WXSDKManagerHandler.Instance.CreatePageManager();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// [[RealtimeLogManager](https://developers.weixin.qq.com/minigame/dev/api/base/debug/RealtimeLogManager.html) wx.getRealtimeLogManager()](https://developers.weixin.qq.com/minigame/dev/api/base/debug/wx.getRealtimeLogManager.html)
|
||||
/// 需要基础库: `2.14.4`
|
||||
|
||||
@ -1127,6 +1127,32 @@ namespace WeChatWASM
|
||||
WXSDKManagerHandler.Instance.NotifyMiniProgramPlayableStatus(option);
|
||||
}
|
||||
#endregion
|
||||
|
||||
/// <summary>
|
||||
/// [[PageManager](https://developers.weixin.qq.com/minigame/dev/api/open-api/openlink/PageManager.html) wx.createPageManager()](https://developers.weixin.qq.com/minigame/dev/api/open-api/openlink/wx.createPageManager.html)
|
||||
/// 需要基础库: `3.6.7`
|
||||
/// 小游戏开放页面管理器,用于启动微信内置的各种小游戏活动、功能页面。具体OPENLINK值由不同的能力渠道获得。
|
||||
/// **示例代码**
|
||||
/// ```js
|
||||
/// const pageManager = wx.createPageManager();
|
||||
/// pageManager.load({
|
||||
/// openlink: 'xxxxxxx-xxxxxx', // 由不同渠道获得的OPENLINK值
|
||||
/// }).then((res) => {
|
||||
/// // 加载成功,res 可能携带不同活动、功能返回的特殊回包信息(具体请参阅渠道说明)
|
||||
/// console.log(res);
|
||||
/// // 加载成功后按需显示
|
||||
/// pageManager.show();
|
||||
/// }).catch((err) => {
|
||||
/// // 加载失败,请查阅 err 给出的错误信息
|
||||
/// console.error(err);
|
||||
/// })
|
||||
/// ```
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public static WXPageManager CreatePageManager()
|
||||
{
|
||||
return WXSDKManagerHandler.Instance.CreatePageManager();
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
@ -8,6 +8,10 @@ using UnityEngine;
|
||||
using UnityEngine.Scripting;
|
||||
using System.IO;
|
||||
|
||||
using Unity.Profiling;
|
||||
using UnityEngine.Profiling;
|
||||
using Debug = UnityEngine.Debug;
|
||||
|
||||
|
||||
#if PLATFORM_WEIXINMINIGAME || PLATFORM_WEBGL || UNITY_EDITOR
|
||||
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
fileFormatVersion: 2
|
||||
guid: e5108f88099bb61c1ac7bce85c058bbb
|
||||
guid: 8b2bbe496a3e3d9b91b60d8520a0cf41
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 0273befd5791516c05640b866a4057ac
|
||||
guid: 22f378da95c3c24d0877bdca4895a94a
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 92af1c93c32d8868b037a614a7c51557
|
||||
guid: 036b493cca6dcbdf5a7a344430553d64
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 82a6bdd86dff7182973b291cb71e97cf
|
||||
guid: bf5cd023bce3bb4dbd40e7ef00e51c43
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 531515f3324b0cf5a249ca868fbb957e
|
||||
guid: fa2f90bf6bb2b78e8d62593541c38ca9
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 3b395b6e591cc8b3668e0b64e63fc88b
|
||||
guid: 39d649f8e1c110bd49f171f65f941beb
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
fileFormatVersion: 2
|
||||
guid: d04f0a28a0ef5cdd7a1d23182b85b42f
|
||||
guid: 0b3aee9e7cabf49fab61ed23b92152bd
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 9bcc1936d8e45b5791c599fe8253919c
|
||||
guid: e42eb20d5870d81c18bfb81876972098
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
fileFormatVersion: 2
|
||||
guid: d52a1b6e1c06472f3a3a461209736492
|
||||
guid: e97a406a6aa9012f87567e2cbbd8feae
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
fileFormatVersion: 2
|
||||
guid: bbec39b14da95d130e2852e718bcee52
|
||||
guid: e8a6cba49ab5dc0345708070ce254894
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 5811c5c2d62fc7802c64f1d2b23745f1
|
||||
guid: 20acbfb78096d1a2bd17c1b4b8658b28
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 6dae963d59fa4418d09722a93e87d793
|
||||
guid: be7896ac80f379d16f440a5da87762c5
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 854f4bd8ff1dd4750841937bcddeaf70
|
||||
guid: d4a86865c1e7deac6e704cf805a6ac4f
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 2c062721204b988f19733cfdcfb64e34
|
||||
guid: 851b159cf1e2f5bc93a2bd8153025ec8
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 31f9cc6cd458af9ae649ac0f4cc8772e
|
||||
guid: dc3bf256c9ea20a586a1e5664b50eb31
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 2a92708403fe30f324cbf69ccf64a5ca
|
||||
guid: d01dd43b63ccaa5d19f14c1e58e7de70
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
fileFormatVersion: 2
|
||||
guid: d0a26195cb9a986d48760de79dc69c05
|
||||
guid: 85821d67f53403fce81551812527d1d0
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
fileFormatVersion: 2
|
||||
guid: ceec02b40e3331d02d75fa809a9760a7
|
||||
guid: def70be618d00834d98303b7a820e5c6
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
fileFormatVersion: 2
|
||||
guid: a5bfd354ed4424c67e796543113905e3
|
||||
guid: 0f8a84fb99defc4ff722c0d48b958af9
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 3a4d82e9de0cb38b0c9224360f3ad139
|
||||
guid: d415444d1cc9701b89bf0f2c66d72d0b
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 23b767c936834d1b790a40ea00e26d64
|
||||
guid: b892a21ed58facc3874536860bf306f8
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 968b47eba0189213d3a4cfabbadee54c
|
||||
guid: 4ffe82f3bdaf02d3770f4a89c5a0291b
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 710313a81f77482d26012751c5d6592a
|
||||
guid: 803343004fe91e2fafbcaf12fb8cc353
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 8342caa71b7edf46f906aa855aea4ef3
|
||||
guid: df4b7e87b692730db98a4ce63c345026
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
fileFormatVersion: 2
|
||||
guid: c92653458db092aae35564ef3edd6252
|
||||
guid: 97e6f1b1ae511e3091444063066f91eb
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 6e3f60a883fb2f8249ce74acf2c14acd
|
||||
guid: 515bf0dfcdd5b80954ef1ea3902720a1
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
fileFormatVersion: 2
|
||||
guid: cdaa05d30f80a46dddcc25d674615153
|
||||
guid: 9d2a20801ad48a8ac287dc668b57a957
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 95650874bc818949f578987590377532
|
||||
guid: 94de769b2e91839fb804b28f0c428b39
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 7e863e19487a6cda9d53bbfc8e3fbd03
|
||||
guid: acccc0070414adb260e5ffbc50faa211
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 9733080f2e9cef0f03c3d0ee1dad8983
|
||||
guid: f8a8737ef20d05fbb25ac0efc2b95d08
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
fileFormatVersion: 2
|
||||
guid: d1ab83ac4fb090597d227ff725dbb6f7
|
||||
guid: 77f58f4217df4cd225aa9c075cf06725
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 745ed2f1262c74198123f00a889f2b22
|
||||
guid: cc852a4c123753b63e6a9fd4a0fc5bab
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 23879d36971922e903eddd9885892fb3
|
||||
guid: ac7f29066fa325916980828010cfe0f4
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 481df7275cffcd473c8a1114f7d73979
|
||||
guid: 871dc456b630406ffd0e5db5d8acb3b3
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 62febf55450b14dd5e6d76f19bbd702a
|
||||
guid: c91f0bb52f90b44c15b2726fa218179a
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
fileFormatVersion: 2
|
||||
guid: faeaa5621fd2c89ab8be9d59a5bfd49b
|
||||
guid: e2a745c167aa200f0ecafa0cf650a8e7
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 1ce4ef1463f0ff2eb0b56e23d2871901
|
||||
guid: 8886e1e63de6281271c283af9ca16a33
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
|
||||
@ -1,4 +1,11 @@
|
||||
export const ResType = {
|
||||
Gamepad: {
|
||||
axes: 'IAnyObject[]',
|
||||
buttons: 'IAnyObject[]',
|
||||
connected: 'bool',
|
||||
id: 'string',
|
||||
index: 'string',
|
||||
},
|
||||
AccountInfo: {
|
||||
miniProgram: 'MiniProgram',
|
||||
plugin: 'Plugin',
|
||||
@ -496,7 +503,7 @@ export const ResType = {
|
||||
headUrl: 'string',
|
||||
nickname: 'string',
|
||||
nonceId: 'string',
|
||||
otherInfos: 'AnyKeyword[]',
|
||||
otherInfos: 'any[]',
|
||||
replayStatus: 'number',
|
||||
status: 'number',
|
||||
errMsg: 'string',
|
||||
@ -505,7 +512,7 @@ export const ResType = {
|
||||
headUrl: 'string',
|
||||
nickname: 'string',
|
||||
noticeId: 'string',
|
||||
otherInfos: 'AnyKeyword[]',
|
||||
otherInfos: 'any[]',
|
||||
reservable: 'bool',
|
||||
startTime: 'string',
|
||||
status: 'number',
|
||||
@ -574,6 +581,11 @@ export const ResType = {
|
||||
weakNet: 'bool',
|
||||
errMsg: 'string',
|
||||
},
|
||||
GetPhoneNumberSuccessCallbackResult: {
|
||||
code: 'string',
|
||||
errMsg: 'string',
|
||||
errno: 'number',
|
||||
},
|
||||
GetPrivacySettingSuccessCallbackResult: {
|
||||
needAuthorization: 'bool',
|
||||
privacyContractName: 'string',
|
||||
@ -598,6 +610,10 @@ export const ResType = {
|
||||
mainSwitch: 'bool',
|
||||
itemSettings: 'object',
|
||||
},
|
||||
GetShowSplashAdStatusSuccessCallbackResult: {
|
||||
status: 'string',
|
||||
errMsg: 'string',
|
||||
},
|
||||
GetStorageInfoSuccessCallbackOption: {
|
||||
currentSize: 'number',
|
||||
keys: 'string[]',
|
||||
@ -724,6 +740,12 @@ export const ResType = {
|
||||
message: 'string',
|
||||
stack: 'string',
|
||||
},
|
||||
OnGamepadConnectedListenerResult: {
|
||||
gamepad: 'string',
|
||||
},
|
||||
OnGamepadDisconnectedListenerResult: {
|
||||
gamepad: 'string',
|
||||
},
|
||||
OnHandoffListenerResult: {
|
||||
query: 'string',
|
||||
},
|
||||
@ -741,14 +763,6 @@ export const ResType = {
|
||||
OnMemoryWarningListenerResult: {
|
||||
level: 'number',
|
||||
},
|
||||
OnMenuButtonBoundingClientRectWeightChangeListenerResult: {
|
||||
bottom: 'number',
|
||||
height: 'number',
|
||||
left: 'number',
|
||||
right: 'number',
|
||||
top: 'number',
|
||||
width: 'number',
|
||||
},
|
||||
OnMouseDownListenerResult: {
|
||||
button: 'number',
|
||||
timeStamp: 'long',
|
||||
@ -849,17 +863,6 @@ export const ResType = {
|
||||
subscriptionsSetting: 'SubscriptionsSetting',
|
||||
errMsg: 'string',
|
||||
},
|
||||
OperateGameRecorderVideoOption: {
|
||||
atempo: 'number',
|
||||
audioMix: 'bool',
|
||||
bgm: 'string',
|
||||
desc: 'string',
|
||||
path: 'string',
|
||||
query: 'string',
|
||||
timeRange: 'number[]',
|
||||
title: 'string',
|
||||
volume: 'number',
|
||||
},
|
||||
MediaSource: {
|
||||
url: 'string',
|
||||
poster: 'string',
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 4804e01bf66b4037ae3257077b1fa612
|
||||
guid: bb3396fe6b8a692a8613293ebb0f07a6
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
fileFormatVersion: 2
|
||||
guid: b53fa697f1378a92419ab4cdf86f71f7
|
||||
guid: 8724b1e6d2859aa3dcf197ea540aee7f
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
fileFormatVersion: 2
|
||||
guid: c0bdb6ec2e9b51a1de21189c1df0b82d
|
||||
guid: 262938369336942bb2968eaf1546ac32
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
|
||||
@ -23,7 +23,7 @@ function getClassObject(className, id) {
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/naming-convention
|
||||
function WX_OneWayNoFunction(functionName, ...params) {
|
||||
wx[functionName.replace(/^\w/, a => a.toLowerCase())](...params);
|
||||
wx[functionName.replace(/^\w/, (a) => a.toLowerCase())](...params);
|
||||
}
|
||||
|
||||
|
||||
@ -33,7 +33,7 @@ const onlyReadyResponse = [
|
||||
];
|
||||
// eslint-disable-next-line @typescript-eslint/naming-convention
|
||||
function WX_SyncFunction(functionName, ...params) {
|
||||
return wx[functionName.replace(/^\w/, a => a.toLowerCase())](...params);
|
||||
return wx[functionName.replace(/^\w/, (a) => a.toLowerCase())](...params);
|
||||
}
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/naming-convention
|
||||
@ -42,13 +42,22 @@ function WX_ClassOneWayNoFunction(className, functionName, id, ...params) {
|
||||
if (!obj) {
|
||||
return;
|
||||
}
|
||||
obj[functionName.replace(/^\w/, a => a.toLowerCase())](...params);
|
||||
obj[functionName.replace(/^\w/, (a) => a.toLowerCase())](...params);
|
||||
}
|
||||
function classFormatAndSend(id, callbackId, callbackName, callbackType, resType, res) {
|
||||
formatResponse(resType, res);
|
||||
moduleHelper.send(callbackName, classGetMsg(id, callbackId, callbackType, res));
|
||||
}
|
||||
function classGetMsg(id, callbackId, resType, res) {
|
||||
return JSON.stringify({
|
||||
id, callbackId, type: resType, res: JSON.stringify(res) || '',
|
||||
});
|
||||
}
|
||||
export default {
|
||||
WX_OneWayFunction(functionName, successType, failType, completeType, conf, callbackId) {
|
||||
const lowerFunctionName = functionName.replace(/^\w/, a => a.toLowerCase());
|
||||
const lowerFunctionName = functionName.replace(/^\w/, (a) => a.toLowerCase());
|
||||
const config = formatJsonStr(conf);
|
||||
|
||||
// specialJS
|
||||
if (lowerFunctionName === 'login') {
|
||||
if (!config.timeout) {
|
||||
delete config.timeout;
|
||||
@ -111,7 +120,7 @@ export default {
|
||||
moduleHelper.send(`_${functionName}Callback`, resStr);
|
||||
};
|
||||
onEventLists[functionName].push(callback);
|
||||
wx[functionName.replace(/^\w/, a => a.toLowerCase())](callback);
|
||||
wx[functionName.replace(/^\w/, (a) => a.toLowerCase())](callback);
|
||||
},
|
||||
WX_OffEventRegister(functionName) {
|
||||
(onEventLists[functionName] || []).forEach((v) => {
|
||||
@ -225,7 +234,7 @@ export default {
|
||||
},
|
||||
WX_SyncFunction_t(functionName, returnType) {
|
||||
const res = WX_SyncFunction(functionName);
|
||||
if (onlyReadyResponse.includes(functionName.replace(/^\w/, a => a.toLowerCase()))) {
|
||||
if (onlyReadyResponse.includes(functionName.replace(/^\w/, (a) => a.toLowerCase()))) {
|
||||
formatResponse(returnType, JSON.parse(JSON.stringify(res)));
|
||||
return JSON.stringify(res);
|
||||
}
|
||||
@ -262,10 +271,10 @@ export default {
|
||||
formatResponse(returnType, res);
|
||||
return JSON.stringify(res);
|
||||
},
|
||||
WX_ClassOneWayFunction(functionName, returnType, successType, failType, completeType, conf) {
|
||||
WX_ClassConstructor(functionName, returnType, successType, failType, completeType, conf) {
|
||||
const config = formatJsonStr(conf);
|
||||
const callbackId = uid();
|
||||
const obj = wx[functionName.replace(/^\w/, a => a.toLowerCase())]({
|
||||
const obj = wx[functionName.replace(/^\w/, (a) => a.toLowerCase())]({
|
||||
...config,
|
||||
success(res) {
|
||||
formatResponse(successType, res);
|
||||
@ -293,7 +302,7 @@ export default {
|
||||
return callbackId;
|
||||
},
|
||||
WX_ClassFunction(functionName, returnType, option) {
|
||||
const obj = wx[functionName.replace(/^\w/, a => a.toLowerCase())](formatJsonStr(option));
|
||||
const obj = wx[functionName.replace(/^\w/, (a) => a.toLowerCase())](formatJsonStr(option));
|
||||
const id = uid();
|
||||
if (!ClassLists[returnType]) {
|
||||
ClassLists[returnType] = {};
|
||||
@ -347,10 +356,10 @@ export default {
|
||||
ClassOnEventLists[className + functionName][id + eventName].push(callback);
|
||||
// WXVideoDecoder OnEvent 不规范 特殊处理
|
||||
if (className === 'WXVideoDecoder') {
|
||||
obj[functionName.replace(/^\w/, a => a.toLowerCase())](eventName, callback);
|
||||
obj[functionName.replace(/^\w/, (a) => a.toLowerCase())](eventName, callback);
|
||||
}
|
||||
else {
|
||||
obj[functionName.replace(/^\w/, a => a.toLowerCase())](callback);
|
||||
obj[functionName.replace(/^\w/, (a) => a.toLowerCase())](callback);
|
||||
}
|
||||
},
|
||||
WX_ClassOffEventFunction(className, functionName, id, eventName) {
|
||||
@ -389,7 +398,7 @@ export default {
|
||||
if (!obj) {
|
||||
return JSON.stringify(formatResponse(returnType));
|
||||
}
|
||||
const res = obj[functionName.replace(/^\w/, a => a.toLowerCase())]();
|
||||
const res = obj[functionName.replace(/^\w/, (a) => a.toLowerCase())]();
|
||||
return JSON.stringify(formatResponse(returnType, res, id));
|
||||
},
|
||||
WX_ClassOneWayNoFunction_vt(className, functionName, id, param1) {
|
||||
@ -399,4 +408,41 @@ export default {
|
||||
WX_ClassOneWayNoFunction_vn(className, functionName, id, param1) {
|
||||
WX_ClassOneWayNoFunction(className, functionName, id, param1);
|
||||
},
|
||||
WX_ClassOneWayFunction(className, functionName, id, successType, failType, completeType, conf, callbackId, usePromise = false) {
|
||||
|
||||
const obj = getClassObject(className, id);
|
||||
if (!obj) {
|
||||
return;
|
||||
}
|
||||
const lowerFunctionName = functionName.replace(/^\w/, (a) => a.toLowerCase());
|
||||
const config = formatJsonStr(conf);
|
||||
|
||||
if (usePromise) {
|
||||
obj[lowerFunctionName]({
|
||||
...config,
|
||||
}).then((res) => {
|
||||
classFormatAndSend(id, callbackId, `_${className}${functionName}Callback`, 'success', successType, res);
|
||||
})
|
||||
.catch((res) => {
|
||||
classFormatAndSend(id, callbackId, `_${className}${functionName}Callback`, 'fail', failType, res);
|
||||
})
|
||||
.finally((res) => {
|
||||
classFormatAndSend(id, callbackId, `_${className}${functionName}Callback`, 'complete', completeType, res);
|
||||
});
|
||||
}
|
||||
else {
|
||||
obj[lowerFunctionName]({
|
||||
...config,
|
||||
success(res) {
|
||||
classFormatAndSend(id, callbackId, `_${className}${functionName}Callback`, 'success', successType, res);
|
||||
},
|
||||
fail(res) {
|
||||
classFormatAndSend(id, callbackId, `_${className}${functionName}Callback`, 'fail', failType, res);
|
||||
},
|
||||
complete(res) {
|
||||
classFormatAndSend(id, callbackId, `_${className}${functionName}Callback`, 'complete', completeType, res);
|
||||
},
|
||||
});
|
||||
}
|
||||
},
|
||||
};
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 45586bcf2aec8da319b74e07858c2427
|
||||
guid: 9c3efbdeacfdcf206d82844eefdc84a2
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 38fecf1cc6b371057e50349b5f3551cd
|
||||
guid: a1ecfb7a693d928ffebe75a5e81f4cdd
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
fileFormatVersion: 2
|
||||
guid: f142ec01c4dba069b031185ebf7b072b
|
||||
guid: 30e5c8d9839961cc12fdb217b495b154
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 4b807ee5567f2a193edfca4bdffbd798
|
||||
guid: 22b7282038a2f705c59b904a69fa1a1f
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 8a6e150eef26403510c814e0e93a2694
|
||||
guid: 85b291bd7e6289c264ea7ac90bba20ba
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 4c10ebb6213c7a7fa92a91ba5c9649ee
|
||||
guid: 7fe98ae170cebb6cf0f03d03148cdf03
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
fileFormatVersion: 2
|
||||
guid: e9a5598b8047e5073d8baa4c8df0c978
|
||||
guid: cc1f400251eeb45d4f4909791bcf4ae1
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 828f84320fa56abfa00ee9a5c916cbb9
|
||||
guid: 11d98a4211e86f5ad40b36f1a7e1e95d
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 4b8a6a9e53972c103f0eb844fed1ea99
|
||||
guid: d4cfdee7a187ed65176c828d3ab25854
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
fileFormatVersion: 2
|
||||
guid: d85c26bfbd9a3283f6bb30cceca5ea5e
|
||||
guid: 4919482e92fcba888835fca0a1a43aa1
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 88c2c4f8b42d569b8094feb74e6da2a1
|
||||
guid: 1785bd45881cdebaa9fe94da18bc194e
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 498e07525985bb6ced0bd9306b09f6a4
|
||||
guid: de1bce909bef4ba7e356b043a562cd75
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 73905f6b06e6cb50adcc24a126ed8b65
|
||||
guid: da6021252a9d184c644969af9e2cd563
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
|
||||
@ -45,7 +45,7 @@ const isIOSWebgl2SystemVersionValid = compareVersion(systemVersion, '15.0') || G
|
||||
// Android客户端版本>=8.0.19支持webgl2
|
||||
const isAndroidWebGL2ClientVersionValid = compareVersion(version, '8.0.19');
|
||||
// 是否用了webgl2
|
||||
const isWebgl2 = () => GameGlobal.managerConfig.contextConfig.contextType === 2;
|
||||
const isWebgl2 = () => GameGlobal.managerConfig.contextConfig.contextType === 2 || GameGlobal.managerConfig.contextConfig.contextType === 4;
|
||||
// 是否支持BufferURL
|
||||
export const isSupportBufferURL = !isPc
|
||||
&& (isH5Renderer
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 042f851fc2cd2b760f52c343668c5cc8
|
||||
guid: fb726759bc9a9eeccd43d394f09251a3
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 67ff1f029018f30663345cd163b89865
|
||||
guid: 9652baea742abef6330dd73b9bfd0df3
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
fileFormatVersion: 2
|
||||
guid: b6e2f562aef79212d81c2ba7a7edd3ff
|
||||
guid: b5de9bf7ba175055e1b89d1b1a5b22b4
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
fileFormatVersion: 2
|
||||
guid: c21e4f9445ab1354e004ee6806d36b1c
|
||||
guid: 2894623cca69815a486bbe7da0240cce
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
|
||||
@ -27,7 +27,11 @@ const managerConfig = {
|
||||
'$PRELOAD_LIST',
|
||||
],
|
||||
contextConfig: {
|
||||
contextType: $WEBGL_VERSION, // 1: webgl1 2: webgl2
|
||||
contextType: $WEBGL_VERSION,
|
||||
contextExt: {
|
||||
enableGLX: $ENABLE_GLX,
|
||||
enableMetal: $ENABLE_METAL,
|
||||
}
|
||||
},
|
||||
PROFILER_UPLOAD_URL: '',
|
||||
};
|
||||
@ -48,6 +52,7 @@ checkVersion().then((enable) => {
|
||||
canvas,
|
||||
events: GameGlobal.events,
|
||||
WXWASMSDK: GameGlobal.WXWASMSDK,
|
||||
wxEnv: wx.env ?? {},
|
||||
},
|
||||
}).default;
|
||||
}
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
fileFormatVersion: 2
|
||||
guid: c4e3d01e4d70fba53c1b8add5d1d79d6
|
||||
guid: 9492d444a603c27e56920df8f20f6a14
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
|
||||
@ -23,7 +23,7 @@
|
||||
],
|
||||
"plugins": {
|
||||
"UnityPlugin": {
|
||||
"version": "1.2.74",
|
||||
"version": "1.2.79",
|
||||
"provider": "wxe5a48f1ed5f544b7",
|
||||
"contexts": [
|
||||
{
|
||||
@ -32,7 +32,7 @@
|
||||
]
|
||||
},
|
||||
"Layout": {
|
||||
"version": "1.0.7",
|
||||
"version": "1.0.16",
|
||||
"provider": "wx7a727ff7d940bb3f",
|
||||
"contexts": [
|
||||
{
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
fileFormatVersion: 2
|
||||
guid: e336f4b63e6dfc217c3b2a4de7b8811b
|
||||
guid: 82f990685eb582c0e46c88af69406d50
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
fileFormatVersion: 2
|
||||
guid: ebace106ae81525b2d597de54b319641
|
||||
guid: d8fd0ed15d5b1d8d32fa47be1084111d
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 961219c24017591be9f7387b32c99dda
|
||||
guid: 8ce3a7fd2fad765d7ece6fc2b5a0df1b
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 1512252be1263bff0bad2706fd57721b
|
||||
guid: ae6ca77118d23cdd739bebc292c3f0aa
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 9b7a4b7182bc265e1f19186313e10f47
|
||||
guid: e2e32c335e3529da9c3776dda3c50b93
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 0b8738d6b9bb9fd55482c734e21beb13
|
||||
guid: d4703737c6c11c26c85a1552e5007ead
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 5b2baee358014e8ac3e76cf8b8a2efda
|
||||
guid: 9880a78ef1a89ee5b5d7826bacec4bfa
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
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