mirror of
https://github.com/wechat-miniprogram/minigame-tuanjie-transform-sdk.git
synced 2026-04-22 01:35:56 +08:00
Auto-publish release WXSDK.
This commit is contained in:
parent
981890fdaa
commit
d819a70c1b
33
CHANGELOG.md
33
CHANGELOG.md
@ -6,6 +6,39 @@ Removed - 删除功能/接口
|
||||
Fixed - 修复问题
|
||||
Others - 其他
|
||||
-->
|
||||
## 2024-8-28 【预发布】
|
||||
PackageManager(git URL): https://github.com/wechat-miniprogram/minigame-tuanjie-transform-sdk.git#pre-v0.1.19
|
||||
### Feature
|
||||
* 普通: UDPSocket.write适配
|
||||
* 普通: 部分JS API接口更新
|
||||
* 普通: 云开发/云托管支持
|
||||
### Fixed
|
||||
* 普通: 修复.net8 OnApplicationFocus/Pause适配
|
||||
* 普通: 修复插件自动调节dpr后,获取不到实际dpr
|
||||
|
||||
## 2024-8-13 【重要更新】
|
||||
### Feature
|
||||
* 普通: 横竖屏切换,PC窗口大小自动适配
|
||||
* 普通: PC分辨率模糊,自动调节dpr属性
|
||||
### Fixed
|
||||
* 严重:修复多点触控产生的异常
|
||||
* 普通:适配2021,去_JS_Focus_Window
|
||||
* 普通:修复多线程压缩的扩展名判定
|
||||
|
||||
## 2024-7-09 【普通更新】
|
||||
### Feature
|
||||
* 普通:兼容2022新增的音频API
|
||||
* 普通:更快的转换打包速度
|
||||
* 普通:Unity侧添加设置分辨率接口
|
||||
### Fixed
|
||||
* 普通:临时兼容wk 17.5暂停音频无法恢复的bug
|
||||
* 普通:Touch id在特定情况丢失
|
||||
* 普通:使用微信压缩纹理工具sprite atlas版本被修改
|
||||
|
||||
## 2024-5-17 【普通更新】
|
||||
Fixed
|
||||
* 普通:修复WXAssetBundle与预下载冲突问题
|
||||
|
||||
## 2024-5-15 【普通更新】
|
||||
### Feature
|
||||
* 普通:支持JS构建模板,请查阅[模板文档](https://wechat-miniprogram.github.io/minigame-unity-webgl-transform/Design/BuildTemplate.html)
|
||||
|
||||
181
Editor/WXAssetPostprocessor.cs
Normal file
181
Editor/WXAssetPostprocessor.cs
Normal file
@ -0,0 +1,181 @@
|
||||
using UnityEditor;
|
||||
using System;
|
||||
using System.Reflection;
|
||||
using System.IO;
|
||||
/*
|
||||
public class WXAssetPostprocessor : AssetPostprocessor
|
||||
{
|
||||
private static void OnPostprocessAllAssets(string[] importedAssets, string[] deletedAssets, string[] movedAssets, string[] movedFromAssetPaths)
|
||||
{
|
||||
foreach (string asset in importedAssets)
|
||||
{
|
||||
ProcessWxPerfPluginAsset(asset);
|
||||
}
|
||||
}
|
||||
|
||||
public static bool EnableWXPostProcess = false;
|
||||
|
||||
static void ProcessWxPerfPluginAsset(string wxPerfPluginAsset)
|
||||
{
|
||||
PluginImporter importer = AssetImporter.GetAtPath(wxPerfPluginAsset) as PluginImporter;
|
||||
if (importer == null) return;
|
||||
|
||||
// 判断是否是wx_perf_2022.a/o文件
|
||||
if (wxPerfPluginAsset.Contains("wx_perf_2022.a"))
|
||||
{
|
||||
if (IsCompatibleWithUnity202203OrNewer() && EnableWXPostProcess)
|
||||
{
|
||||
#if PLATFORM_WEIXINMINIGAME
|
||||
if (importer.GetCompatibleWithPlatform(BuildTarget.WeixinMiniGame))
|
||||
#else
|
||||
if (importer.GetCompatibleWithPlatform(BuildTarget.WebGL))
|
||||
#endif
|
||||
{
|
||||
return;
|
||||
}
|
||||
EnablePluginAsset(wxPerfPluginAsset);
|
||||
AssetDatabase.Refresh();
|
||||
}
|
||||
else
|
||||
{
|
||||
RemovePluginAssetAllCompatibility(wxPerfPluginAsset);
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
// 判断是否是wx_perf_2021.a/o文件
|
||||
if (wxPerfPluginAsset.Contains("wx_perf_2021.a"))
|
||||
{
|
||||
if (IsCompatibleWithUnity202103To202203() && EnableWXPostProcess)
|
||||
{
|
||||
// UnityEngine.Debug.Log($"Before --- WebGL: {importer.GetCompatibleWithPlatform(BuildTarget.WebGL)}, Editor: {importer.GetCompatibleWithEditor()}");
|
||||
#if PLATFORM_WEIXINMINIGAME
|
||||
if (importer.GetCompatibleWithPlatform(BuildTarget.WeixinMiniGame))
|
||||
#else
|
||||
if (importer.GetCompatibleWithPlatform(BuildTarget.WebGL))
|
||||
#endif
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
EnablePluginAsset(wxPerfPluginAsset);
|
||||
// UnityEngine.Debug.Log($"After --- WebGL: {importer.GetCompatibleWithPlatform(BuildTarget.WebGL)}, Editor: {importer.GetCompatibleWithEditor()}");
|
||||
|
||||
AssetDatabase.Refresh();
|
||||
}
|
||||
else
|
||||
{
|
||||
RemovePluginAssetAllCompatibility(wxPerfPluginAsset);
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
if (wxPerfPluginAsset.Contains("WxPerfJsBridge.jslib"))
|
||||
{
|
||||
if (EnableWXPostProcess)
|
||||
{
|
||||
// UnityEngine.Debug.Log($"Before --- WebGL: {importer.GetCompatibleWithPlatform(BuildTarget.WebGL)}, Editor: {importer.GetCompatibleWithEditor()}");
|
||||
#if PLATFORM_WEIXINMINIGAME
|
||||
if (importer.GetCompatibleWithPlatform(BuildTarget.WeixinMiniGame))
|
||||
#else
|
||||
if (importer.GetCompatibleWithPlatform(BuildTarget.WebGL))
|
||||
#endif
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
EnablePluginAsset(wxPerfPluginAsset);
|
||||
// UnityEngine.Debug.Log($"After --- WebGL: {importer.GetCompatibleWithPlatform(BuildTarget.WebGL)}, Editor: {importer.GetCompatibleWithEditor()}");
|
||||
|
||||
AssetDatabase.Refresh();
|
||||
}
|
||||
else
|
||||
{
|
||||
RemovePluginAssetAllCompatibility(wxPerfPluginAsset);
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
static bool IsCompatibleWithUnity202203OrNewer()
|
||||
{
|
||||
#if UNITY_2022_3_OR_NEWER
|
||||
return true;
|
||||
#endif
|
||||
return false;
|
||||
}
|
||||
|
||||
static bool IsCompatibleWithUnity202103To202203()
|
||||
{
|
||||
#if UNITY_2022_3_OR_NEWER
|
||||
return false;
|
||||
#endif
|
||||
|
||||
#if !UNITY_2021_3_OR_NEWER
|
||||
return false;
|
||||
#endif
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
private static void RemovePluginAssetAllCompatibility(string inAssetPath)
|
||||
{
|
||||
PluginImporter importer = AssetImporter.GetAtPath(inAssetPath) as PluginImporter;
|
||||
|
||||
#if PLATFORM_WEIXINMINIGAME
|
||||
importer.SetCompatibleWithPlatform(BuildTarget.WeixinMiniGame, false);
|
||||
#else
|
||||
importer.SetCompatibleWithPlatform(BuildTarget.WebGL, false);
|
||||
#endif
|
||||
|
||||
AssetDatabase.WriteImportSettingsIfDirty(inAssetPath);
|
||||
}
|
||||
|
||||
private static bool IsPluginAssetValid(PluginImporter inPluginImporter)
|
||||
{
|
||||
if (inPluginImporter == null) return false;
|
||||
|
||||
if (inPluginImporter.GetCompatibleWithEditor()) return true;
|
||||
|
||||
foreach (BuildTarget target in Enum.GetValues(typeof(BuildTarget)))
|
||||
{
|
||||
if (inPluginImporter.GetCompatibleWithPlatform(target))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
private static void EnablePluginAsset(string inAssetPath)
|
||||
{
|
||||
PluginImporter importer = AssetImporter.GetAtPath(inAssetPath) as PluginImporter;
|
||||
#if PLATFORM_WEIXINMINIGAME
|
||||
importer.SetCompatibleWithPlatform(BuildTarget.WeixinMiniGame, EnableWXPostProcess);
|
||||
#else
|
||||
importer.SetCompatibleWithPlatform(BuildTarget.WebGL, EnableWXPostProcess);
|
||||
#endif
|
||||
AssetDatabase.WriteImportSettingsIfDirty(inAssetPath);
|
||||
}
|
||||
|
||||
private static int GetEnabledFlagStringIndex(string inAllText, string inTagStr)
|
||||
{
|
||||
int tagStrIdx = inAllText.IndexOf(inTagStr);
|
||||
|
||||
int enabledStrIdx = inAllText.IndexOf("enabled: ", tagStrIdx);
|
||||
|
||||
// inAllText[enabledStrIdx] == 'e'
|
||||
// And that is to say, inAllText[enabledStrIdx + 9] should be 0 or 1
|
||||
return enabledStrIdx + 9;
|
||||
}
|
||||
}
|
||||
*/
|
||||
7
Editor/WXAssetPostprocessor.cs.meta
Normal file
7
Editor/WXAssetPostprocessor.cs.meta
Normal file
@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: e8dec6e99bf04b4f787998f122542793
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@ -109,8 +109,16 @@ namespace WeChatWASM
|
||||
Debug.LogError("因构建模板检查失败终止导出。");
|
||||
return WXExportError.BUILD_WEBGL_FAILED;
|
||||
}
|
||||
if (CheckInvalidPerfIntegration())
|
||||
{
|
||||
Debug.LogError("性能分析工具只能用于Development Build, 终止导出! ");
|
||||
return WXExportError.BUILD_WEBGL_FAILED;
|
||||
}
|
||||
|
||||
|
||||
CheckBuildTarget();
|
||||
Init();
|
||||
ProcessWxPerfBinaries();
|
||||
// JSLib
|
||||
SettingWXTextureMinJSLib();
|
||||
UpdateGraphicAPI();
|
||||
@ -208,6 +216,96 @@ namespace WeChatWASM
|
||||
return WXExportError.SUCCEED;
|
||||
}
|
||||
|
||||
private static void ProcessWxPerfBinaries()
|
||||
{
|
||||
string[] wxPerfPlugins;
|
||||
string DS = WXAssetsTextTools.DS;
|
||||
if (UnityUtil.GetSDKMode() == UnityUtil.SDKMode.Package)
|
||||
{
|
||||
wxPerfPlugins = new string[]
|
||||
{
|
||||
$"Packages{DS}com.qq.weixin.minigame{DS}Runtime{DS}Plugins{DS}WxPerfJsBridge.jslib",
|
||||
$"Packages{DS}com.qq.weixin.minigame{DS}Runtime{DS}Plugins{DS}wx_perf_2022.a",
|
||||
$"Packages{DS}com.qq.weixin.minigame{DS}Runtime{DS}Plugins{DS}wx_perf_2021.a",
|
||||
};
|
||||
}
|
||||
else
|
||||
{
|
||||
string jsLibRootDir = $"Assets{DS}WX-WASM-SDK-V2{DS}Runtime{DS}Plugins{DS}";
|
||||
|
||||
// 下方顺序不可变动
|
||||
wxPerfPlugins = new string[]
|
||||
{
|
||||
$"{jsLibRootDir}WxPerfJsBridge.jslib",
|
||||
$"{jsLibRootDir}wx_perf_2022.a",
|
||||
$"{jsLibRootDir}wx_perf_2021.a",
|
||||
};
|
||||
}
|
||||
|
||||
{
|
||||
// WxPerfJsBridge.jslib
|
||||
var wxPerfJSBridgeImporter = AssetImporter.GetAtPath(wxPerfPlugins[0]) as PluginImporter;
|
||||
#if PLATFORM_WEIXINMINIGAME
|
||||
wxPerfJSBridgeImporter.SetCompatibleWithPlatform(BuildTarget.WeixinMiniGame, config.CompileOptions.enablePerfAnalysis);
|
||||
#else
|
||||
wxPerfJSBridgeImporter.SetCompatibleWithPlatform(BuildTarget.WebGL, config.CompileOptions.enablePerfAnalysis);
|
||||
#endif
|
||||
}
|
||||
|
||||
{
|
||||
// wx_perf_2022.a
|
||||
bool bShouldEnablePerf2022Plugin = config.CompileOptions.enablePerfAnalysis && IsCompatibleWithUnity202203OrNewer();
|
||||
|
||||
var wxPerf2022Importer = AssetImporter.GetAtPath(wxPerfPlugins[1]) as PluginImporter;
|
||||
#if PLATFORM_WEIXINMINIGAME
|
||||
wxPerf2022Importer.SetCompatibleWithPlatform(BuildTarget.WeixinMiniGame, bShouldEnablePerf2022Plugin);
|
||||
#else
|
||||
wxPerf2022Importer.SetCompatibleWithPlatform(BuildTarget.WebGL, bShouldEnablePerf2022Plugin);
|
||||
#endif
|
||||
}
|
||||
|
||||
{
|
||||
// wx_perf_2021.a
|
||||
bool bShouldEnablePerf2021Plugin = config.CompileOptions.enablePerfAnalysis && IsCompatibleWithUnity202103To202203();
|
||||
|
||||
var wxPerf2021Importer = AssetImporter.GetAtPath(wxPerfPlugins[2]) as PluginImporter;
|
||||
#if PLATFORM_WEIXINMINIGAME
|
||||
wxPerf2021Importer.SetCompatibleWithPlatform(BuildTarget.WeixinMiniGame, bShouldEnablePerf2021Plugin);
|
||||
#else
|
||||
wxPerf2021Importer.SetCompatibleWithPlatform(BuildTarget.WebGL, bShouldEnablePerf2021Plugin);
|
||||
#endif
|
||||
}
|
||||
|
||||
for (int i = 0; i < wxPerfPlugins.Length; i++)
|
||||
{
|
||||
var importer = AssetImporter.GetAtPath(wxPerfPlugins[i]) as PluginImporter;
|
||||
importer.SaveAndReimport();
|
||||
AssetDatabase.WriteImportSettingsIfDirty(wxPerfPlugins[i]);
|
||||
AssetDatabase.Refresh();
|
||||
}
|
||||
}
|
||||
|
||||
private static bool IsCompatibleWithUnity202203OrNewer()
|
||||
{
|
||||
#if UNITY_2022_3_OR_NEWER
|
||||
return true;
|
||||
#endif
|
||||
return false;
|
||||
}
|
||||
|
||||
static bool IsCompatibleWithUnity202103To202203()
|
||||
{
|
||||
#if UNITY_2022_3_OR_NEWER
|
||||
return false;
|
||||
#endif
|
||||
|
||||
#if !UNITY_2021_3_OR_NEWER
|
||||
return false;
|
||||
#endif
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
private static void CheckBuildTarget()
|
||||
{
|
||||
Emit(LifeCycle.beforeSwitchActiveBuildTarget);
|
||||
@ -318,6 +416,16 @@ namespace WeChatWASM
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
// Assert when release + Perf-feature
|
||||
private static bool CheckInvalidPerfIntegration()
|
||||
{
|
||||
const string MACRO_ENABLE_WX_PERF_FEATURE = "ENABLE_WX_PERF_FEATURE";
|
||||
string defineSymbols = PlayerSettings.GetScriptingDefineSymbolsForGroup(EditorUserBuildSettings.selectedBuildTargetGroup);
|
||||
|
||||
return (!config.CompileOptions.DevelopBuild) && (defineSymbols.IndexOf(MACRO_ENABLE_WX_PERF_FEATURE) != -1);
|
||||
}
|
||||
|
||||
private static void ConvertDotnetCode()
|
||||
{
|
||||
CompressAssemblyBrotli();
|
||||
@ -1310,6 +1418,8 @@ namespace WeChatWASM
|
||||
{
|
||||
StringBuilder sb = new StringBuilder();
|
||||
// 添加player-connection-ip信息
|
||||
try
|
||||
{
|
||||
var host = Dns.GetHostEntry("");
|
||||
foreach (var ip in host.AddressList)
|
||||
{
|
||||
@ -1319,6 +1429,12 @@ namespace WeChatWASM
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Debug.LogWarning("[可选]生成Boot info 失败!错误:" + e.Message);
|
||||
}
|
||||
|
||||
|
||||
return sb.ToString();
|
||||
}
|
||||
@ -1402,6 +1518,9 @@ namespace WeChatWASM
|
||||
config.FontOptions.Mathematical_Operators ? "true" : "false",
|
||||
customUnicodeRange,
|
||||
boolConfigInfo,
|
||||
config.CompileOptions.DevelopBuild ? "true" : "false",
|
||||
config.CompileOptions.enablePerfAnalysis ? "true" : "false",
|
||||
config.ProjectConf.MemorySize.ToString(),
|
||||
});
|
||||
|
||||
List<Rule> replaceList = new List<Rule>(replaceArrayList);
|
||||
|
||||
@ -53,7 +53,7 @@ namespace WeChatWASM
|
||||
}
|
||||
|
||||
//private static WXEditorScriptObject config = UnityUtil.GetEditorConf();
|
||||
|
||||
private static bool m_EnablePerfTool = false;
|
||||
|
||||
public void OnFocus()
|
||||
{
|
||||
@ -172,7 +172,7 @@ namespace WeChatWASM
|
||||
EditorGUILayout.BeginVertical("frameBox", GUILayout.ExpandWidth(true));
|
||||
|
||||
|
||||
this.formCheckbox("developBuild", "Development Build");
|
||||
this.formCheckbox("developBuild", "Development Build", "", false, null, OnDevelopmentBuildToggleChanged);
|
||||
this.formCheckbox("autoProfile", "Auto connect Profiler");
|
||||
this.formCheckbox("scriptOnly", "Scripts Only Build");
|
||||
this.formCheckbox("il2CppOptimizeSize", "Il2Cpp Optimize Size(?)", "对应于Il2CppCodeGeneration选项,勾选时使用OptimizeSize(默认推荐),生成代码小15%左右,取消勾选则使用OptimizeSpeed。游戏中大量泛型集合的高频访问建议OptimizeSpeed,在使用HybridCLR等第三方组件时只能用OptimizeSpeed。(Dotnet Runtime模式下该选项无效)", !UseIL2CPP);
|
||||
@ -194,9 +194,15 @@ namespace WeChatWASM
|
||||
this.formCheckbox("enableProfileStats", "显示性能面板");
|
||||
this.formCheckbox("enableRenderAnalysis", "显示渲染日志(dev only)");
|
||||
this.formCheckbox("brotliMT", "brotli多线程压缩(?)", "开启多线程压缩可以提高出包速度,但会降低压缩率。如若不使用wasm代码分包请勿用多线程出包上线");
|
||||
if (m_EnablePerfTool)
|
||||
{
|
||||
this.formCheckbox("enablePerfAnalysis", "集成性能分析工具", "将性能分析工具集成入Development Build包中", false, null, OnPerfAnalysisFeatureToggleChanged);
|
||||
}
|
||||
|
||||
EditorGUILayout.EndVertical();
|
||||
}
|
||||
|
||||
|
||||
#if UNITY_INSTANTGAME
|
||||
foldInstantGame = EditorGUILayout.Foldout(foldInstantGame, "Instant Game - AutoStreaming");
|
||||
if (foldInstantGame)
|
||||
@ -455,6 +461,7 @@ namespace WeChatWASM
|
||||
this.setData("enableProfileStats", config.CompileOptions.enableProfileStats);
|
||||
this.setData("enableRenderAnalysis", config.CompileOptions.enableRenderAnalysis);
|
||||
this.setData("brotliMT", config.CompileOptions.brotliMT);
|
||||
this.setData("enablePerfAnalysis", config.CompileOptions.enablePerfAnalysis);
|
||||
this.setData("autoUploadFirstBundle", true);
|
||||
|
||||
// font options
|
||||
@ -525,6 +532,7 @@ namespace WeChatWASM
|
||||
config.CompileOptions.enableProfileStats = this.getDataCheckbox("enableProfileStats");
|
||||
config.CompileOptions.enableRenderAnalysis = this.getDataCheckbox("enableRenderAnalysis");
|
||||
config.CompileOptions.brotliMT = this.getDataCheckbox("brotliMT");
|
||||
config.CompileOptions.enablePerfAnalysis = this.getDataCheckbox("enablePerfAnalysis");
|
||||
|
||||
// font options
|
||||
config.FontOptions.CJK_Unified_Ideographs = this.getDataCheckbox("CJK_Unified_Ideographs");
|
||||
@ -546,6 +554,8 @@ namespace WeChatWASM
|
||||
config.FontOptions.Geometric_Shapes = this.getDataCheckbox("Geometric_Shapes");
|
||||
config.FontOptions.Mathematical_Operators = this.getDataCheckbox("Mathematical_Operators");
|
||||
config.FontOptions.CustomUnicode = this.getDataInput("CustomUnicode");
|
||||
|
||||
ApplyPerfAnalysisSetting();
|
||||
}
|
||||
|
||||
private string getDataInput(string target)
|
||||
@ -633,7 +643,7 @@ namespace WeChatWASM
|
||||
GUILayout.EndHorizontal();
|
||||
}
|
||||
|
||||
private void formCheckbox(string target, string label, string help = null, bool disable = false, Action<bool> setting = null)
|
||||
private void formCheckbox(string target, string label, string help = null, bool disable = false, Action<bool> setting = null, Action<bool> onValueChanged = null)
|
||||
{
|
||||
if (!formCheckboxData.ContainsKey(target))
|
||||
{
|
||||
@ -650,7 +660,15 @@ namespace WeChatWASM
|
||||
GUILayout.Label(new GUIContent(label, help), GUILayout.Width(140));
|
||||
}
|
||||
EditorGUI.BeginDisabledGroup(disable);
|
||||
formCheckboxData[target] = EditorGUILayout.Toggle(disable ? false : formCheckboxData[target]);
|
||||
|
||||
// Toggle the checkbox value based on the disable condition
|
||||
bool newValue = EditorGUILayout.Toggle(disable ? false : formCheckboxData[target]);
|
||||
// Update the checkbox data if the value has changed and invoke the onValueChanged action
|
||||
if (newValue != formCheckboxData[target])
|
||||
{
|
||||
formCheckboxData[target] = newValue;
|
||||
onValueChanged?.Invoke(newValue);
|
||||
}
|
||||
|
||||
if (setting != null)
|
||||
{
|
||||
@ -670,6 +688,45 @@ namespace WeChatWASM
|
||||
GUILayout.EndHorizontal();
|
||||
}
|
||||
|
||||
private void OnDevelopmentBuildToggleChanged(bool InNewValue)
|
||||
{
|
||||
// 针对non-dev build,取消性能分析工具的集成
|
||||
if (!InNewValue)
|
||||
{
|
||||
this.setData("enablePerfAnalysis", false);
|
||||
}
|
||||
}
|
||||
|
||||
private void OnPerfAnalysisFeatureToggleChanged(bool InNewValue)
|
||||
{
|
||||
// 针对non-dev build,取消性能分析工具的集成
|
||||
if (!formCheckboxData["developBuild"] && InNewValue)
|
||||
{
|
||||
this.setData("enablePerfAnalysis", false);
|
||||
}
|
||||
}
|
||||
|
||||
private void ApplyPerfAnalysisSetting()
|
||||
{
|
||||
const string MACRO_ENABLE_WX_PERF_FEATURE = "ENABLE_WX_PERF_FEATURE";
|
||||
string defineSymbols = PlayerSettings.GetScriptingDefineSymbolsForGroup(EditorUserBuildSettings.selectedBuildTargetGroup);
|
||||
if (this.getDataCheckbox("enablePerfAnalysis") && this.getDataCheckbox("developBuild"))
|
||||
{
|
||||
if (defineSymbols.IndexOf(MACRO_ENABLE_WX_PERF_FEATURE) == -1)
|
||||
{
|
||||
PlayerSettings.SetScriptingDefineSymbolsForGroup(EditorUserBuildSettings.selectedBuildTargetGroup, MACRO_ENABLE_WX_PERF_FEATURE + $";{defineSymbols}");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// 删除掉已有的ENABLE_WX_PERF_FEATURE
|
||||
if (defineSymbols.IndexOf(MACRO_ENABLE_WX_PERF_FEATURE) != -1)
|
||||
{
|
||||
defineSymbols = defineSymbols.Replace(MACRO_ENABLE_WX_PERF_FEATURE, "").Replace(";;", ";").Trim(';');
|
||||
PlayerSettings.SetScriptingDefineSymbolsForGroup(EditorUserBuildSettings.selectedBuildTargetGroup, defineSymbols);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
{
|
||||
public class WXPluginVersion
|
||||
{
|
||||
public static string pluginVersion = "202408200401"; // 这一行不要改他,导出的时候会自动替换
|
||||
public static string pluginVersion = "202410080706"; // 这一行不要改他,导出的时候会自动替换
|
||||
}
|
||||
|
||||
public class WXPluginConf
|
||||
|
||||
Binary file not shown.
@ -618,6 +618,11 @@
|
||||
是否显示渲染分析日志(develop build才生效)
|
||||
</summary>
|
||||
</member>
|
||||
<member name="F:WeChatWASM.CompileOptions.enablePerfAnalysis">
|
||||
<summary>
|
||||
是否开启运行时性能分析工具(develop build才生效)
|
||||
</summary>
|
||||
</member>
|
||||
<member name="F:WeChatWASM.CompileOptions.iOSAutoGCInterval">
|
||||
<summary>
|
||||
iOS高性能模式自动GC间隔(毫秒)
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 1719462b86bf92b2183f2a29654d14bc
|
||||
guid: b1f260667675a9a7d0a655237a4c3430
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
|
||||
@ -310,19 +310,6 @@ mergeInto(LibraryManager.library, {
|
||||
WXReportUserBehaviorBranchAnalytics: function (branchId, branchDim, eventType) {
|
||||
window.WXWASMSDK.WXReportUserBehaviorBranchAnalytics(_WXPointer_stringify_adaptor(branchId), _WXPointer_stringify_adaptor(branchDim), eventType);
|
||||
},
|
||||
WXCallFunction: function (name, data, conf, s, f, c) {
|
||||
window.WXWASMSDK.WXCallFunction(_WXPointer_stringify_adaptor(name), _WXPointer_stringify_adaptor(data), _WXPointer_stringify_adaptor(conf), _WXPointer_stringify_adaptor(s), _WXPointer_stringify_adaptor(f), _WXPointer_stringify_adaptor(c));
|
||||
},
|
||||
WXCallFunctionInit: function (conf) {
|
||||
window.WXWASMSDK.WXCallFunctionInit(_WXPointer_stringify_adaptor(conf));
|
||||
},
|
||||
WXCloudID: function (cloudID) {
|
||||
var returnStr = window.WXWASMSDK.WXCloudID(_WXPointer_stringify_adaptor(cloudID));
|
||||
var bufferSize = lengthBytesUTF8(returnStr || '') + 1;
|
||||
var buffer = _malloc(bufferSize);
|
||||
stringToUTF8(returnStr, buffer, bufferSize);
|
||||
return buffer;
|
||||
},
|
||||
WXCreateInnerAudioContext: function (src, loop, startTime, autoplay, volume, playbackRate, needDownload) {
|
||||
var returnStr = window.WXWASMSDK.WXCreateInnerAudioContext(_WXPointer_stringify_adaptor(src), loop, startTime, autoplay, volume, playbackRate, needDownload);
|
||||
var bufferSize = lengthBytesUTF8(returnStr || '') + 1;
|
||||
@ -555,9 +542,13 @@ mergeInto(LibraryManager.library, {
|
||||
GameGlobal.avgExFrameTime = exTotalTime / 60;
|
||||
frameCount = 0;
|
||||
exTotalTime = 0;
|
||||
} else if (typeof GameGlobal.avgExFrameTime === "undefined") {
|
||||
GameGlobal.avgExFrameTime = exTotalTime / frameCount;
|
||||
}
|
||||
};
|
||||
}();
|
||||
//Set initial value to 0 for preventing GameGlobal.avgExFrameTime from being undefined in Unity 2019
|
||||
GameGlobal.avgExFrameTime = 0;
|
||||
}
|
||||
return GameGlobal.avgExFrameTime
|
||||
},
|
||||
@ -999,5 +990,72 @@ mergeInto(LibraryManager.library, {
|
||||
},
|
||||
WX_SetDevicePixelRatio: function(ratio) {
|
||||
window.devicePixelRatio = ratio;
|
||||
},
|
||||
WX_CallJSFunction: function (sdkName, functionName, args) {
|
||||
var sdk = _WXPointer_stringify_adaptor(sdkName);
|
||||
var func = _WXPointer_stringify_adaptor(functionName);
|
||||
var formattedArgs = JSON.parse(_WXPointer_stringify_adaptor(args));
|
||||
GameGlobal[sdk][func](...formattedArgs);
|
||||
},
|
||||
WX_CallJSFunctionWithReturn: function (sdkName, functionName, args) {
|
||||
var sdk = _WXPointer_stringify_adaptor(sdkName);
|
||||
var func = _WXPointer_stringify_adaptor(functionName);
|
||||
var formattedArgs = JSON.parse(_WXPointer_stringify_adaptor(args));
|
||||
var res = GameGlobal[sdk][func](...formattedArgs);
|
||||
var resStr = JSON.stringify(res);
|
||||
var bufferSize = lengthBytesUTF8(resStr || '') + 1;
|
||||
var buffer = _malloc(bufferSize);
|
||||
stringToUTF8((resStr || ''), buffer, bufferSize);
|
||||
return buffer;
|
||||
},
|
||||
WX_CloudCloud: function (option) {
|
||||
window.WXWASMSDK.WX_CloudCloud(_WXPointer_stringify_adaptor(option));
|
||||
},
|
||||
WX_CloudInit: function (option) {
|
||||
window.WXWASMSDK.WX_CloudInit(_WXPointer_stringify_adaptor(option));
|
||||
},
|
||||
WX_CloudCallFunction: function(env, option, callbackId) {
|
||||
window.WXWASMSDK.WX_CloudCallFunction(_WXPointer_stringify_adaptor(env), _WXPointer_stringify_adaptor(option), _WXPointer_stringify_adaptor(callbackId));
|
||||
},
|
||||
WX_CloudCloudID: function (env, cloudID) {
|
||||
var returnStr = window.WXWASMSDK.WX_CloudCloudID(_WXPointer_stringify_adaptor(env), _WXPointer_stringify_adaptor(cloudID));
|
||||
var bufferSize = lengthBytesUTF8(returnStr || '') + 1;
|
||||
var buffer = _malloc(bufferSize);
|
||||
stringToUTF8(returnStr, buffer, bufferSize);
|
||||
return buffer;
|
||||
},
|
||||
WX_CloudCallContainer: function(env, option, callbackId) {
|
||||
window.WXWASMSDK.WX_CloudCallContainer(_WXPointer_stringify_adaptor(env), _WXPointer_stringify_adaptor(option), _WXPointer_stringify_adaptor(callbackId));
|
||||
},
|
||||
WX_CloudUploadFile: function(env, option, callbackId) {
|
||||
window.WXWASMSDK.WX_CloudUploadFile(_WXPointer_stringify_adaptor(env), _WXPointer_stringify_adaptor(option), _WXPointer_stringify_adaptor(callbackId));
|
||||
},
|
||||
WX_CloudDownloadFile: function(env, option, callbackId) {
|
||||
window.WXWASMSDK.WX_CloudDownloadFile(_WXPointer_stringify_adaptor(env), _WXPointer_stringify_adaptor(option), _WXPointer_stringify_adaptor(callbackId));
|
||||
},
|
||||
WX_CloudGetTempFileURL: function(env, option, callbackId) {
|
||||
window.WXWASMSDK.WX_CloudGetTempFileURL(_WXPointer_stringify_adaptor(env), _WXPointer_stringify_adaptor(option), _WXPointer_stringify_adaptor(callbackId));
|
||||
},
|
||||
WX_CloudDeleteFile: function(env, option, callbackId) {
|
||||
window.WXWASMSDK.WX_CloudDeleteFile(_WXPointer_stringify_adaptor(env), _WXPointer_stringify_adaptor(option), _WXPointer_stringify_adaptor(callbackId));
|
||||
},
|
||||
WX_CloudCDNString: function(env, target, isJSON) {
|
||||
if (isJSON) {
|
||||
target = JSON.parse(_WXPointer_stringify_adaptor(target));
|
||||
} else {
|
||||
target = _WXPointer_stringify_adaptor(target);
|
||||
}
|
||||
var returnStr = window.WXWASMSDK.WX_CloudCDN(_WXPointer_stringify_adaptor(env), target);
|
||||
var bufferSize = lengthBytesUTF8(returnStr || '') + 1;
|
||||
var buffer = _malloc(bufferSize);
|
||||
stringToUTF8(returnStr, buffer, bufferSize);
|
||||
return buffer;
|
||||
},
|
||||
WX_CloudCDNBuffer: function(env, targetPtr, targetLength) {
|
||||
var returnStr = window.WXWASMSDK.WX_CloudCDN(_WXPointer_stringify_adaptor(env), HEAPU8.buffer.slice(targetPtr, targetPtr + targetLength));
|
||||
var bufferSize = lengthBytesUTF8(returnStr || '') + 1;
|
||||
var buffer = _malloc(bufferSize);
|
||||
stringToUTF8(returnStr, buffer, bufferSize);
|
||||
return buffer;
|
||||
},
|
||||
});
|
||||
|
||||
@ -92,6 +92,9 @@ WX_GetClipboardData:function(conf, callbackId) {
|
||||
WX_GetConnectedBluetoothDevices:function(conf, callbackId) {
|
||||
window.WXWASMSDK.WX_GetConnectedBluetoothDevices(_WXPointer_stringify_adaptor(conf), _WXPointer_stringify_adaptor(callbackId));
|
||||
},
|
||||
WX_GetDeviceBenchmarkInfo:function(conf, callbackId) {
|
||||
window.WXWASMSDK.WX_GetDeviceBenchmarkInfo(_WXPointer_stringify_adaptor(conf), _WXPointer_stringify_adaptor(callbackId));
|
||||
},
|
||||
WX_GetExtConfig:function(conf, callbackId) {
|
||||
window.WXWASMSDK.WX_GetExtConfig(_WXPointer_stringify_adaptor(conf), _WXPointer_stringify_adaptor(callbackId));
|
||||
},
|
||||
@ -239,6 +242,9 @@ WX_RequestMidasFriendPayment:function(conf, callbackId) {
|
||||
WX_RequestMidasPayment:function(conf, callbackId) {
|
||||
window.WXWASMSDK.WX_RequestMidasPayment(_WXPointer_stringify_adaptor(conf), _WXPointer_stringify_adaptor(callbackId));
|
||||
},
|
||||
WX_RequestMidasPaymentGameItem:function(conf, callbackId) {
|
||||
window.WXWASMSDK.WX_RequestMidasPaymentGameItem(_WXPointer_stringify_adaptor(conf), _WXPointer_stringify_adaptor(callbackId));
|
||||
},
|
||||
WX_RequestSubscribeMessage:function(conf, callbackId) {
|
||||
window.WXWASMSDK.WX_RequestSubscribeMessage(_WXPointer_stringify_adaptor(conf), _WXPointer_stringify_adaptor(callbackId));
|
||||
},
|
||||
@ -392,9 +398,6 @@ WX_OpenChannelsLiveCollection:function(conf, callbackId) {
|
||||
WX_OpenPage:function(conf, callbackId) {
|
||||
window.WXWASMSDK.WX_OpenPage(_WXPointer_stringify_adaptor(conf), _WXPointer_stringify_adaptor(callbackId));
|
||||
},
|
||||
WX_RequestMidasPaymentGameItem:function(conf, callbackId) {
|
||||
window.WXWASMSDK.WX_RequestMidasPaymentGameItem(_WXPointer_stringify_adaptor(conf), _WXPointer_stringify_adaptor(callbackId));
|
||||
},
|
||||
WX_RequestSubscribeLiveActivity:function(conf, callbackId) {
|
||||
window.WXWASMSDK.WX_RequestSubscribeLiveActivity(_WXPointer_stringify_adaptor(conf), _WXPointer_stringify_adaptor(callbackId));
|
||||
},
|
||||
@ -414,9 +417,6 @@ WX_RemoveStorageSync:function(key){
|
||||
WX_ReportEvent:function(eventId, data){
|
||||
window.WXWASMSDK.WX_ReportEvent(_WXPointer_stringify_adaptor(eventId), _WXPointer_stringify_adaptor(data));
|
||||
},
|
||||
WX_ReportMonitor:function(name, value){
|
||||
window.WXWASMSDK.WX_ReportMonitor(_WXPointer_stringify_adaptor(name), value);
|
||||
},
|
||||
WX_ReportPerformance:function(id, value, dimensions){
|
||||
window.WXWASMSDK.WX_ReportPerformance(id, value, _WXPointer_stringify_adaptor(dimensions));
|
||||
},
|
||||
@ -586,6 +586,12 @@ WX_OnMemoryWarning:function() {
|
||||
WX_OffMemoryWarning:function() {
|
||||
window.WXWASMSDK.WX_OffMemoryWarning();
|
||||
},
|
||||
WX_OnMenuButtonBoundingClientRectWeightChange:function() {
|
||||
window.WXWASMSDK.WX_OnMenuButtonBoundingClientRectWeightChange();
|
||||
},
|
||||
WX_OffMenuButtonBoundingClientRectWeightChange:function() {
|
||||
window.WXWASMSDK.WX_OffMenuButtonBoundingClientRectWeightChange();
|
||||
},
|
||||
WX_OnMessage:function() {
|
||||
window.WXWASMSDK.WX_OnMessage();
|
||||
},
|
||||
@ -849,8 +855,9 @@ WX_GetWindowInfo:function(
|
||||
return buffer;
|
||||
},
|
||||
WX_CreateImageData:function(
|
||||
width,height
|
||||
){
|
||||
var res = window.WXWASMSDK.WX_CreateImageData();
|
||||
var res = window.WXWASMSDK.WX_CreateImageData(width,height);
|
||||
var bufferSize = lengthBytesUTF8(res || '') + 1;
|
||||
var buffer = _malloc(bufferSize);
|
||||
stringToUTF8(res, buffer, bufferSize);
|
||||
|
||||
@ -46,8 +46,11 @@ var WXUDPSocketLibrary =
|
||||
WX_UDPSocketSetTTL:function(id, ttl) {
|
||||
window.WXWASMSDK.WX_UDPSocketSetTTL(_WXPointer_stringify_adaptor(id), ttl);
|
||||
},
|
||||
WX_UDPSocketWrite:function(id) {
|
||||
window.WXWASMSDK.WX_UDPSocketWrite(_WXPointer_stringify_adaptor(id));
|
||||
WX_UDPSocketWriteString:function(id, data, param) {
|
||||
window.WXWASMSDK.WX_UDPSocketWriteString(_WXPointer_stringify_adaptor(id), _WXPointer_stringify_adaptor(data), _WXPointer_stringify_adaptor(param));
|
||||
},
|
||||
WX_UDPSocketWriteBuffer:function(id, dataPtr, dataLength, param) {
|
||||
window.WXWASMSDK.WX_UDPSocketWriteBuffer(_WXPointer_stringify_adaptor(id), dataPtr, dataLength, _WXPointer_stringify_adaptor(param));
|
||||
},
|
||||
WX_UDPSocketBind:function(id, port) {
|
||||
var res = window.WXWASMSDK.WX_UDPSocketBind(_WXPointer_stringify_adaptor(id), port);
|
||||
|
||||
@ -269,6 +269,10 @@ var WXAssetBundleLibrary = {
|
||||
var err_msg = !!e ? e.toString() : 'unknown';
|
||||
}
|
||||
var expected_size = WXFS.disk.get(path);
|
||||
if(expected_size === 0){
|
||||
WXFS.disk.set(path, res.byteLength);
|
||||
expected_size = res.byteLength;
|
||||
}
|
||||
if(!res || res.byteLength != expected_size){
|
||||
var wxab_error = {
|
||||
stage: WXFS.WXABErrorSteps['kLoadBundleFromFile'],
|
||||
@ -308,12 +312,16 @@ var WXAssetBundleLibrary = {
|
||||
return buffer;
|
||||
},
|
||||
|
||||
UnCleanbyPath: function (ptr) {
|
||||
UnCleanbyPath: function (ptr, fromFile) {
|
||||
var url = UTF8ToString(ptr);
|
||||
var path = WXFS.url2path(url);
|
||||
if(fromFile && !GameGlobal.manager.fs.accessSync(path)){
|
||||
return false;
|
||||
}
|
||||
if(!WXFS.disk.has(path)){
|
||||
WXFS.disk.set(path, 0);
|
||||
}
|
||||
return true;
|
||||
},
|
||||
|
||||
UnloadbyPath: function (ptr) {
|
||||
|
||||
85
Runtime/Plugins/WxPerfJsBridge.jslib
Normal file
85
Runtime/Plugins/WxPerfJsBridge.jslib
Normal file
@ -0,0 +1,85 @@
|
||||
mergeInto(LibraryManager.library, {
|
||||
|
||||
JSInitProfiler: function(savePathPtr, metaInfoPtr) {
|
||||
const savePath = UTF8ToString(savePathPtr);
|
||||
// const uploadUrl = UTF8ToString(uploadUrlPtr);
|
||||
const metaInfo = UTF8ToString(metaInfoPtr);
|
||||
//if (GameGlobal && GameGlobal.manager && GameGlobal.manager.initProfiler) {
|
||||
const uploadUrl = GameGlobal.managerConfig.PROFILER_UPLOAD_URL;
|
||||
GameGlobal.manager.initProfiler({'savePath': savePath, 'uploadUrl': uploadUrl, 'meta': metaInfo, 'cb': _JSInitProfilerCallback, 'errorCb': _JSProfilerErrorCallback});
|
||||
//}
|
||||
},
|
||||
JSStartProfiler: function() {
|
||||
//const savePath = UTF8ToString(savePathPtr);
|
||||
//const uploadUrl = UTF8ToString(uploadUrlPtr);
|
||||
//const metaInfo = UTF8ToString(metaInfoPtr);
|
||||
//if (GameGlobal && GameGlobal.manager && GameGlobal.manager.profiler) {
|
||||
GameGlobal.manager.profiler.startProfile();
|
||||
//}
|
||||
},
|
||||
StartJSProfilerRecord: function(frameId, interval, savePathPtr) {
|
||||
const savePath = UTF8ToString(savePathPtr);
|
||||
if (GameGlobal && GameGlobal.unityNamespace && GameGlobal.unityNamespace.ProfileWebgl && GameGlobal.unityNamespace.ProfileWebgl.startRecord) {
|
||||
GameGlobal.unityNamespace.ProfileWebgl.startRecord(frameId, interval, savePath);
|
||||
}
|
||||
},
|
||||
StopJSProfilerRecord: function() {
|
||||
if (GameGlobal && GameGlobal.unityNamespace && GameGlobal.unityNamespace.ProfileWebgl && GameGlobal.unityNamespace.ProfileWebgl.stopRecord) {
|
||||
GameGlobal.unityNamespace.ProfileWebgl.stopRecord();
|
||||
}
|
||||
},
|
||||
JSProfilerUploadString: function(dataPtr, bufSize, namePtr, dirPtr, id, inStartFrameIdx, inEndFrameIdx) {
|
||||
//if (GameGlobal && GameGlobal.manager && GameGlobal.manager.profiler) {
|
||||
const name = UTF8ToString(namePtr);
|
||||
const dir = UTF8ToString(dirPtr);
|
||||
const content = UTF8ToString(dataPtr);
|
||||
GameGlobal.manager.profiler.uploadString({'str': content, 'len': bufSize, 'fileName': name, 'uploadDir': dir, 'id': id, 'cb': _JSPerfUploadStringCallback, 'startFrameIdx': inStartFrameIdx, 'endFrameIdx': inEndFrameIdx});
|
||||
//}
|
||||
},
|
||||
JSProfilerUploadAnnotation: function(inAnnotationDataPtr, inFrameIdx) {
|
||||
const annotationData = UTF8ToString(inAnnotationDataPtr);
|
||||
GameGlobal.manager.profiler.uploadAnnotation({'annotationData': annotationData, 'annotationFrameIDX': inFrameIdx});
|
||||
},
|
||||
JSGetMetaDataInfo: function() {
|
||||
var convertPluginVersion = GameGlobal.unityNamespace.convertPluginVersion;
|
||||
var unityHeapReservedMemory = GameGlobal.unityNamespace.unityHeapReservedMemory;
|
||||
var contextType = GameGlobal.managerConfig.contextConfig.contextType;
|
||||
var webglVersion;
|
||||
|
||||
switch (contextType) {
|
||||
case 1:
|
||||
webglVersion = "webgl1";
|
||||
break;
|
||||
case 2:
|
||||
webglVersion = "webgl2";
|
||||
break;
|
||||
case 3:
|
||||
webglVersion = "auto";
|
||||
break;
|
||||
default:
|
||||
webglVersion = "unknown";
|
||||
}
|
||||
|
||||
var metaDataString = "convertPluginVersion="
|
||||
+ convertPluginVersion + "\nwebglVersion=" + webglVersion +
|
||||
"\nunityHeapReservedMemory=" + unityHeapReservedMemory + "\ndpr=" +
|
||||
window.devicePixelRatio + "\n";
|
||||
var lengthBytes = lengthBytesUTF8(metaDataString) + 1;
|
||||
var stringOnWasmHeap = _malloc(lengthBytes);
|
||||
stringToUTF8(metaDataString, stringOnWasmHeap, lengthBytes);
|
||||
|
||||
return stringOnWasmHeap;
|
||||
},
|
||||
|
||||
JSFreeIntPtr: function(ptr) {
|
||||
_free(ptr);
|
||||
},
|
||||
JSProfilerUploadStringWithDir: function(dataPtr, bufSize, namePtr, dirPtr) {
|
||||
//if (GameGlobal && GameGlobal.manager && GameGlobal.manager.profiler) {
|
||||
const name = UTF8ToString(namePtr);
|
||||
const dir = UTF8ToString(dirPtr);
|
||||
const content = UTF8ToString(dataPtr);
|
||||
GameGlobal.manager.profiler.uploadStringWithDir({'str': content, 'len': bufSize, 'fileName': name, 'uploadDir': dir, 'cb': _JSProfilerUploadStringWithDirCallback});
|
||||
//}
|
||||
}
|
||||
});
|
||||
79
Runtime/Plugins/WxPerfJsBridge.jslib.meta
Normal file
79
Runtime/Plugins/WxPerfJsBridge.jslib.meta
Normal file
@ -0,0 +1,79 @@
|
||||
fileFormatVersion: 2
|
||||
guid: de46a37ac18378340bae0bc523c46892
|
||||
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: 0
|
||||
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: 1
|
||||
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/wx-perf.dll
Normal file
BIN
Runtime/Plugins/wx-perf.dll
Normal file
Binary file not shown.
7
Runtime/Plugins/wx-perf.dll.meta
Normal file
7
Runtime/Plugins/wx-perf.dll.meta
Normal file
@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: f0cbdcf50f6d52cea758f1ea825443c0
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
18
Runtime/Plugins/wx-perf.xml
Normal file
18
Runtime/Plugins/wx-perf.xml
Normal file
@ -0,0 +1,18 @@
|
||||
<?xml version="1.0"?>
|
||||
<doc>
|
||||
<assembly>
|
||||
<name>wx-perf</name>
|
||||
</assembly>
|
||||
<members>
|
||||
<member name="M:WXSDKPerf.WXPerfEngine_Implementation.Annotation(System.String)">
|
||||
<summary>
|
||||
This method is used to add an annotation to the performance data.
|
||||
The annotation string is uploaded to the server along with the current frame ID.
|
||||
</summary>
|
||||
<param name="InAnnotationString">The annotation string to be added. It should not be null or empty.</param>
|
||||
<remarks>
|
||||
If the provided annotation string is null or empty, an error message will be logged.
|
||||
</remarks>
|
||||
</member>
|
||||
</members>
|
||||
</doc>
|
||||
7
Runtime/Plugins/wx-perf.xml.meta
Normal file
7
Runtime/Plugins/wx-perf.xml.meta
Normal file
@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 8ea3a597042b1e09596b698c5fcfd06b
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Binary file not shown.
@ -4,25 +4,6 @@
|
||||
<name>wx-runtime-editor</name>
|
||||
</assembly>
|
||||
<members>
|
||||
<member name="T:WeChatWASM.Cloud">
|
||||
<summary>
|
||||
云函数,调用前必须先Init初始化
|
||||
</summary>
|
||||
</member>
|
||||
<member name="M:WeChatWASM.Cloud.Init(WeChatWASM.CallFunctionInitParam)">
|
||||
<summary>
|
||||
初始化,详见 https://developers.weixin.qq.com/minigame/dev/wxcloud/reference-sdk-api/init/client.init.html
|
||||
</summary>
|
||||
<param name="param"></param>
|
||||
</member>
|
||||
<!-- Badly formed XML comment ignored for member "M:WeChatWASM.Cloud.CallFunction(WeChatWASM.CallFunctionParam)" -->
|
||||
<member name="M:WeChatWASM.Cloud.CloudID(System.String)">
|
||||
<summary>
|
||||
声明字符串为 CloudID(开放数据 ID),该接口传入一个字符串,返回一个 CloudID 特殊字符串,将该对象传至云函数可以获取其对应的开放数据。详见 https://developers.weixin.qq.com/minigame/dev/wxcloud/reference-sdk-api/open/Cloud.CloudID.html
|
||||
</summary>
|
||||
<param name="cloudID">通过开放能力在小程序端 / web 端获取得到的 CloudID</param>
|
||||
<returns>返回字符串,原样传回云函数调用就好</returns>
|
||||
</member>
|
||||
<member name="T:WeChatWASM.WXBannerAd">
|
||||
<summary>
|
||||
Banner 广告,详见 https://developers.weixin.qq.com/minigame/dev/guide/open-ability/ad/banner-ad.html
|
||||
@ -293,6 +274,25 @@
|
||||
面板缩放比例,默认大小 40x40,低于 375 宽度的屏幕会等比缩小
|
||||
</summary>
|
||||
</member>
|
||||
<member name="T:WeChatWASM.WXCloud">
|
||||
<summary>
|
||||
云函数,调用前必须先Init初始化
|
||||
</summary>
|
||||
</member>
|
||||
<member name="M:WeChatWASM.WXCloud.Init(WeChatWASM.ICloudConfig)">
|
||||
<summary>
|
||||
初始化,详见 https://developers.weixin.qq.com/minigame/dev/wxcloud/reference-sdk-api/init/client.init.html
|
||||
</summary>
|
||||
<param name="param"></param>
|
||||
</member>
|
||||
<!-- Badly formed XML comment ignored for member "M:WeChatWASM.WXCloud.CallFunction(WeChatWASM.CallFunctionParam)" -->
|
||||
<member name="M:WeChatWASM.WXCloud.CloudID(System.String)">
|
||||
<summary>
|
||||
声明字符串为 CloudID(开放数据 ID),该接口传入一个字符串,返回一个 CloudID 特殊字符串,将该对象传至云函数可以获取其对应的开放数据。详见 https://developers.weixin.qq.com/minigame/dev/wxcloud/reference-sdk-api/open/Cloud.CloudID.html
|
||||
</summary>
|
||||
<param name="cloudID">通过开放能力在小程序端 / web 端获取得到的 CloudID</param>
|
||||
<returns>返回字符串,原样传回云函数调用就好</returns>
|
||||
</member>
|
||||
<member name="T:WeChatWASM.WXCustomAd">
|
||||
<summary>
|
||||
插屏广告组件广告,详见 https://developers.weixin.qq.com/minigame/dev/api/ad/CustomAd.html
|
||||
@ -1422,16 +1422,6 @@
|
||||
视频是否是在用户完整观看的情况下被关闭的,详见 https://developers.weixin.qq.com/minigame/dev/api/ad/RewardedVideoAd.onClose.html
|
||||
</summary>
|
||||
</member>
|
||||
<member name="T:WeChatWASM.WXCloudCallFunctionResponse">
|
||||
<summary>
|
||||
云函数回调 https://developers.weixin.qq.com/minigame/dev/wxcloud/reference-sdk-api/functions/Cloud.callFunction.html
|
||||
</summary>
|
||||
</member>
|
||||
<member name="F:WeChatWASM.WXCloudCallFunctionResponse.result">
|
||||
<summary>
|
||||
后端返回的经过json序列化后的数据
|
||||
</summary>
|
||||
</member>
|
||||
<member name="F:WeChatWASM.ReferrerInfo.extraDataRaw">
|
||||
<summary>
|
||||
对应JS版里的 extraData,这里序列化成JSON字符串
|
||||
@ -1572,31 +1562,6 @@
|
||||
事件触发时的时间戳
|
||||
</summary>
|
||||
</member>
|
||||
<member name="T:WeChatWASM.CallFunctionParam">
|
||||
<summary>
|
||||
调用云函数 https://developers.weixin.qq.com/minigame/dev/wxcloud/reference-sdk-api/functions/Cloud.callFunction.html
|
||||
</summary>
|
||||
</member>
|
||||
<member name="F:WeChatWASM.CallFunctionParam.data">
|
||||
<summary>
|
||||
这里请将数据json序列化为字符串再赋值到data
|
||||
</summary>
|
||||
</member>
|
||||
<member name="T:WeChatWASM.CallFunctionInitParam">
|
||||
<summary>
|
||||
云函数初始化 https://developers.weixin.qq.com/minigame/dev/wxcloud/reference-sdk-api/init/client.init.html
|
||||
</summary>
|
||||
</member>
|
||||
<member name="F:WeChatWASM.CallFunctionInitParam.env">
|
||||
<summary>
|
||||
必填,环境ID,指定接下来调用 API 时访问哪个环境的云资源
|
||||
</summary>
|
||||
</member>
|
||||
<member name="F:WeChatWASM.CallFunctionInitParam.traceUser">
|
||||
<summary>
|
||||
是否在将用户访问记录到用户管理中,在控制台中可见
|
||||
</summary>
|
||||
</member>
|
||||
<member name="F:WeChatWASM.InnerAudioContextParam.src">
|
||||
<summary>
|
||||
音频资源的地址,用于直接播放。可以设置为网络地址,或者unity中的本地路径如 Assets/xx.wav,运行时会自动和配置的音频地址前缀做拼接得到最终线上地址
|
||||
@ -3081,6 +3046,36 @@
|
||||
接口调用成功的回调函数
|
||||
</summary>
|
||||
</member>
|
||||
<member name="F:WeChatWASM.ICloudConfig.env">
|
||||
<summary>
|
||||
必填,环境ID,指定接下来调用 API 时访问哪个环境的云资源
|
||||
</summary>
|
||||
</member>
|
||||
<member name="F:WeChatWASM.ICloudConfig.traceUser">
|
||||
<summary>
|
||||
是否在将用户访问记录到用户管理中,在控制台中可见
|
||||
</summary>
|
||||
</member>
|
||||
<member name="T:WeChatWASM.CallFunctionResult">
|
||||
<summary>
|
||||
云函数回调 https://developers.weixin.qq.com/minigame/dev/wxcloud/reference-sdk-api/functions/Cloud.callFunction.html
|
||||
</summary>
|
||||
</member>
|
||||
<member name="F:WeChatWASM.CallFunctionResult.result">
|
||||
<summary>
|
||||
后端返回的经过json序列化后的数据
|
||||
</summary>
|
||||
</member>
|
||||
<member name="T:WeChatWASM.CallFunctionParam">
|
||||
<summary>
|
||||
调用云函数 https://developers.weixin.qq.com/minigame/dev/wxcloud/reference-sdk-api/functions/Cloud.callFunction.html
|
||||
</summary>
|
||||
</member>
|
||||
<member name="F:WeChatWASM.CallContainerResult.data">
|
||||
<summary>
|
||||
后端返回的经过json序列化后的数据
|
||||
</summary>
|
||||
</member>
|
||||
<member name="F:WeChatWASM.AccountInfo.miniProgram">
|
||||
<summary>
|
||||
小程序账号信息
|
||||
@ -3187,6 +3182,17 @@
|
||||
是否已打开调试。可通过右上角菜单或 [wx.setEnableDebug](https://developers.weixin.qq.com/minigame/dev/api/base/debug/wx.setEnableDebug.html) 打开调试。
|
||||
</summary>
|
||||
</member>
|
||||
<member name="F:WeChatWASM.AppBaseInfo.fontSizeScaleFactor">
|
||||
<summary>
|
||||
微信字体大小缩放比例
|
||||
</summary>
|
||||
</member>
|
||||
<member name="F:WeChatWASM.AppBaseInfo.fontSizeSetting">
|
||||
<summary>
|
||||
需要基础库: `2.23.4`
|
||||
微信字体大小,单位px
|
||||
</summary>
|
||||
</member>
|
||||
<member name="F:WeChatWASM.AppBaseInfo.host">
|
||||
<summary>
|
||||
当前小程序运行的宿主环境
|
||||
@ -3220,6 +3226,12 @@
|
||||
是否正在充电中
|
||||
</summary>
|
||||
</member>
|
||||
<member name="F:WeChatWASM.GetBatteryInfoSyncResult.isLowPowerModeEnabled">
|
||||
<summary>
|
||||
需要基础库: `3.4.3`
|
||||
是否处于省电模式,目前仅 iOS 端支持
|
||||
</summary>
|
||||
</member>
|
||||
<member name="F:WeChatWASM.GetBatteryInfoSyncResult.level">
|
||||
<summary>
|
||||
设备电量,范围 1 - 100
|
||||
@ -3230,11 +3242,7 @@
|
||||
应用(微信APP)二进制接口类型(仅 Android 支持)
|
||||
</summary>
|
||||
</member>
|
||||
<member name="F:WeChatWASM.DeviceInfo.benchmarkLevel">
|
||||
<summary>
|
||||
设备性能等级(仅 Android 支持)。取值为:-2 或 0(该设备无法运行小游戏),-1(性能未知),>=1(设备性能值,该值越高,设备性能越好,目前最高不到50)
|
||||
</summary>
|
||||
</member>
|
||||
<!-- Badly formed XML comment ignored for member "F:WeChatWASM.DeviceInfo.benchmarkLevel" -->
|
||||
<member name="F:WeChatWASM.DeviceInfo.brand">
|
||||
<summary>
|
||||
设备品牌
|
||||
@ -3447,7 +3455,7 @@
|
||||
</member>
|
||||
<member name="F:WeChatWASM.SystemInfo.deviceOrientation">
|
||||
<summary>
|
||||
设备方向
|
||||
设备方向(注意:IOS客户端横屏游戏获取deviceOrientation可能不准,建议以屏幕宽高为准)
|
||||
可选值:
|
||||
- 'portrait': 竖屏;
|
||||
- 'landscape': 横屏;
|
||||
@ -3651,7 +3659,7 @@
|
||||
</member>
|
||||
<member name="F:WeChatWASM.SystemSetting.deviceOrientation">
|
||||
<summary>
|
||||
设备方向
|
||||
设备方向(注意:IOS客户端横屏游戏获取deviceOrientation可能不准,建议以屏幕宽高为准)
|
||||
可选值:
|
||||
- 'portrait': 竖屏;
|
||||
- 'landscape': 横屏;
|
||||
@ -3717,6 +3725,23 @@
|
||||
接口调用结束的回调函数(调用成功、失败都会执行)
|
||||
</summary>
|
||||
</member>
|
||||
<member name="F:WeChatWASM.DownloadFileOption.enableHttp2">
|
||||
<summary>
|
||||
需要基础库: `2.10.4`
|
||||
是否开启 http2
|
||||
</summary>
|
||||
</member>
|
||||
<member name="F:WeChatWASM.DownloadFileOption.enableProfile">
|
||||
<summary>
|
||||
是否开启 profile,默认开启。开启后可在接口回调的 res.profile 中查看性能调试信息。
|
||||
</summary>
|
||||
</member>
|
||||
<member name="F:WeChatWASM.DownloadFileOption.enableQuic">
|
||||
<summary>
|
||||
需要基础库: `2.10.4`
|
||||
是否开启 Quic 协议(gQUIC Q43)
|
||||
</summary>
|
||||
</member>
|
||||
<member name="F:WeChatWASM.DownloadFileOption.fail">
|
||||
<summary>
|
||||
接口调用失败的回调函数
|
||||
@ -3744,6 +3769,12 @@
|
||||
超时时间,单位为毫秒,默认值为 60000 即一分钟。
|
||||
</summary>
|
||||
</member>
|
||||
<member name="F:WeChatWASM.DownloadFileOption.useHighPerformanceMode">
|
||||
<summary>
|
||||
需要基础库: `3.4.1`
|
||||
使用高性能模式,暂仅支持 Android,默认关闭。该模式下有更优的网络性能表现。
|
||||
</summary>
|
||||
</member>
|
||||
<member name="F:WeChatWASM.GeneralCallbackResult.errMsg">
|
||||
<summary>
|
||||
错误信息
|
||||
@ -3895,6 +3926,11 @@
|
||||
传输层根据多个请求评估的当前网络的 rtt(仅供参考)
|
||||
</summary>
|
||||
</member>
|
||||
<member name="F:WeChatWASM.RequestProfile.usingHighPerformanceMode">
|
||||
<summary>
|
||||
是否走到了高性能模式。基础库 v3.3.4 起支持。
|
||||
</summary>
|
||||
</member>
|
||||
<member name="F:WeChatWASM.DownloadTaskOnHeadersReceivedListenerResult.header">
|
||||
<summary>
|
||||
开发者服务器返回的 HTTP Response Header
|
||||
@ -3943,6 +3979,26 @@
|
||||
背景颜色
|
||||
</summary>
|
||||
</member>
|
||||
<member name="F:WeChatWASM.OptionStyle.height">
|
||||
<summary>
|
||||
高度
|
||||
</summary>
|
||||
</member>
|
||||
<member name="F:WeChatWASM.OptionStyle.left">
|
||||
<summary>
|
||||
左上角横坐标
|
||||
</summary>
|
||||
</member>
|
||||
<member name="F:WeChatWASM.OptionStyle.top">
|
||||
<summary>
|
||||
左上角纵坐标
|
||||
</summary>
|
||||
</member>
|
||||
<member name="F:WeChatWASM.OptionStyle.width">
|
||||
<summary>
|
||||
宽度
|
||||
</summary>
|
||||
</member>
|
||||
<member name="F:WeChatWASM.OptionStyle.borderColor">
|
||||
<summary>
|
||||
边框颜色
|
||||
@ -3968,16 +4024,6 @@
|
||||
字号
|
||||
</summary>
|
||||
</member>
|
||||
<member name="F:WeChatWASM.OptionStyle.height">
|
||||
<summary>
|
||||
高度
|
||||
</summary>
|
||||
</member>
|
||||
<member name="F:WeChatWASM.OptionStyle.left">
|
||||
<summary>
|
||||
左上角横坐标
|
||||
</summary>
|
||||
</member>
|
||||
<member name="F:WeChatWASM.OptionStyle.lineHeight">
|
||||
<summary>
|
||||
文本的行高
|
||||
@ -3992,16 +4038,6 @@
|
||||
- 'right': 居右;
|
||||
</summary>
|
||||
</member>
|
||||
<member name="F:WeChatWASM.OptionStyle.top">
|
||||
<summary>
|
||||
左上角纵坐标
|
||||
</summary>
|
||||
</member>
|
||||
<member name="F:WeChatWASM.OptionStyle.width">
|
||||
<summary>
|
||||
宽度
|
||||
</summary>
|
||||
</member>
|
||||
<member name="F:WeChatWASM.ImageData.data">
|
||||
<summary>
|
||||
一维数组,包含以 RGBA 顺序的数据,数据使用 0 至 255(包含)的整数表示
|
||||
@ -4159,7 +4195,7 @@
|
||||
</member>
|
||||
<member name="F:WeChatWASM.AuthPrivateMessageOption.shareTicket">
|
||||
<summary>
|
||||
shareTicket。可以从 wx.onShow 中获取。详情 [shareTicket](#)
|
||||
shareTicket。可以从 wx.getEnterOptionsSync 中获取。详情 [shareTicket](#)
|
||||
</summary>
|
||||
</member>
|
||||
<member name="F:WeChatWASM.AuthPrivateMessageOption.complete">
|
||||
@ -4748,7 +4784,7 @@
|
||||
开始广播本地创建的外围设备。
|
||||
**注意**
|
||||
- Android 8.0.9 开始,支持直接使用 16/32/128 位 UUID;
|
||||
- Android 8.0.9 以下版本只支持 128 位 UUID,使用 16/32 位的 UUID 时需要进行补位(系统会自动识别是否属于预分配区间),可以参考[蓝牙指南](#);
|
||||
- Android 8.0.9 以下版本只支持 128 位 UUID,使用 16/32 位的 UUID 时需要进行补位(系统会自动识别是否属于预分配区间),可以参考[蓝牙指南](https://developers.weixin.qq.com/minigame/dev/guide/device/ble.html);
|
||||
- iOS 必须直接使用 16 位的 UUID,不能补位到 128 位,否则系统组包时仍会按照 128 位传输。iOS 暂不支持 32 位 UUID。
|
||||
- iOS 同时只能发起一个广播,安卓支持同时发起多个广播。
|
||||
- 传 beacon 参数时,不能同时传入 deviceName,serviceUuids,manufacturerData 参数。
|
||||
@ -5534,6 +5570,12 @@
|
||||
是否正在充电中
|
||||
</summary>
|
||||
</member>
|
||||
<member name="F:WeChatWASM.GetBatteryInfoSuccessCallbackResult.isLowPowerModeEnabled">
|
||||
<summary>
|
||||
需要基础库: `3.4.3`
|
||||
是否处于省电模式,目前仅 iOS 端支持
|
||||
</summary>
|
||||
</member>
|
||||
<member name="F:WeChatWASM.GetBatteryInfoSuccessCallbackResult.level">
|
||||
<summary>
|
||||
设备电量,范围 1 - 100
|
||||
@ -5902,6 +5944,23 @@
|
||||
蓝牙设备名称,某些设备可能没有
|
||||
</summary>
|
||||
</member>
|
||||
<member name="F:WeChatWASM.GetDeviceBenchmarkInfoOption.complete">
|
||||
<summary>
|
||||
接口调用结束的回调函数(调用成功、失败都会执行)
|
||||
</summary>
|
||||
</member>
|
||||
<member name="F:WeChatWASM.GetDeviceBenchmarkInfoOption.fail">
|
||||
<summary>
|
||||
接口调用失败的回调函数
|
||||
</summary>
|
||||
</member>
|
||||
<member name="F:WeChatWASM.GetDeviceBenchmarkInfoOption.success">
|
||||
<summary>
|
||||
接口调用成功的回调函数
|
||||
</summary>
|
||||
</member>
|
||||
<!-- Badly formed XML comment ignored for member "F:WeChatWASM.GetDeviceBenchmarkInfoSuccessCallbackResult.benchmarkLevel" -->
|
||||
<!-- Badly formed XML comment ignored for member "F:WeChatWASM.GetDeviceBenchmarkInfoSuccessCallbackResult.modelLevel" -->
|
||||
<member name="F:WeChatWASM.GetExtConfigOption.complete">
|
||||
<summary>
|
||||
接口调用结束的回调函数(调用成功、失败都会执行)
|
||||
@ -6020,6 +6079,24 @@
|
||||
接口调用成功的回调函数
|
||||
</summary>
|
||||
</member>
|
||||
<member name="F:WeChatWASM.GetGroupEnterInfoError.errMsg">
|
||||
<summary>
|
||||
错误信息
|
||||
| 错误码 | 错误信息 | 说明 |
|
||||
| - | - | - |
|
||||
| 40097 | | 场景错误 |
|
||||
| 65206 | | 用户已不在该群内 |
|
||||
</summary>
|
||||
</member>
|
||||
<member name="F:WeChatWASM.GetGroupEnterInfoError.errCode">
|
||||
<summary>
|
||||
错误码
|
||||
| 错误码 | 错误信息 | 说明 |
|
||||
| - | - | - |
|
||||
| 40097 | | 场景错误 |
|
||||
| 65206 | | 用户已不在该群内 |
|
||||
</summary>
|
||||
</member>
|
||||
<member name="F:WeChatWASM.GetGroupEnterInfoSuccessCallbackResult.cloudID">
|
||||
<summary>
|
||||
需要基础库: `2.7.0`
|
||||
@ -6252,7 +6329,7 @@
|
||||
</member>
|
||||
<member name="F:WeChatWASM.GetShareInfoOption.shareTicket">
|
||||
<summary>
|
||||
shareTicket
|
||||
shareTicket,详见[获取更多转发信息](#)
|
||||
</summary>
|
||||
</member>
|
||||
<member name="F:WeChatWASM.GetShareInfoOption.complete">
|
||||
@ -7105,6 +7182,36 @@
|
||||
- 15: TRIM_MEMORY_RUNNING_CRITICAL;
|
||||
</summary>
|
||||
</member>
|
||||
<member name="F:WeChatWASM.OnMenuButtonBoundingClientRectWeightChangeListenerResult.bottom">
|
||||
<summary>
|
||||
下边界坐标,单位:px
|
||||
</summary>
|
||||
</member>
|
||||
<member name="F:WeChatWASM.OnMenuButtonBoundingClientRectWeightChangeListenerResult.height">
|
||||
<summary>
|
||||
高度,单位:px
|
||||
</summary>
|
||||
</member>
|
||||
<member name="F:WeChatWASM.OnMenuButtonBoundingClientRectWeightChangeListenerResult.left">
|
||||
<summary>
|
||||
左边界坐标,单位:px
|
||||
</summary>
|
||||
</member>
|
||||
<member name="F:WeChatWASM.OnMenuButtonBoundingClientRectWeightChangeListenerResult.right">
|
||||
<summary>
|
||||
右边界坐标,单位:px
|
||||
</summary>
|
||||
</member>
|
||||
<member name="F:WeChatWASM.OnMenuButtonBoundingClientRectWeightChangeListenerResult.top">
|
||||
<summary>
|
||||
上边界坐标,单位:px
|
||||
</summary>
|
||||
</member>
|
||||
<member name="F:WeChatWASM.OnMenuButtonBoundingClientRectWeightChangeListenerResult.width">
|
||||
<summary>
|
||||
宽度,单位:px
|
||||
</summary>
|
||||
</member>
|
||||
<member name="F:WeChatWASM.OnMouseDownListenerResult.button">
|
||||
<summary>
|
||||
按键类型,0左键,1中键,2右键
|
||||
@ -7275,6 +7382,12 @@
|
||||
拒绝原因,一般是一个 Error 对象
|
||||
</summary>
|
||||
</member>
|
||||
<member name="F:WeChatWASM.OnUserCaptureScreenListenerResult.query">
|
||||
<summary>
|
||||
需要基础库: `3.3.0`
|
||||
支持开发者自定义一键打开小程序时的 query
|
||||
</summary>
|
||||
</member>
|
||||
<member name="F:WeChatWASM.OnVoIPChatInterruptedListenerResult.errCode">
|
||||
<summary>
|
||||
错误码
|
||||
@ -8200,11 +8313,6 @@
|
||||
分区 ID
|
||||
</summary>
|
||||
</member>
|
||||
<member name="F:WeChatWASM.RequestMidasPaymentOption.extraInfo">
|
||||
<summary>
|
||||
其他参数
|
||||
</summary>
|
||||
</member>
|
||||
<member name="F:WeChatWASM.MidasPaymentError.errMsg">
|
||||
<summary>
|
||||
错误信息
|
||||
@ -8212,6 +8320,7 @@
|
||||
| - | - | - |
|
||||
| -1 | | 系统失败 |
|
||||
| -2 | | 支付取消 |
|
||||
| -6 | | 下单参数类型不对 |
|
||||
| -15001 | | 虚拟支付接口错误码,缺少参数 |
|
||||
| -15002 | | 虚拟支付接口错误码,参数不合法 |
|
||||
| -15003 | | 虚拟支付接口错误码,订单重复 |
|
||||
@ -8221,6 +8330,9 @@
|
||||
| -15007 | | 虚拟支付接口错误码,订单已支付 |
|
||||
| -15009 | | 虚拟支付接口错误码,由于健康系统限制,本次支付已超过限额(这种错误情况会有默认弹窗提示) |
|
||||
| -15010 | | 虚拟支付接口错误码,正式版小游戏不允许在沙箱环境支付 |
|
||||
| -15011 | | 请求的数据类型错误 |
|
||||
| -15013 | | 代币未发布 |
|
||||
| -15017 | | 订单已关闭 |
|
||||
| 1 | | 虚拟支付接口错误码,用户取消支付 |
|
||||
| 2 | | 虚拟支付接口错误码,客户端错误,判断到小程序在用户处于支付中时,又发起了一笔支付请求 |
|
||||
| 3 | | 虚拟支付接口错误码,Android独有错误:用户使用GooglePlay支付,而手机未安装GooglePlay |
|
||||
@ -8230,7 +8342,9 @@
|
||||
| 7 | | 虚拟支付接口错误码,支付取消 |
|
||||
| 1000 | | 参数错误 |
|
||||
| 1001 | | 分区未发布 |
|
||||
| 1003 | | 米大师Portal错误 |
|
||||
| 1003 | | 代币/分区未发布或者对应商户号被封禁或者米大师Portal错误,请先确保虚拟支付2.0代币和分区已发布,然后自查商户号封禁情况https://kf.qq.com/faq/190523Mb6VRJ190523RV363E.html,对应的商户号可以在mp-虚拟支付2.0-基础配置-微信支付账号信息中查询 |
|
||||
| 3017/-15012 | | 道具id非法 |
|
||||
| 701001 | | ios禁止支付 |
|
||||
</summary>
|
||||
</member>
|
||||
<member name="F:WeChatWASM.MidasPaymentError.errCode">
|
||||
@ -8240,6 +8354,7 @@
|
||||
| - | - | - |
|
||||
| -1 | | 系统失败 |
|
||||
| -2 | | 支付取消 |
|
||||
| -6 | | 下单参数类型不对 |
|
||||
| -15001 | | 虚拟支付接口错误码,缺少参数 |
|
||||
| -15002 | | 虚拟支付接口错误码,参数不合法 |
|
||||
| -15003 | | 虚拟支付接口错误码,订单重复 |
|
||||
@ -8249,6 +8364,9 @@
|
||||
| -15007 | | 虚拟支付接口错误码,订单已支付 |
|
||||
| -15009 | | 虚拟支付接口错误码,由于健康系统限制,本次支付已超过限额(这种错误情况会有默认弹窗提示) |
|
||||
| -15010 | | 虚拟支付接口错误码,正式版小游戏不允许在沙箱环境支付 |
|
||||
| -15011 | | 请求的数据类型错误 |
|
||||
| -15013 | | 代币未发布 |
|
||||
| -15017 | | 订单已关闭 |
|
||||
| 1 | | 虚拟支付接口错误码,用户取消支付 |
|
||||
| 2 | | 虚拟支付接口错误码,客户端错误,判断到小程序在用户处于支付中时,又发起了一笔支付请求 |
|
||||
| 3 | | 虚拟支付接口错误码,Android独有错误:用户使用GooglePlay支付,而手机未安装GooglePlay |
|
||||
@ -8258,7 +8376,9 @@
|
||||
| 7 | | 虚拟支付接口错误码,支付取消 |
|
||||
| 1000 | | 参数错误 |
|
||||
| 1001 | | 分区未发布 |
|
||||
| 1003 | | 米大师Portal错误 |
|
||||
| 1003 | | 代币/分区未发布或者对应商户号被封禁或者米大师Portal错误,请先确保虚拟支付2.0代币和分区已发布,然后自查商户号封禁情况https://kf.qq.com/faq/190523Mb6VRJ190523RV363E.html,对应的商户号可以在mp-虚拟支付2.0-基础配置-微信支付账号信息中查询 |
|
||||
| 3017/-15012 | | 道具id非法 |
|
||||
| 701001 | | ios禁止支付 |
|
||||
</summary>
|
||||
</member>
|
||||
<member name="F:WeChatWASM.RequestMidasPaymentFailCallbackErr.errCode">
|
||||
@ -8271,11 +8391,116 @@
|
||||
错误信息
|
||||
</summary>
|
||||
</member>
|
||||
<member name="F:WeChatWASM.RequestMidasPaymentFailCallbackErr.errno">
|
||||
<summary>
|
||||
错误码
|
||||
</summary>
|
||||
</member>
|
||||
<member name="F:WeChatWASM.RequestMidasPaymentSuccessCallbackResult.errMsg">
|
||||
<summary>
|
||||
调用成功信息
|
||||
</summary>
|
||||
</member>
|
||||
<!-- Badly formed XML comment ignored for member "F:WeChatWASM.RequestMidasPaymentGameItemOption.paySig" -->
|
||||
<member name="F:WeChatWASM.RequestMidasPaymentGameItemOption.signData">
|
||||
<summary>
|
||||
<b>支付原串</b>
|
||||
具体支付参数见下面的signData,需要将数据以json格式传递
|
||||
signData例子:
|
||||
'{"mode":"goods","offerId":"123","buyQuantity":1,"env":0,"currencyType":"CNY","platform":"android","zoneId":"1","productId":"testproductId","goodsPrice":10,"outTradeNo":"xxxxxx","attach":"testdata"}'
|
||||
</summary>
|
||||
</member>
|
||||
<member name="F:WeChatWASM.RequestMidasPaymentGameItemOption.signature">
|
||||
<summary>
|
||||
<b>用户态签名</b>
|
||||
signature参数签名算法参考[用户态签名](https://developers.weixin.qq.com/minigame/dev/guide/open-ability/signature.html#%E7%94%A8%E6%88%B7%E7%99%BB%E5%BD%95%E6%80%81%E7%AD%BE%E5%90%8D)
|
||||
可参考[calc_signature](https://docs.qq.com/doc/DVUN0QWJja0J5c2x4)
|
||||
</summary>
|
||||
</member>
|
||||
<member name="F:WeChatWASM.RequestMidasPaymentGameItemOption.complete">
|
||||
<summary>
|
||||
接口调用结束的回调函数(调用成功、失败都会执行)
|
||||
</summary>
|
||||
</member>
|
||||
<member name="F:WeChatWASM.RequestMidasPaymentGameItemOption.fail">
|
||||
<summary>
|
||||
接口调用失败的回调函数
|
||||
</summary>
|
||||
</member>
|
||||
<member name="F:WeChatWASM.RequestMidasPaymentGameItemOption.success">
|
||||
<summary>
|
||||
接口调用成功的回调函数
|
||||
</summary>
|
||||
</member>
|
||||
<member name="F:WeChatWASM.SignData1.buyQuantity">
|
||||
<summary>
|
||||
<b>购买数量</b>
|
||||
</summary>
|
||||
</member>
|
||||
<member name="F:WeChatWASM.SignData1.currencyType">
|
||||
<summary>
|
||||
<b>币种</b>
|
||||
可选值:
|
||||
- 'CNY': 人民币;
|
||||
</summary>
|
||||
</member>
|
||||
<member name="F:WeChatWASM.SignData1.goodsPrice">
|
||||
<summary>
|
||||
<b>道具单价(分)</b>
|
||||
用来校验价格与后台道具价格是否一致,避免用户在业务商城页看到的价格与实际价格不一致导致投诉
|
||||
</summary>
|
||||
</member>
|
||||
<member name="F:WeChatWASM.SignData1.mode">
|
||||
<summary>
|
||||
<b>支付的类型</b>
|
||||
不同的支付类型有各自额外要传的附加参数
|
||||
</summary>
|
||||
</member>
|
||||
<member name="F:WeChatWASM.SignData1.offerId">
|
||||
<summary>
|
||||
<b>在米大师侧申请的应用id</b>
|
||||
mp-支付基础配置中的offerid
|
||||
</summary>
|
||||
</member>
|
||||
<member name="F:WeChatWASM.SignData1.outTradeNo">
|
||||
<summary>
|
||||
<b>业务订单号</b>
|
||||
每个订单号只能使用一次,重复使用会失败(极端情况不保证唯一,不建议业务强依赖唯一性)。
|
||||
要求32个字符内,只能是数字、大小写字母、符号 _-|*@组成,不能以下划线(_)开头。
|
||||
若没有传入,则平台会自动填充一个,并以下划线开头。
|
||||
</summary>
|
||||
</member>
|
||||
<member name="F:WeChatWASM.SignData1.productId">
|
||||
<summary>
|
||||
<b>道具ID</b>
|
||||
</summary>
|
||||
</member>
|
||||
<member name="F:WeChatWASM.SignData1.attach">
|
||||
<summary>
|
||||
<b>透传数据</b>
|
||||
发货通知时会透传给开发者
|
||||
</summary>
|
||||
</member>
|
||||
<member name="F:WeChatWASM.SignData1.env">
|
||||
<summary>
|
||||
<b>环境配置</b>
|
||||
可选值:
|
||||
- 0: 米大师正式环境;
|
||||
- 1: 米大师沙箱环境;
|
||||
</summary>
|
||||
</member>
|
||||
<member name="F:WeChatWASM.SignData1.platform">
|
||||
<summary>
|
||||
<b>平台</b>
|
||||
可选值:
|
||||
- 'android': 安卓;
|
||||
</summary>
|
||||
</member>
|
||||
<member name="F:WeChatWASM.SignData1.zoneId">
|
||||
<summary>
|
||||
<b>分区ID</b>
|
||||
</summary>
|
||||
</member>
|
||||
<member name="F:WeChatWASM.RequestSubscribeMessageOption.tmplIds">
|
||||
<summary>
|
||||
需要订阅的消息模板的id的集合,一次调用最多可订阅3条消息(注意:iOS客户端7.0.6版本、Android客户端7.0.7版本之后的一次性订阅/长期订阅才支持多个模板消息,iOS客户端7.0.5版本、Android客户端7.0.6版本之前的一次订阅只支持一个模板消息)消息模板id在[微信公众平台(mp.weixin.qq.com)-功能-订阅消息]中配置。每个tmplId对应的模板标题需要不相同,否则会被过滤。
|
||||
@ -9021,7 +9246,7 @@
|
||||
<member name="F:WeChatWASM.ShowShareImageMenuOption.needShowEntrance">
|
||||
<summary>
|
||||
需要基础库: `3.2.0`
|
||||
分享的图片消息是否要带小程序入口
|
||||
分享的图片消息是否要带小程序入口 (仅部分小程序类目可用)
|
||||
</summary>
|
||||
</member>
|
||||
<member name="F:WeChatWASM.ShowShareImageMenuOption.style">
|
||||
@ -9400,6 +9625,11 @@
|
||||
参数列表
|
||||
</summary>
|
||||
</member>
|
||||
<member name="F:WeChatWASM.UpdatableMessageFrontEndTemplateInfo.templateId">
|
||||
<summary>
|
||||
模板ID
|
||||
</summary>
|
||||
</member>
|
||||
<member name="F:WeChatWASM.UpdatableMessageFrontEndParameter.name">
|
||||
<summary>
|
||||
参数名
|
||||
@ -9716,101 +9946,6 @@
|
||||
接口调用成功的回调函数
|
||||
</summary>
|
||||
</member>
|
||||
<member name="F:WeChatWASM.RequestMidasPaymentGameItemOption.signData">
|
||||
<summary>
|
||||
支付原串
|
||||
</summary>
|
||||
</member>
|
||||
<member name="F:WeChatWASM.RequestMidasPaymentGameItemOption.paySig">
|
||||
<summary>
|
||||
支付签名
|
||||
</summary>
|
||||
</member>
|
||||
<member name="F:WeChatWASM.RequestMidasPaymentGameItemOption.signature">
|
||||
<summary>
|
||||
用户态签名
|
||||
</summary>
|
||||
</member>
|
||||
<member name="F:WeChatWASM.RequestMidasPaymentGameItemOption.extraInfo">
|
||||
<summary>
|
||||
其他参数
|
||||
</summary>
|
||||
</member>
|
||||
<member name="F:WeChatWASM.RequestMidasPaymentGameItemOption.complete">
|
||||
<summary>
|
||||
接口调用结束的回调函数(调用成功、失败都会执行)
|
||||
</summary>
|
||||
</member>
|
||||
<member name="F:WeChatWASM.RequestMidasPaymentGameItemOption.fail">
|
||||
<summary>
|
||||
接口调用失败的回调函数
|
||||
</summary>
|
||||
</member>
|
||||
<member name="F:WeChatWASM.RequestMidasPaymentGameItemOption.success">
|
||||
<summary>
|
||||
接口调用成功的回调函数
|
||||
</summary>
|
||||
</member>
|
||||
<member name="F:WeChatWASM.MidasPaymentGameItemError.errMsg">
|
||||
<summary>
|
||||
错误信息
|
||||
| 错误码 | 错误信息 | 说明 |
|
||||
| - | - | - |
|
||||
| -1 | | 系统失败 |
|
||||
| -2 | | 支付取消 |
|
||||
| -15001 | | 虚拟支付接口错误码,缺少参数 |
|
||||
| -15002 | | 虚拟支付接口错误码,参数不合法 |
|
||||
| -15003 | | 虚拟支付接口错误码,订单重复 |
|
||||
| -15004 | | 虚拟支付接口错误码,后台错误 |
|
||||
| -15005 | | 虚拟支付接口错误码,appId权限被封禁 |
|
||||
| -15006 | | 虚拟支付接口错误码,货币类型不支持 |
|
||||
| -15007 | | 虚拟支付接口错误码,订单已支付 |
|
||||
| -15009 | | 虚拟支付接口错误码,由于健康系统限制,本次支付已超过限额(这种错误情况会有默认弹窗提示) |
|
||||
| -15010 | | 虚拟支付接口错误码,正式版小游戏不允许在沙箱环境支付 |
|
||||
| 1 | | 虚拟支付接口错误码,用户取消支付 |
|
||||
| 2 | | 虚拟支付接口错误码,客户端错误,判断到小程序在用户处于支付中时,又发起了一笔支付请求 |
|
||||
| 3 | | 虚拟支付接口错误码,Android独有错误:用户使用GooglePlay支付,而手机未安装GooglePlay |
|
||||
| 4 | | 虚拟支付接口错误码,用户操作系统支付状态异常 |
|
||||
| 5 | | 虚拟支付接口错误码,操作系统错误 |
|
||||
| 6 | | 虚拟支付接口错误码,其他错误 |
|
||||
| 7 | | 虚拟支付接口错误码,支付取消 |
|
||||
| 1000 | | 参数错误 |
|
||||
| 1001 | | 分区未发布 |
|
||||
| 1003 | | 米大师Portal错误 |
|
||||
</summary>
|
||||
</member>
|
||||
<member name="F:WeChatWASM.MidasPaymentGameItemError.errCode">
|
||||
<summary>
|
||||
错误码
|
||||
| 错误码 | 错误信息 | 说明 |
|
||||
| - | - | - |
|
||||
| -1 | | 系统失败 |
|
||||
| -2 | | 支付取消 |
|
||||
| -15001 | | 虚拟支付接口错误码,缺少参数 |
|
||||
| -15002 | | 虚拟支付接口错误码,参数不合法 |
|
||||
| -15003 | | 虚拟支付接口错误码,订单重复 |
|
||||
| -15004 | | 虚拟支付接口错误码,后台错误 |
|
||||
| -15005 | | 虚拟支付接口错误码,appId权限被封禁 |
|
||||
| -15006 | | 虚拟支付接口错误码,货币类型不支持 |
|
||||
| -15007 | | 虚拟支付接口错误码,订单已支付 |
|
||||
| -15009 | | 虚拟支付接口错误码,由于健康系统限制,本次支付已超过限额(这种错误情况会有默认弹窗提示) |
|
||||
| -15010 | | 虚拟支付接口错误码,正式版小游戏不允许在沙箱环境支付 |
|
||||
| -15012 | | 虚拟支付接口错误码,小游戏用户态签名错误 |
|
||||
| -15014 | | 虚拟支付接口错误码,小游戏支付签名错误 |
|
||||
| -15015 | | sessionkey过期 |
|
||||
| -15016 | | goodsprice道具价格错误 |
|
||||
| 1 | | 虚拟支付接口错误码,用户取消支付 |
|
||||
| 2 | | 虚拟支付接口错误码,客户端错误,判断到小程序在用户处于支付中时,又发起了一笔支付请求 |
|
||||
| 3 | | 虚拟支付接口错误码,Android独有错误:用户使用GooglePlay支付,而手机未安装GooglePlay |
|
||||
| 4 | | 虚拟支付接口错误码,用户操作系统支付状态异常 |
|
||||
| 5 | | 虚拟支付接口错误码,操作系统错误 |
|
||||
| 6 | | 虚拟支付接口错误码,其他错误 |
|
||||
| 7 | | 虚拟支付接口错误码,支付取消 |
|
||||
| 1000 | | 参数错误 |
|
||||
| 1001 | | 分区未发布 |
|
||||
| 1003 | | 米大师Portal错误 |
|
||||
</summary>
|
||||
</member>
|
||||
<member name="F:WeChatWASM.RequestSubscribeLiveActivityOption.complete">
|
||||
<summary>
|
||||
接口调用结束的回调函数(调用成功、失败都会执行)
|
||||
@ -10273,7 +10408,7 @@
|
||||
设置 IP_TTL 套接字选项,用于设置一个 IP 数据包传输时允许的最大跳步数
|
||||
</summary>
|
||||
</member>
|
||||
<member name="M:WeChatWASM.WXUDPSocket.Write">
|
||||
<member name="M:WeChatWASM.WXUDPSocket.Write(WeChatWASM.UDPSocketSendOption)">
|
||||
<summary>
|
||||
[UDPSocket.write()](https://developers.weixin.qq.com/minigame/dev/api/network/udp/UDPSocket.write.html)
|
||||
需要基础库: `2.15.0`
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
fileFormatVersion: 2
|
||||
guid: ff1c8cafe7253ab3b25ac0da12acf740
|
||||
guid: 57aa93b43d006f13c8e05e350d6cd32f
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
|
||||
Binary file not shown.
@ -4,25 +4,12 @@
|
||||
<name>wx-runtime</name>
|
||||
</assembly>
|
||||
<members>
|
||||
<member name="T:WeChatWASM.Cloud">
|
||||
<member name="T:PlayerPrefs">
|
||||
<summary>
|
||||
云函数,调用前必须先Init初始化
|
||||
覆盖unity的PlayerPrefs
|
||||
注意:调用均为同步调用, 容易阻塞游戏主线程造成卡顿,不建议频繁调用
|
||||
</summary>
|
||||
</member>
|
||||
<member name="M:WeChatWASM.Cloud.Init(WeChatWASM.CallFunctionInitParam)">
|
||||
<summary>
|
||||
初始化,详见 https://developers.weixin.qq.com/minigame/dev/wxcloud/reference-sdk-api/init/client.init.html
|
||||
</summary>
|
||||
<param name="param"></param>
|
||||
</member>
|
||||
<!-- Badly formed XML comment ignored for member "M:WeChatWASM.Cloud.CallFunction(WeChatWASM.CallFunctionParam)" -->
|
||||
<member name="M:WeChatWASM.Cloud.CloudID(System.String)">
|
||||
<summary>
|
||||
声明字符串为 CloudID(开放数据 ID),该接口传入一个字符串,返回一个 CloudID 特殊字符串,将该对象传至云函数可以获取其对应的开放数据。详见 https://developers.weixin.qq.com/minigame/dev/wxcloud/reference-sdk-api/open/Cloud.CloudID.html
|
||||
</summary>
|
||||
<param name="cloudID">通过开放能力在小程序端 / web 端获取得到的 CloudID</param>
|
||||
<returns>返回字符串,原样传回云函数调用就好</returns>
|
||||
</member>
|
||||
<member name="T:WeChatWASM.WXBannerAd">
|
||||
<summary>
|
||||
Banner 广告,详见 https://developers.weixin.qq.com/minigame/dev/guide/open-ability/ad/banner-ad.html
|
||||
@ -293,6 +280,25 @@
|
||||
面板缩放比例,默认大小 40x40,低于 375 宽度的屏幕会等比缩小
|
||||
</summary>
|
||||
</member>
|
||||
<member name="T:WeChatWASM.WXCloud">
|
||||
<summary>
|
||||
云函数,调用前必须先Init初始化
|
||||
</summary>
|
||||
</member>
|
||||
<member name="M:WeChatWASM.WXCloud.Init(WeChatWASM.ICloudConfig)">
|
||||
<summary>
|
||||
初始化,详见 https://developers.weixin.qq.com/minigame/dev/wxcloud/reference-sdk-api/init/client.init.html
|
||||
</summary>
|
||||
<param name="param"></param>
|
||||
</member>
|
||||
<!-- Badly formed XML comment ignored for member "M:WeChatWASM.WXCloud.CallFunction(WeChatWASM.CallFunctionParam)" -->
|
||||
<member name="M:WeChatWASM.WXCloud.CloudID(System.String)">
|
||||
<summary>
|
||||
声明字符串为 CloudID(开放数据 ID),该接口传入一个字符串,返回一个 CloudID 特殊字符串,将该对象传至云函数可以获取其对应的开放数据。详见 https://developers.weixin.qq.com/minigame/dev/wxcloud/reference-sdk-api/open/Cloud.CloudID.html
|
||||
</summary>
|
||||
<param name="cloudID">通过开放能力在小程序端 / web 端获取得到的 CloudID</param>
|
||||
<returns>返回字符串,原样传回云函数调用就好</returns>
|
||||
</member>
|
||||
<member name="T:WeChatWASM.WXCustomAd">
|
||||
<summary>
|
||||
插屏广告组件广告,详见 https://developers.weixin.qq.com/minigame/dev/api/ad/CustomAd.html
|
||||
@ -1422,16 +1428,6 @@
|
||||
视频是否是在用户完整观看的情况下被关闭的,详见 https://developers.weixin.qq.com/minigame/dev/api/ad/RewardedVideoAd.onClose.html
|
||||
</summary>
|
||||
</member>
|
||||
<member name="T:WeChatWASM.WXCloudCallFunctionResponse">
|
||||
<summary>
|
||||
云函数回调 https://developers.weixin.qq.com/minigame/dev/wxcloud/reference-sdk-api/functions/Cloud.callFunction.html
|
||||
</summary>
|
||||
</member>
|
||||
<member name="F:WeChatWASM.WXCloudCallFunctionResponse.result">
|
||||
<summary>
|
||||
后端返回的经过json序列化后的数据
|
||||
</summary>
|
||||
</member>
|
||||
<member name="F:WeChatWASM.ReferrerInfo.extraDataRaw">
|
||||
<summary>
|
||||
对应JS版里的 extraData,这里序列化成JSON字符串
|
||||
@ -1572,31 +1568,6 @@
|
||||
事件触发时的时间戳
|
||||
</summary>
|
||||
</member>
|
||||
<member name="T:WeChatWASM.CallFunctionParam">
|
||||
<summary>
|
||||
调用云函数 https://developers.weixin.qq.com/minigame/dev/wxcloud/reference-sdk-api/functions/Cloud.callFunction.html
|
||||
</summary>
|
||||
</member>
|
||||
<member name="F:WeChatWASM.CallFunctionParam.data">
|
||||
<summary>
|
||||
这里请将数据json序列化为字符串再赋值到data
|
||||
</summary>
|
||||
</member>
|
||||
<member name="T:WeChatWASM.CallFunctionInitParam">
|
||||
<summary>
|
||||
云函数初始化 https://developers.weixin.qq.com/minigame/dev/wxcloud/reference-sdk-api/init/client.init.html
|
||||
</summary>
|
||||
</member>
|
||||
<member name="F:WeChatWASM.CallFunctionInitParam.env">
|
||||
<summary>
|
||||
必填,环境ID,指定接下来调用 API 时访问哪个环境的云资源
|
||||
</summary>
|
||||
</member>
|
||||
<member name="F:WeChatWASM.CallFunctionInitParam.traceUser">
|
||||
<summary>
|
||||
是否在将用户访问记录到用户管理中,在控制台中可见
|
||||
</summary>
|
||||
</member>
|
||||
<member name="F:WeChatWASM.InnerAudioContextParam.src">
|
||||
<summary>
|
||||
音频资源的地址,用于直接播放。可以设置为网络地址,或者unity中的本地路径如 Assets/xx.wav,运行时会自动和配置的音频地址前缀做拼接得到最终线上地址
|
||||
@ -3081,6 +3052,36 @@
|
||||
接口调用成功的回调函数
|
||||
</summary>
|
||||
</member>
|
||||
<member name="F:WeChatWASM.ICloudConfig.env">
|
||||
<summary>
|
||||
必填,环境ID,指定接下来调用 API 时访问哪个环境的云资源
|
||||
</summary>
|
||||
</member>
|
||||
<member name="F:WeChatWASM.ICloudConfig.traceUser">
|
||||
<summary>
|
||||
是否在将用户访问记录到用户管理中,在控制台中可见
|
||||
</summary>
|
||||
</member>
|
||||
<member name="T:WeChatWASM.CallFunctionResult">
|
||||
<summary>
|
||||
云函数回调 https://developers.weixin.qq.com/minigame/dev/wxcloud/reference-sdk-api/functions/Cloud.callFunction.html
|
||||
</summary>
|
||||
</member>
|
||||
<member name="F:WeChatWASM.CallFunctionResult.result">
|
||||
<summary>
|
||||
后端返回的经过json序列化后的数据
|
||||
</summary>
|
||||
</member>
|
||||
<member name="T:WeChatWASM.CallFunctionParam">
|
||||
<summary>
|
||||
调用云函数 https://developers.weixin.qq.com/minigame/dev/wxcloud/reference-sdk-api/functions/Cloud.callFunction.html
|
||||
</summary>
|
||||
</member>
|
||||
<member name="F:WeChatWASM.CallContainerResult.data">
|
||||
<summary>
|
||||
后端返回的经过json序列化后的数据
|
||||
</summary>
|
||||
</member>
|
||||
<member name="F:WeChatWASM.AccountInfo.miniProgram">
|
||||
<summary>
|
||||
小程序账号信息
|
||||
@ -3187,6 +3188,17 @@
|
||||
是否已打开调试。可通过右上角菜单或 [wx.setEnableDebug](https://developers.weixin.qq.com/minigame/dev/api/base/debug/wx.setEnableDebug.html) 打开调试。
|
||||
</summary>
|
||||
</member>
|
||||
<member name="F:WeChatWASM.AppBaseInfo.fontSizeScaleFactor">
|
||||
<summary>
|
||||
微信字体大小缩放比例
|
||||
</summary>
|
||||
</member>
|
||||
<member name="F:WeChatWASM.AppBaseInfo.fontSizeSetting">
|
||||
<summary>
|
||||
需要基础库: `2.23.4`
|
||||
微信字体大小,单位px
|
||||
</summary>
|
||||
</member>
|
||||
<member name="F:WeChatWASM.AppBaseInfo.host">
|
||||
<summary>
|
||||
当前小程序运行的宿主环境
|
||||
@ -3220,6 +3232,12 @@
|
||||
是否正在充电中
|
||||
</summary>
|
||||
</member>
|
||||
<member name="F:WeChatWASM.GetBatteryInfoSyncResult.isLowPowerModeEnabled">
|
||||
<summary>
|
||||
需要基础库: `3.4.3`
|
||||
是否处于省电模式,目前仅 iOS 端支持
|
||||
</summary>
|
||||
</member>
|
||||
<member name="F:WeChatWASM.GetBatteryInfoSyncResult.level">
|
||||
<summary>
|
||||
设备电量,范围 1 - 100
|
||||
@ -3230,11 +3248,7 @@
|
||||
应用(微信APP)二进制接口类型(仅 Android 支持)
|
||||
</summary>
|
||||
</member>
|
||||
<member name="F:WeChatWASM.DeviceInfo.benchmarkLevel">
|
||||
<summary>
|
||||
设备性能等级(仅 Android 支持)。取值为:-2 或 0(该设备无法运行小游戏),-1(性能未知),>=1(设备性能值,该值越高,设备性能越好,目前最高不到50)
|
||||
</summary>
|
||||
</member>
|
||||
<!-- Badly formed XML comment ignored for member "F:WeChatWASM.DeviceInfo.benchmarkLevel" -->
|
||||
<member name="F:WeChatWASM.DeviceInfo.brand">
|
||||
<summary>
|
||||
设备品牌
|
||||
@ -3447,7 +3461,7 @@
|
||||
</member>
|
||||
<member name="F:WeChatWASM.SystemInfo.deviceOrientation">
|
||||
<summary>
|
||||
设备方向
|
||||
设备方向(注意:IOS客户端横屏游戏获取deviceOrientation可能不准,建议以屏幕宽高为准)
|
||||
可选值:
|
||||
- 'portrait': 竖屏;
|
||||
- 'landscape': 横屏;
|
||||
@ -3651,7 +3665,7 @@
|
||||
</member>
|
||||
<member name="F:WeChatWASM.SystemSetting.deviceOrientation">
|
||||
<summary>
|
||||
设备方向
|
||||
设备方向(注意:IOS客户端横屏游戏获取deviceOrientation可能不准,建议以屏幕宽高为准)
|
||||
可选值:
|
||||
- 'portrait': 竖屏;
|
||||
- 'landscape': 横屏;
|
||||
@ -3717,6 +3731,23 @@
|
||||
接口调用结束的回调函数(调用成功、失败都会执行)
|
||||
</summary>
|
||||
</member>
|
||||
<member name="F:WeChatWASM.DownloadFileOption.enableHttp2">
|
||||
<summary>
|
||||
需要基础库: `2.10.4`
|
||||
是否开启 http2
|
||||
</summary>
|
||||
</member>
|
||||
<member name="F:WeChatWASM.DownloadFileOption.enableProfile">
|
||||
<summary>
|
||||
是否开启 profile,默认开启。开启后可在接口回调的 res.profile 中查看性能调试信息。
|
||||
</summary>
|
||||
</member>
|
||||
<member name="F:WeChatWASM.DownloadFileOption.enableQuic">
|
||||
<summary>
|
||||
需要基础库: `2.10.4`
|
||||
是否开启 Quic 协议(gQUIC Q43)
|
||||
</summary>
|
||||
</member>
|
||||
<member name="F:WeChatWASM.DownloadFileOption.fail">
|
||||
<summary>
|
||||
接口调用失败的回调函数
|
||||
@ -3744,6 +3775,12 @@
|
||||
超时时间,单位为毫秒,默认值为 60000 即一分钟。
|
||||
</summary>
|
||||
</member>
|
||||
<member name="F:WeChatWASM.DownloadFileOption.useHighPerformanceMode">
|
||||
<summary>
|
||||
需要基础库: `3.4.1`
|
||||
使用高性能模式,暂仅支持 Android,默认关闭。该模式下有更优的网络性能表现。
|
||||
</summary>
|
||||
</member>
|
||||
<member name="F:WeChatWASM.GeneralCallbackResult.errMsg">
|
||||
<summary>
|
||||
错误信息
|
||||
@ -3895,6 +3932,11 @@
|
||||
传输层根据多个请求评估的当前网络的 rtt(仅供参考)
|
||||
</summary>
|
||||
</member>
|
||||
<member name="F:WeChatWASM.RequestProfile.usingHighPerformanceMode">
|
||||
<summary>
|
||||
是否走到了高性能模式。基础库 v3.3.4 起支持。
|
||||
</summary>
|
||||
</member>
|
||||
<member name="F:WeChatWASM.DownloadTaskOnHeadersReceivedListenerResult.header">
|
||||
<summary>
|
||||
开发者服务器返回的 HTTP Response Header
|
||||
@ -3943,6 +3985,26 @@
|
||||
背景颜色
|
||||
</summary>
|
||||
</member>
|
||||
<member name="F:WeChatWASM.OptionStyle.height">
|
||||
<summary>
|
||||
高度
|
||||
</summary>
|
||||
</member>
|
||||
<member name="F:WeChatWASM.OptionStyle.left">
|
||||
<summary>
|
||||
左上角横坐标
|
||||
</summary>
|
||||
</member>
|
||||
<member name="F:WeChatWASM.OptionStyle.top">
|
||||
<summary>
|
||||
左上角纵坐标
|
||||
</summary>
|
||||
</member>
|
||||
<member name="F:WeChatWASM.OptionStyle.width">
|
||||
<summary>
|
||||
宽度
|
||||
</summary>
|
||||
</member>
|
||||
<member name="F:WeChatWASM.OptionStyle.borderColor">
|
||||
<summary>
|
||||
边框颜色
|
||||
@ -3968,16 +4030,6 @@
|
||||
字号
|
||||
</summary>
|
||||
</member>
|
||||
<member name="F:WeChatWASM.OptionStyle.height">
|
||||
<summary>
|
||||
高度
|
||||
</summary>
|
||||
</member>
|
||||
<member name="F:WeChatWASM.OptionStyle.left">
|
||||
<summary>
|
||||
左上角横坐标
|
||||
</summary>
|
||||
</member>
|
||||
<member name="F:WeChatWASM.OptionStyle.lineHeight">
|
||||
<summary>
|
||||
文本的行高
|
||||
@ -3992,16 +4044,6 @@
|
||||
- 'right': 居右;
|
||||
</summary>
|
||||
</member>
|
||||
<member name="F:WeChatWASM.OptionStyle.top">
|
||||
<summary>
|
||||
左上角纵坐标
|
||||
</summary>
|
||||
</member>
|
||||
<member name="F:WeChatWASM.OptionStyle.width">
|
||||
<summary>
|
||||
宽度
|
||||
</summary>
|
||||
</member>
|
||||
<member name="F:WeChatWASM.ImageData.data">
|
||||
<summary>
|
||||
一维数组,包含以 RGBA 顺序的数据,数据使用 0 至 255(包含)的整数表示
|
||||
@ -4159,7 +4201,7 @@
|
||||
</member>
|
||||
<member name="F:WeChatWASM.AuthPrivateMessageOption.shareTicket">
|
||||
<summary>
|
||||
shareTicket。可以从 wx.onShow 中获取。详情 [shareTicket](#)
|
||||
shareTicket。可以从 wx.getEnterOptionsSync 中获取。详情 [shareTicket](#)
|
||||
</summary>
|
||||
</member>
|
||||
<member name="F:WeChatWASM.AuthPrivateMessageOption.complete">
|
||||
@ -4748,7 +4790,7 @@
|
||||
开始广播本地创建的外围设备。
|
||||
**注意**
|
||||
- Android 8.0.9 开始,支持直接使用 16/32/128 位 UUID;
|
||||
- Android 8.0.9 以下版本只支持 128 位 UUID,使用 16/32 位的 UUID 时需要进行补位(系统会自动识别是否属于预分配区间),可以参考[蓝牙指南](#);
|
||||
- Android 8.0.9 以下版本只支持 128 位 UUID,使用 16/32 位的 UUID 时需要进行补位(系统会自动识别是否属于预分配区间),可以参考[蓝牙指南](https://developers.weixin.qq.com/minigame/dev/guide/device/ble.html);
|
||||
- iOS 必须直接使用 16 位的 UUID,不能补位到 128 位,否则系统组包时仍会按照 128 位传输。iOS 暂不支持 32 位 UUID。
|
||||
- iOS 同时只能发起一个广播,安卓支持同时发起多个广播。
|
||||
- 传 beacon 参数时,不能同时传入 deviceName,serviceUuids,manufacturerData 参数。
|
||||
@ -5534,6 +5576,12 @@
|
||||
是否正在充电中
|
||||
</summary>
|
||||
</member>
|
||||
<member name="F:WeChatWASM.GetBatteryInfoSuccessCallbackResult.isLowPowerModeEnabled">
|
||||
<summary>
|
||||
需要基础库: `3.4.3`
|
||||
是否处于省电模式,目前仅 iOS 端支持
|
||||
</summary>
|
||||
</member>
|
||||
<member name="F:WeChatWASM.GetBatteryInfoSuccessCallbackResult.level">
|
||||
<summary>
|
||||
设备电量,范围 1 - 100
|
||||
@ -5902,6 +5950,23 @@
|
||||
蓝牙设备名称,某些设备可能没有
|
||||
</summary>
|
||||
</member>
|
||||
<member name="F:WeChatWASM.GetDeviceBenchmarkInfoOption.complete">
|
||||
<summary>
|
||||
接口调用结束的回调函数(调用成功、失败都会执行)
|
||||
</summary>
|
||||
</member>
|
||||
<member name="F:WeChatWASM.GetDeviceBenchmarkInfoOption.fail">
|
||||
<summary>
|
||||
接口调用失败的回调函数
|
||||
</summary>
|
||||
</member>
|
||||
<member name="F:WeChatWASM.GetDeviceBenchmarkInfoOption.success">
|
||||
<summary>
|
||||
接口调用成功的回调函数
|
||||
</summary>
|
||||
</member>
|
||||
<!-- Badly formed XML comment ignored for member "F:WeChatWASM.GetDeviceBenchmarkInfoSuccessCallbackResult.benchmarkLevel" -->
|
||||
<!-- Badly formed XML comment ignored for member "F:WeChatWASM.GetDeviceBenchmarkInfoSuccessCallbackResult.modelLevel" -->
|
||||
<member name="F:WeChatWASM.GetExtConfigOption.complete">
|
||||
<summary>
|
||||
接口调用结束的回调函数(调用成功、失败都会执行)
|
||||
@ -6020,6 +6085,24 @@
|
||||
接口调用成功的回调函数
|
||||
</summary>
|
||||
</member>
|
||||
<member name="F:WeChatWASM.GetGroupEnterInfoError.errMsg">
|
||||
<summary>
|
||||
错误信息
|
||||
| 错误码 | 错误信息 | 说明 |
|
||||
| - | - | - |
|
||||
| 40097 | | 场景错误 |
|
||||
| 65206 | | 用户已不在该群内 |
|
||||
</summary>
|
||||
</member>
|
||||
<member name="F:WeChatWASM.GetGroupEnterInfoError.errCode">
|
||||
<summary>
|
||||
错误码
|
||||
| 错误码 | 错误信息 | 说明 |
|
||||
| - | - | - |
|
||||
| 40097 | | 场景错误 |
|
||||
| 65206 | | 用户已不在该群内 |
|
||||
</summary>
|
||||
</member>
|
||||
<member name="F:WeChatWASM.GetGroupEnterInfoSuccessCallbackResult.cloudID">
|
||||
<summary>
|
||||
需要基础库: `2.7.0`
|
||||
@ -6252,7 +6335,7 @@
|
||||
</member>
|
||||
<member name="F:WeChatWASM.GetShareInfoOption.shareTicket">
|
||||
<summary>
|
||||
shareTicket
|
||||
shareTicket,详见[获取更多转发信息](#)
|
||||
</summary>
|
||||
</member>
|
||||
<member name="F:WeChatWASM.GetShareInfoOption.complete">
|
||||
@ -7105,6 +7188,36 @@
|
||||
- 15: TRIM_MEMORY_RUNNING_CRITICAL;
|
||||
</summary>
|
||||
</member>
|
||||
<member name="F:WeChatWASM.OnMenuButtonBoundingClientRectWeightChangeListenerResult.bottom">
|
||||
<summary>
|
||||
下边界坐标,单位:px
|
||||
</summary>
|
||||
</member>
|
||||
<member name="F:WeChatWASM.OnMenuButtonBoundingClientRectWeightChangeListenerResult.height">
|
||||
<summary>
|
||||
高度,单位:px
|
||||
</summary>
|
||||
</member>
|
||||
<member name="F:WeChatWASM.OnMenuButtonBoundingClientRectWeightChangeListenerResult.left">
|
||||
<summary>
|
||||
左边界坐标,单位:px
|
||||
</summary>
|
||||
</member>
|
||||
<member name="F:WeChatWASM.OnMenuButtonBoundingClientRectWeightChangeListenerResult.right">
|
||||
<summary>
|
||||
右边界坐标,单位:px
|
||||
</summary>
|
||||
</member>
|
||||
<member name="F:WeChatWASM.OnMenuButtonBoundingClientRectWeightChangeListenerResult.top">
|
||||
<summary>
|
||||
上边界坐标,单位:px
|
||||
</summary>
|
||||
</member>
|
||||
<member name="F:WeChatWASM.OnMenuButtonBoundingClientRectWeightChangeListenerResult.width">
|
||||
<summary>
|
||||
宽度,单位:px
|
||||
</summary>
|
||||
</member>
|
||||
<member name="F:WeChatWASM.OnMouseDownListenerResult.button">
|
||||
<summary>
|
||||
按键类型,0左键,1中键,2右键
|
||||
@ -7275,6 +7388,12 @@
|
||||
拒绝原因,一般是一个 Error 对象
|
||||
</summary>
|
||||
</member>
|
||||
<member name="F:WeChatWASM.OnUserCaptureScreenListenerResult.query">
|
||||
<summary>
|
||||
需要基础库: `3.3.0`
|
||||
支持开发者自定义一键打开小程序时的 query
|
||||
</summary>
|
||||
</member>
|
||||
<member name="F:WeChatWASM.OnVoIPChatInterruptedListenerResult.errCode">
|
||||
<summary>
|
||||
错误码
|
||||
@ -8200,11 +8319,6 @@
|
||||
分区 ID
|
||||
</summary>
|
||||
</member>
|
||||
<member name="F:WeChatWASM.RequestMidasPaymentOption.extraInfo">
|
||||
<summary>
|
||||
其他参数
|
||||
</summary>
|
||||
</member>
|
||||
<member name="F:WeChatWASM.MidasPaymentError.errMsg">
|
||||
<summary>
|
||||
错误信息
|
||||
@ -8212,6 +8326,7 @@
|
||||
| - | - | - |
|
||||
| -1 | | 系统失败 |
|
||||
| -2 | | 支付取消 |
|
||||
| -6 | | 下单参数类型不对 |
|
||||
| -15001 | | 虚拟支付接口错误码,缺少参数 |
|
||||
| -15002 | | 虚拟支付接口错误码,参数不合法 |
|
||||
| -15003 | | 虚拟支付接口错误码,订单重复 |
|
||||
@ -8221,6 +8336,9 @@
|
||||
| -15007 | | 虚拟支付接口错误码,订单已支付 |
|
||||
| -15009 | | 虚拟支付接口错误码,由于健康系统限制,本次支付已超过限额(这种错误情况会有默认弹窗提示) |
|
||||
| -15010 | | 虚拟支付接口错误码,正式版小游戏不允许在沙箱环境支付 |
|
||||
| -15011 | | 请求的数据类型错误 |
|
||||
| -15013 | | 代币未发布 |
|
||||
| -15017 | | 订单已关闭 |
|
||||
| 1 | | 虚拟支付接口错误码,用户取消支付 |
|
||||
| 2 | | 虚拟支付接口错误码,客户端错误,判断到小程序在用户处于支付中时,又发起了一笔支付请求 |
|
||||
| 3 | | 虚拟支付接口错误码,Android独有错误:用户使用GooglePlay支付,而手机未安装GooglePlay |
|
||||
@ -8230,7 +8348,9 @@
|
||||
| 7 | | 虚拟支付接口错误码,支付取消 |
|
||||
| 1000 | | 参数错误 |
|
||||
| 1001 | | 分区未发布 |
|
||||
| 1003 | | 米大师Portal错误 |
|
||||
| 1003 | | 代币/分区未发布或者对应商户号被封禁或者米大师Portal错误,请先确保虚拟支付2.0代币和分区已发布,然后自查商户号封禁情况https://kf.qq.com/faq/190523Mb6VRJ190523RV363E.html,对应的商户号可以在mp-虚拟支付2.0-基础配置-微信支付账号信息中查询 |
|
||||
| 3017/-15012 | | 道具id非法 |
|
||||
| 701001 | | ios禁止支付 |
|
||||
</summary>
|
||||
</member>
|
||||
<member name="F:WeChatWASM.MidasPaymentError.errCode">
|
||||
@ -8240,6 +8360,7 @@
|
||||
| - | - | - |
|
||||
| -1 | | 系统失败 |
|
||||
| -2 | | 支付取消 |
|
||||
| -6 | | 下单参数类型不对 |
|
||||
| -15001 | | 虚拟支付接口错误码,缺少参数 |
|
||||
| -15002 | | 虚拟支付接口错误码,参数不合法 |
|
||||
| -15003 | | 虚拟支付接口错误码,订单重复 |
|
||||
@ -8249,6 +8370,9 @@
|
||||
| -15007 | | 虚拟支付接口错误码,订单已支付 |
|
||||
| -15009 | | 虚拟支付接口错误码,由于健康系统限制,本次支付已超过限额(这种错误情况会有默认弹窗提示) |
|
||||
| -15010 | | 虚拟支付接口错误码,正式版小游戏不允许在沙箱环境支付 |
|
||||
| -15011 | | 请求的数据类型错误 |
|
||||
| -15013 | | 代币未发布 |
|
||||
| -15017 | | 订单已关闭 |
|
||||
| 1 | | 虚拟支付接口错误码,用户取消支付 |
|
||||
| 2 | | 虚拟支付接口错误码,客户端错误,判断到小程序在用户处于支付中时,又发起了一笔支付请求 |
|
||||
| 3 | | 虚拟支付接口错误码,Android独有错误:用户使用GooglePlay支付,而手机未安装GooglePlay |
|
||||
@ -8258,7 +8382,9 @@
|
||||
| 7 | | 虚拟支付接口错误码,支付取消 |
|
||||
| 1000 | | 参数错误 |
|
||||
| 1001 | | 分区未发布 |
|
||||
| 1003 | | 米大师Portal错误 |
|
||||
| 1003 | | 代币/分区未发布或者对应商户号被封禁或者米大师Portal错误,请先确保虚拟支付2.0代币和分区已发布,然后自查商户号封禁情况https://kf.qq.com/faq/190523Mb6VRJ190523RV363E.html,对应的商户号可以在mp-虚拟支付2.0-基础配置-微信支付账号信息中查询 |
|
||||
| 3017/-15012 | | 道具id非法 |
|
||||
| 701001 | | ios禁止支付 |
|
||||
</summary>
|
||||
</member>
|
||||
<member name="F:WeChatWASM.RequestMidasPaymentFailCallbackErr.errCode">
|
||||
@ -8271,11 +8397,116 @@
|
||||
错误信息
|
||||
</summary>
|
||||
</member>
|
||||
<member name="F:WeChatWASM.RequestMidasPaymentFailCallbackErr.errno">
|
||||
<summary>
|
||||
错误码
|
||||
</summary>
|
||||
</member>
|
||||
<member name="F:WeChatWASM.RequestMidasPaymentSuccessCallbackResult.errMsg">
|
||||
<summary>
|
||||
调用成功信息
|
||||
</summary>
|
||||
</member>
|
||||
<!-- Badly formed XML comment ignored for member "F:WeChatWASM.RequestMidasPaymentGameItemOption.paySig" -->
|
||||
<member name="F:WeChatWASM.RequestMidasPaymentGameItemOption.signData">
|
||||
<summary>
|
||||
<b>支付原串</b>
|
||||
具体支付参数见下面的signData,需要将数据以json格式传递
|
||||
signData例子:
|
||||
'{"mode":"goods","offerId":"123","buyQuantity":1,"env":0,"currencyType":"CNY","platform":"android","zoneId":"1","productId":"testproductId","goodsPrice":10,"outTradeNo":"xxxxxx","attach":"testdata"}'
|
||||
</summary>
|
||||
</member>
|
||||
<member name="F:WeChatWASM.RequestMidasPaymentGameItemOption.signature">
|
||||
<summary>
|
||||
<b>用户态签名</b>
|
||||
signature参数签名算法参考[用户态签名](https://developers.weixin.qq.com/minigame/dev/guide/open-ability/signature.html#%E7%94%A8%E6%88%B7%E7%99%BB%E5%BD%95%E6%80%81%E7%AD%BE%E5%90%8D)
|
||||
可参考[calc_signature](https://docs.qq.com/doc/DVUN0QWJja0J5c2x4)
|
||||
</summary>
|
||||
</member>
|
||||
<member name="F:WeChatWASM.RequestMidasPaymentGameItemOption.complete">
|
||||
<summary>
|
||||
接口调用结束的回调函数(调用成功、失败都会执行)
|
||||
</summary>
|
||||
</member>
|
||||
<member name="F:WeChatWASM.RequestMidasPaymentGameItemOption.fail">
|
||||
<summary>
|
||||
接口调用失败的回调函数
|
||||
</summary>
|
||||
</member>
|
||||
<member name="F:WeChatWASM.RequestMidasPaymentGameItemOption.success">
|
||||
<summary>
|
||||
接口调用成功的回调函数
|
||||
</summary>
|
||||
</member>
|
||||
<member name="F:WeChatWASM.SignData1.buyQuantity">
|
||||
<summary>
|
||||
<b>购买数量</b>
|
||||
</summary>
|
||||
</member>
|
||||
<member name="F:WeChatWASM.SignData1.currencyType">
|
||||
<summary>
|
||||
<b>币种</b>
|
||||
可选值:
|
||||
- 'CNY': 人民币;
|
||||
</summary>
|
||||
</member>
|
||||
<member name="F:WeChatWASM.SignData1.goodsPrice">
|
||||
<summary>
|
||||
<b>道具单价(分)</b>
|
||||
用来校验价格与后台道具价格是否一致,避免用户在业务商城页看到的价格与实际价格不一致导致投诉
|
||||
</summary>
|
||||
</member>
|
||||
<member name="F:WeChatWASM.SignData1.mode">
|
||||
<summary>
|
||||
<b>支付的类型</b>
|
||||
不同的支付类型有各自额外要传的附加参数
|
||||
</summary>
|
||||
</member>
|
||||
<member name="F:WeChatWASM.SignData1.offerId">
|
||||
<summary>
|
||||
<b>在米大师侧申请的应用id</b>
|
||||
mp-支付基础配置中的offerid
|
||||
</summary>
|
||||
</member>
|
||||
<member name="F:WeChatWASM.SignData1.outTradeNo">
|
||||
<summary>
|
||||
<b>业务订单号</b>
|
||||
每个订单号只能使用一次,重复使用会失败(极端情况不保证唯一,不建议业务强依赖唯一性)。
|
||||
要求32个字符内,只能是数字、大小写字母、符号 _-|*@组成,不能以下划线(_)开头。
|
||||
若没有传入,则平台会自动填充一个,并以下划线开头。
|
||||
</summary>
|
||||
</member>
|
||||
<member name="F:WeChatWASM.SignData1.productId">
|
||||
<summary>
|
||||
<b>道具ID</b>
|
||||
</summary>
|
||||
</member>
|
||||
<member name="F:WeChatWASM.SignData1.attach">
|
||||
<summary>
|
||||
<b>透传数据</b>
|
||||
发货通知时会透传给开发者
|
||||
</summary>
|
||||
</member>
|
||||
<member name="F:WeChatWASM.SignData1.env">
|
||||
<summary>
|
||||
<b>环境配置</b>
|
||||
可选值:
|
||||
- 0: 米大师正式环境;
|
||||
- 1: 米大师沙箱环境;
|
||||
</summary>
|
||||
</member>
|
||||
<member name="F:WeChatWASM.SignData1.platform">
|
||||
<summary>
|
||||
<b>平台</b>
|
||||
可选值:
|
||||
- 'android': 安卓;
|
||||
</summary>
|
||||
</member>
|
||||
<member name="F:WeChatWASM.SignData1.zoneId">
|
||||
<summary>
|
||||
<b>分区ID</b>
|
||||
</summary>
|
||||
</member>
|
||||
<member name="F:WeChatWASM.RequestSubscribeMessageOption.tmplIds">
|
||||
<summary>
|
||||
需要订阅的消息模板的id的集合,一次调用最多可订阅3条消息(注意:iOS客户端7.0.6版本、Android客户端7.0.7版本之后的一次性订阅/长期订阅才支持多个模板消息,iOS客户端7.0.5版本、Android客户端7.0.6版本之前的一次订阅只支持一个模板消息)消息模板id在[微信公众平台(mp.weixin.qq.com)-功能-订阅消息]中配置。每个tmplId对应的模板标题需要不相同,否则会被过滤。
|
||||
@ -9021,7 +9252,7 @@
|
||||
<member name="F:WeChatWASM.ShowShareImageMenuOption.needShowEntrance">
|
||||
<summary>
|
||||
需要基础库: `3.2.0`
|
||||
分享的图片消息是否要带小程序入口
|
||||
分享的图片消息是否要带小程序入口 (仅部分小程序类目可用)
|
||||
</summary>
|
||||
</member>
|
||||
<member name="F:WeChatWASM.ShowShareImageMenuOption.style">
|
||||
@ -9400,6 +9631,11 @@
|
||||
参数列表
|
||||
</summary>
|
||||
</member>
|
||||
<member name="F:WeChatWASM.UpdatableMessageFrontEndTemplateInfo.templateId">
|
||||
<summary>
|
||||
模板ID
|
||||
</summary>
|
||||
</member>
|
||||
<member name="F:WeChatWASM.UpdatableMessageFrontEndParameter.name">
|
||||
<summary>
|
||||
参数名
|
||||
@ -9716,101 +9952,6 @@
|
||||
接口调用成功的回调函数
|
||||
</summary>
|
||||
</member>
|
||||
<member name="F:WeChatWASM.RequestMidasPaymentGameItemOption.signData">
|
||||
<summary>
|
||||
支付原串
|
||||
</summary>
|
||||
</member>
|
||||
<member name="F:WeChatWASM.RequestMidasPaymentGameItemOption.paySig">
|
||||
<summary>
|
||||
支付签名
|
||||
</summary>
|
||||
</member>
|
||||
<member name="F:WeChatWASM.RequestMidasPaymentGameItemOption.signature">
|
||||
<summary>
|
||||
用户态签名
|
||||
</summary>
|
||||
</member>
|
||||
<member name="F:WeChatWASM.RequestMidasPaymentGameItemOption.extraInfo">
|
||||
<summary>
|
||||
其他参数
|
||||
</summary>
|
||||
</member>
|
||||
<member name="F:WeChatWASM.RequestMidasPaymentGameItemOption.complete">
|
||||
<summary>
|
||||
接口调用结束的回调函数(调用成功、失败都会执行)
|
||||
</summary>
|
||||
</member>
|
||||
<member name="F:WeChatWASM.RequestMidasPaymentGameItemOption.fail">
|
||||
<summary>
|
||||
接口调用失败的回调函数
|
||||
</summary>
|
||||
</member>
|
||||
<member name="F:WeChatWASM.RequestMidasPaymentGameItemOption.success">
|
||||
<summary>
|
||||
接口调用成功的回调函数
|
||||
</summary>
|
||||
</member>
|
||||
<member name="F:WeChatWASM.MidasPaymentGameItemError.errMsg">
|
||||
<summary>
|
||||
错误信息
|
||||
| 错误码 | 错误信息 | 说明 |
|
||||
| - | - | - |
|
||||
| -1 | | 系统失败 |
|
||||
| -2 | | 支付取消 |
|
||||
| -15001 | | 虚拟支付接口错误码,缺少参数 |
|
||||
| -15002 | | 虚拟支付接口错误码,参数不合法 |
|
||||
| -15003 | | 虚拟支付接口错误码,订单重复 |
|
||||
| -15004 | | 虚拟支付接口错误码,后台错误 |
|
||||
| -15005 | | 虚拟支付接口错误码,appId权限被封禁 |
|
||||
| -15006 | | 虚拟支付接口错误码,货币类型不支持 |
|
||||
| -15007 | | 虚拟支付接口错误码,订单已支付 |
|
||||
| -15009 | | 虚拟支付接口错误码,由于健康系统限制,本次支付已超过限额(这种错误情况会有默认弹窗提示) |
|
||||
| -15010 | | 虚拟支付接口错误码,正式版小游戏不允许在沙箱环境支付 |
|
||||
| 1 | | 虚拟支付接口错误码,用户取消支付 |
|
||||
| 2 | | 虚拟支付接口错误码,客户端错误,判断到小程序在用户处于支付中时,又发起了一笔支付请求 |
|
||||
| 3 | | 虚拟支付接口错误码,Android独有错误:用户使用GooglePlay支付,而手机未安装GooglePlay |
|
||||
| 4 | | 虚拟支付接口错误码,用户操作系统支付状态异常 |
|
||||
| 5 | | 虚拟支付接口错误码,操作系统错误 |
|
||||
| 6 | | 虚拟支付接口错误码,其他错误 |
|
||||
| 7 | | 虚拟支付接口错误码,支付取消 |
|
||||
| 1000 | | 参数错误 |
|
||||
| 1001 | | 分区未发布 |
|
||||
| 1003 | | 米大师Portal错误 |
|
||||
</summary>
|
||||
</member>
|
||||
<member name="F:WeChatWASM.MidasPaymentGameItemError.errCode">
|
||||
<summary>
|
||||
错误码
|
||||
| 错误码 | 错误信息 | 说明 |
|
||||
| - | - | - |
|
||||
| -1 | | 系统失败 |
|
||||
| -2 | | 支付取消 |
|
||||
| -15001 | | 虚拟支付接口错误码,缺少参数 |
|
||||
| -15002 | | 虚拟支付接口错误码,参数不合法 |
|
||||
| -15003 | | 虚拟支付接口错误码,订单重复 |
|
||||
| -15004 | | 虚拟支付接口错误码,后台错误 |
|
||||
| -15005 | | 虚拟支付接口错误码,appId权限被封禁 |
|
||||
| -15006 | | 虚拟支付接口错误码,货币类型不支持 |
|
||||
| -15007 | | 虚拟支付接口错误码,订单已支付 |
|
||||
| -15009 | | 虚拟支付接口错误码,由于健康系统限制,本次支付已超过限额(这种错误情况会有默认弹窗提示) |
|
||||
| -15010 | | 虚拟支付接口错误码,正式版小游戏不允许在沙箱环境支付 |
|
||||
| -15012 | | 虚拟支付接口错误码,小游戏用户态签名错误 |
|
||||
| -15014 | | 虚拟支付接口错误码,小游戏支付签名错误 |
|
||||
| -15015 | | sessionkey过期 |
|
||||
| -15016 | | goodsprice道具价格错误 |
|
||||
| 1 | | 虚拟支付接口错误码,用户取消支付 |
|
||||
| 2 | | 虚拟支付接口错误码,客户端错误,判断到小程序在用户处于支付中时,又发起了一笔支付请求 |
|
||||
| 3 | | 虚拟支付接口错误码,Android独有错误:用户使用GooglePlay支付,而手机未安装GooglePlay |
|
||||
| 4 | | 虚拟支付接口错误码,用户操作系统支付状态异常 |
|
||||
| 5 | | 虚拟支付接口错误码,操作系统错误 |
|
||||
| 6 | | 虚拟支付接口错误码,其他错误 |
|
||||
| 7 | | 虚拟支付接口错误码,支付取消 |
|
||||
| 1000 | | 参数错误 |
|
||||
| 1001 | | 分区未发布 |
|
||||
| 1003 | | 米大师Portal错误 |
|
||||
</summary>
|
||||
</member>
|
||||
<member name="F:WeChatWASM.RequestSubscribeLiveActivityOption.complete">
|
||||
<summary>
|
||||
接口调用结束的回调函数(调用成功、失败都会执行)
|
||||
@ -10273,7 +10414,7 @@
|
||||
设置 IP_TTL 套接字选项,用于设置一个 IP 数据包传输时允许的最大跳步数
|
||||
</summary>
|
||||
</member>
|
||||
<member name="M:WeChatWASM.WXUDPSocket.Write">
|
||||
<member name="M:WeChatWASM.WXUDPSocket.Write(WeChatWASM.UDPSocketSendOption)">
|
||||
<summary>
|
||||
[UDPSocket.write()](https://developers.weixin.qq.com/minigame/dev/api/network/udp/UDPSocket.write.html)
|
||||
需要基础库: `2.15.0`
|
||||
@ -10619,11 +10760,5 @@
|
||||
注册监听录制事件的回调函数。当对应事件触发时,回调函数会被执行
|
||||
</summary>
|
||||
</member>
|
||||
<member name="T:PlayerPrefs">
|
||||
<summary>
|
||||
覆盖unity的PlayerPrefs
|
||||
注意:调用均为同步调用, 容易阻塞游戏主线程造成卡顿,不建议频繁调用
|
||||
</summary>
|
||||
</member>
|
||||
</members>
|
||||
</doc>
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
fileFormatVersion: 2
|
||||
guid: a059cf8813f306b3aab52c161b8307af
|
||||
guid: fa414b40926610979325ff6d05eada8c
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
|
||||
BIN
Runtime/Plugins/wx_perf_2021.a
Normal file
BIN
Runtime/Plugins/wx_perf_2021.a
Normal file
Binary file not shown.
74
Runtime/Plugins/wx_perf_2021.a.meta
Normal file
74
Runtime/Plugins/wx_perf_2021.a.meta
Normal file
@ -0,0 +1,74 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 0dedb8177ed8f384d9833f379a1b9b2a
|
||||
PluginImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
iconMap: {}
|
||||
executionOrder: {}
|
||||
defineConstraints: []
|
||||
isPreloaded: 0
|
||||
isOverridable: 1
|
||||
isExplicitlyReferenced: 0
|
||||
validateReferences: 1
|
||||
platformData:
|
||||
- first:
|
||||
: Any
|
||||
second:
|
||||
enabled: 0
|
||||
settings:
|
||||
Exclude Editor: 1
|
||||
Exclude Linux64: 1
|
||||
Exclude OSXUniversal: 1
|
||||
Exclude WebGL: 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:
|
||||
Standalone: Linux64
|
||||
second:
|
||||
enabled: 0
|
||||
settings:
|
||||
CPU: None
|
||||
- first:
|
||||
Standalone: OSXUniversal
|
||||
second:
|
||||
enabled: 0
|
||||
settings:
|
||||
CPU: None
|
||||
- first:
|
||||
Standalone: Win
|
||||
second:
|
||||
enabled: 0
|
||||
settings:
|
||||
CPU: None
|
||||
- first:
|
||||
Standalone: Win64
|
||||
second:
|
||||
enabled: 0
|
||||
settings:
|
||||
CPU: None
|
||||
- first:
|
||||
WebGL: WebGL
|
||||
second:
|
||||
enabled: 0
|
||||
settings: {}
|
||||
- first:
|
||||
WeixinMiniGame: WeixinMiniGame
|
||||
second:
|
||||
enabled: 0
|
||||
settings: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
BIN
Runtime/Plugins/wx_perf_2022.a
Normal file
BIN
Runtime/Plugins/wx_perf_2022.a
Normal file
Binary file not shown.
74
Runtime/Plugins/wx_perf_2022.a.meta
Normal file
74
Runtime/Plugins/wx_perf_2022.a.meta
Normal file
@ -0,0 +1,74 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 187d3306362e8bec07846a683aeb77da
|
||||
PluginImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
iconMap: {}
|
||||
executionOrder: {}
|
||||
defineConstraints: []
|
||||
isPreloaded: 0
|
||||
isOverridable: 1
|
||||
isExplicitlyReferenced: 0
|
||||
validateReferences: 1
|
||||
platformData:
|
||||
- first:
|
||||
: Any
|
||||
second:
|
||||
enabled: 0
|
||||
settings:
|
||||
Exclude Editor: 1
|
||||
Exclude Linux64: 1
|
||||
Exclude OSXUniversal: 1
|
||||
Exclude WebGL: 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:
|
||||
Standalone: Linux64
|
||||
second:
|
||||
enabled: 0
|
||||
settings:
|
||||
CPU: None
|
||||
- first:
|
||||
Standalone: OSXUniversal
|
||||
second:
|
||||
enabled: 0
|
||||
settings:
|
||||
CPU: None
|
||||
- first:
|
||||
Standalone: Win
|
||||
second:
|
||||
enabled: 0
|
||||
settings:
|
||||
CPU: None
|
||||
- first:
|
||||
Standalone: Win64
|
||||
second:
|
||||
enabled: 0
|
||||
settings:
|
||||
CPU: None
|
||||
- first:
|
||||
WebGL: WebGL
|
||||
second:
|
||||
enabled: 0
|
||||
settings: {}
|
||||
- first:
|
||||
WeixinMiniGame: WeixinMiniGame
|
||||
second:
|
||||
enabled: 0
|
||||
settings: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
282
Runtime/WX.cs
282
Runtime/WX.cs
@ -108,9 +108,11 @@ namespace WeChatWASM
|
||||
|
||||
/// <summary>
|
||||
/// [wx.checkSession(Object object)](https://developers.weixin.qq.com/minigame/dev/api/open-api/login/wx.checkSession.html)
|
||||
/// 检查登录态是否过期。
|
||||
/// 通过 wx.login 接口获得的用户登录态拥有一定的时效性。用户越久未使用小程序,用户登录态越有可能失效。反之如果用户一直在使用小程序,则用户登录态一直保持有效。具体时效逻辑由微信维护,对开发者透明。开发者只需要调用 wx.checkSession 接口检测当前用户登录态是否有效。
|
||||
/// 登录态过期后开发者可以再调用 wx.login 获取新的用户登录态。调用成功说明当前 session_key 未过期,调用失败说明 session_key 已过期。
|
||||
/// 检查登录态 session_key 是否过期。
|
||||
/// session_key 具有唯一性,在使用小程序时,同一用户在同一时刻仅有一个有效的 session_key。
|
||||
/// 通过 wx.login 接口获得的用户登录态拥有一定的时效性。用户越久未使用小程序,用户登录态越有可能过期。反之如果用户一直在使用小程序,则用户登录态一直保持有效。具体时效逻辑由微信维护,对开发者透明。除了过期失效外,触发获取临时登录凭证 code 的操作([小程序登录](https://developers.weixin.qq.com/minigame/dev/guide/open-ability/login.html) 和 [数据预拉取](https://developers.weixin.qq.com/minigame/dev/guide/base-ability/pre-fetch.html))可能会生成新的登录态session_key,从而使旧的 session_key 被顶替而失效。
|
||||
/// 开发者可以调用 wx.checkSession 接口检测用户登录态是否过期。**注意,wx.checkSession 的校验对象是最后一次获取 code 操作对应的登录态 session_key**,调用成功说明该 session_key 未过期,调用失败说明 session_key 已过期。如果要校验指定的 session_key 是否有效,可以在开发者服务器后台调用 [checkSessionKey](#)。
|
||||
/// 登录态失效后开发者可以再调用 wx.login 获取新的用户登录态。
|
||||
/// **示例代码**
|
||||
/// ```js
|
||||
/// wx.checkSession({
|
||||
@ -150,8 +152,8 @@ namespace WeChatWASM
|
||||
/// maxDuration: 30,
|
||||
/// camera: 'back',
|
||||
/// success(res) {
|
||||
/// console.log(res.tempFiles.tempFilePath)
|
||||
/// console.log(res.tempFiles.size)
|
||||
/// console.log(res.tempFiles[0].tempFilePath)
|
||||
/// console.log(res.tempFiles[0].size)
|
||||
/// }
|
||||
/// })
|
||||
/// ```
|
||||
@ -224,7 +226,7 @@ namespace WeChatWASM
|
||||
/// <summary>
|
||||
/// [wx.compressImage(Object object)](https://developers.weixin.qq.com/minigame/dev/api/media/image/wx.compressImage.html)
|
||||
/// 需要基础库: `3.0.1`
|
||||
/// 压缩图片接口,可选压缩质量
|
||||
/// 压缩图片接口,可选压缩质量。iOS 仅支持压缩 JPG 格式图片。
|
||||
/// **示例代码**
|
||||
/// ```js
|
||||
/// wx.compressImage({
|
||||
@ -394,7 +396,7 @@ namespace WeChatWASM
|
||||
/// [wx.getBackgroundFetchData(object object)](https://developers.weixin.qq.com/minigame/dev/api/storage/background-fetch/wx.getBackgroundFetchData.html)
|
||||
/// 需要基础库: `3.0.1`
|
||||
/// 拉取 backgroundFetch 客户端缓存数据。
|
||||
/// 当调用接口时,若当次请求未结束,会先返回本地的旧数据(之前打开小程序时请求的),如果本地没有旧数据,安卓上会返回fail,不会等待请求完成,iOS上会返回success但fetchedData为空,也不会等待请求完成。
|
||||
/// 当调用接口时,若当次请求未结束,会先返回本地的旧数据(之前打开小程序时请求的),如果本地没有旧数据,安卓上会返回fail,不会等待请求完成,iOS上会返回success但fetchedData为空,也不会等待请求完成。建议和 [wx.onBackgroundFetchData](https://developers.weixin.qq.com/minigame/dev/api/storage/background-fetch/wx.onBackgroundFetchData.html) 配合使用
|
||||
/// </summary>
|
||||
public static void GetBackgroundFetchData(GetBackgroundFetchDataOption callback)
|
||||
{
|
||||
@ -413,7 +415,7 @@ namespace WeChatWASM
|
||||
|
||||
/// <summary>
|
||||
/// [wx.getBatteryInfo(Object object)](https://developers.weixin.qq.com/minigame/dev/api/device/battery/wx.getBatteryInfo.html)
|
||||
/// 获取设备电量。同步 API [wx.getBatteryInfoSync](https://developers.weixin.qq.com/minigame/dev/api/device/battery/wx.getBatteryInfoSync.html) 在 iOS 上不可用。
|
||||
/// 获取设备电池信息。同步 API [wx.getBatteryInfoSync](https://developers.weixin.qq.com/minigame/dev/api/device/battery/wx.getBatteryInfoSync.html) 在 iOS 上不可用。
|
||||
/// </summary>
|
||||
public static void GetBatteryInfo(GetBatteryInfoOption callback)
|
||||
{
|
||||
@ -541,6 +543,25 @@ namespace WeChatWASM
|
||||
WXSDKManagerHandler.Instance.GetConnectedBluetoothDevices(callback);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// [wx.getDeviceBenchmarkInfo(Object object)](https://developers.weixin.qq.com/minigame/dev/api/base/system/wx.getDeviceBenchmarkInfo.html)
|
||||
/// 需要基础库: `3.4.5`
|
||||
/// 获取设备性能得分和机型档位数据
|
||||
/// **示例代码**
|
||||
/// ```js
|
||||
/// wx.getDeviceBenchmarkInfo({
|
||||
/// success (res) {
|
||||
/// console.log(res.benchmarkLevel)
|
||||
/// console.log(res.modelLevel)
|
||||
/// }
|
||||
/// })
|
||||
/// ```
|
||||
/// </summary>
|
||||
public static void GetDeviceBenchmarkInfo(GetDeviceBenchmarkInfoOption callback)
|
||||
{
|
||||
WXSDKManagerHandler.Instance.GetDeviceBenchmarkInfo(callback);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// [wx.getExtConfig(Object object)](https://developers.weixin.qq.com/minigame/dev/api/ext/wx.getExtConfig.html)
|
||||
/// 需要基础库: `2.8.3`
|
||||
@ -857,36 +878,6 @@ namespace WeChatWASM
|
||||
|
||||
/// <summary>
|
||||
/// [wx.getSystemInfo(Object object)](https://developers.weixin.qq.com/minigame/dev/api/base/system/wx.getSystemInfo.html)
|
||||
/// 获取系统信息。**由于历史原因,wx.getSystemInfo 是异步的调用格式,但是是同步返回,需要异步获取系统信息请使用 [wx.getSystemInfoAsync](https://developers.weixin.qq.com/minigame/dev/api/base/system/wx.getSystemInfoAsync.html)。**
|
||||
/// **示例代码**
|
||||
/// [在微信开发者工具中查看示例](https://developers.weixin.qq.com/s/WkUCgXmS7mqO)
|
||||
/// ```js
|
||||
/// wx.getSystemInfo({
|
||||
/// success (res) {
|
||||
/// console.log(res.model)
|
||||
/// console.log(res.pixelRatio)
|
||||
/// console.log(res.windowWidth)
|
||||
/// console.log(res.windowHeight)
|
||||
/// console.log(res.language)
|
||||
/// console.log(res.version)
|
||||
/// console.log(res.platform)
|
||||
/// }
|
||||
/// })
|
||||
/// ```
|
||||
/// ```js
|
||||
/// try {
|
||||
/// const res = wx.getSystemInfoSync()
|
||||
/// console.log(res.model)
|
||||
/// console.log(res.pixelRatio)
|
||||
/// console.log(res.windowWidth)
|
||||
/// console.log(res.windowHeight)
|
||||
/// console.log(res.language)
|
||||
/// console.log(res.version)
|
||||
/// console.log(res.platform)
|
||||
/// } catch (e) {
|
||||
/// // Do something when catch error
|
||||
/// }
|
||||
/// ```
|
||||
/// </summary>
|
||||
public static void GetSystemInfo(GetSystemInfoOption callback)
|
||||
{
|
||||
@ -896,22 +887,6 @@ namespace WeChatWASM
|
||||
/// <summary>
|
||||
/// [wx.getSystemInfoAsync(Object object)](https://developers.weixin.qq.com/minigame/dev/api/base/system/wx.getSystemInfoAsync.html)
|
||||
/// 需要基础库: `2.25.3`
|
||||
/// 异步获取系统信息。需要一定的微信客户端版本支持,在不支持的客户端上,会使用同步实现来返回。
|
||||
/// **示例代码**
|
||||
/// [在微信开发者工具中查看示例](https://developers.weixin.qq.com/s/WkUCgXmS7mqO)
|
||||
/// ```js
|
||||
/// wx.getSystemInfoAsync({
|
||||
/// success (res) {
|
||||
/// console.log(res.model)
|
||||
/// console.log(res.pixelRatio)
|
||||
/// console.log(res.windowWidth)
|
||||
/// console.log(res.windowHeight)
|
||||
/// console.log(res.language)
|
||||
/// console.log(res.version)
|
||||
/// console.log(res.platform)
|
||||
/// }
|
||||
/// })
|
||||
/// ```
|
||||
/// </summary>
|
||||
public static void GetSystemInfoAsync(GetSystemInfoAsyncOption callback)
|
||||
{
|
||||
@ -1339,7 +1314,7 @@ namespace WeChatWASM
|
||||
/// <summary>
|
||||
/// [wx.openChannelsUserProfile(Object object)](https://developers.weixin.qq.com/minigame/dev/api/open-api/channels/wx.openChannelsUserProfile.html)
|
||||
/// 需要基础库: `2.21.2`
|
||||
/// 打开视频号主页
|
||||
/// 打开视频号主页。若为插件环境,只允许在插件页面中调用。
|
||||
/// </summary>
|
||||
public static void OpenChannelsUserProfile(OpenChannelsUserProfileOption callback)
|
||||
{
|
||||
@ -1593,7 +1568,9 @@ namespace WeChatWASM
|
||||
|
||||
/// <summary>
|
||||
/// [wx.requestMidasPayment(Object object)](https://developers.weixin.qq.com/minigame/dev/api/midas-payment/wx.requestMidasPayment.html)
|
||||
/// 发起米大师支付
|
||||
/// 需要基础库: `2.19.2`
|
||||
/// 发起购买游戏币支付请求,可参考[虚拟支付2.0游戏币](https://developers.weixin.qq.com/minigame/dev/guide/open-ability/virtual-payment/coins.html)
|
||||
/// 虚拟支付全流程可参考[技术手册-虚拟支付篇](https://developers.weixin.qq.com/minigame/dev/guide/open-ability/virtual-payment/guide.html)
|
||||
/// **buyQuantity 限制说明**
|
||||
/// 购买游戏币的时候,buyQuantity 不可任意填写。需满足 buyQuantity * 游戏币单价 = 限定的价格等级。如:游戏币单价为 0.1 元,一次购买最少数量是 10。
|
||||
/// 有效价格等级如下:
|
||||
@ -1634,6 +1611,46 @@ namespace WeChatWASM
|
||||
WXSDKManagerHandler.Instance.RequestMidasPayment(callback);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// [wx.requestMidasPaymentGameItem(Object object)](https://developers.weixin.qq.com/minigame/dev/api/midas-payment/wx.requestMidasPaymentGameItem.html)
|
||||
/// 需要基础库: `2.19.2`
|
||||
/// 发起道具直购支付请求,可参考[虚拟支付2.0道具直购](https://developers.weixin.qq.com/minigame/dev/guide/open-ability/virtual-payment/goods.html ),虚拟支付全流程可参考[技术手册-虚拟支付篇](https://developers.weixin.qq.com/minigame/dev/guide/open-ability/virtual-payment/guide.html)
|
||||
/// **示例代码**
|
||||
/// ```js
|
||||
/// wx.requestMidasPaymentGameItem({
|
||||
/// signData: '{"mode":"goods","offerId":"123","buyQuantity":1,"env":0,"currencyType":"CNY","platform":"android","zoneId":"1","productId":"testproductId","goodsPrice":10,"outTradeNo":"xxxxxx","attach":"testdata"}',
|
||||
/// paySig: 'd0b8bbccbe34ed11549bcfd6602b08711f4acc0965253a949cd6a2b895152f9d',
|
||||
/// signature: 'd0b8bbccbe34ed11549bcfd6602b08711f4acc0965253a949cd6a2b895152f9d',
|
||||
/// success(res, errCode) {
|
||||
/// console.log('pay', res, errCode);
|
||||
/// },
|
||||
/// fail({
|
||||
/// errMsg,
|
||||
/// errCode
|
||||
/// }) {
|
||||
/// console.error(errMsg, errCode)
|
||||
/// }
|
||||
/// ```
|
||||
/// 支付签名代码实现
|
||||
/// ```python
|
||||
/// import hmac
|
||||
/// import hashlib
|
||||
/// import urllib.parse
|
||||
/// # sign_data 支付原串 注意这里sign_data需要和前端一致,原格式传递(包括空格和回车),建议后台下发,
|
||||
/// # appkey 米大师密钥
|
||||
/// # method 需要签名方法 requestMidasPaymentGameItem
|
||||
/// def gen_pay_sig(sign_data, appkey, method):
|
||||
/// need_encode_body = method + '&' + sign_data
|
||||
/// print(need_encode_body)
|
||||
/// return hmac.new(key=appkey.encode('utf-8'), msg=need_encode_body.encode('utf-8'),
|
||||
/// digestmod=hashlib.sha256).hexdigest()
|
||||
/// ```
|
||||
/// </summary>
|
||||
public static void RequestMidasPaymentGameItem(RequestMidasPaymentGameItemOption callback)
|
||||
{
|
||||
WXSDKManagerHandler.Instance.RequestMidasPaymentGameItem(callback);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// [wx.requestSubscribeMessage(Object object)](https://developers.weixin.qq.com/minigame/dev/api/open-api/subscribe-message/wx.requestSubscribeMessage.html)
|
||||
/// 需要基础库: `2.4.4`
|
||||
@ -1901,7 +1918,7 @@ namespace WeChatWASM
|
||||
/// 设置 [InnerAudioContext](https://developers.weixin.qq.com/minigame/dev/api/media/audio/InnerAudioContext.html) 的播放选项。设置之后对当前小程序全局生效。
|
||||
/// ****
|
||||
/// ## 注意事项
|
||||
/// - 为保证微信整体体验,speakerOn 为 true 时,客户端会忽略 mixWithOthers 参数的内容,强制与其它音频互斥
|
||||
/// - 为保证微信整体体验,speakerOn 为 true 时,客户端会忽略 mixWithOther 参数的内容,强制与其它音频互斥
|
||||
/// - 不支持在播放音频的过程中切换为扬声器播放,开发者如需切换可以先暂停当前播放的音频并记录下当前暂停的时间点,然后切换后重新从原来暂停的时间点开始播放音频
|
||||
/// - 目前 wx.setInnerAudioOption 接口不兼容 wx.createWebAudioContext 接口,也不兼容 wx.createInnerAudioContext 开启 useWebAudioImplement 的情况,将在后续版本中支持
|
||||
/// </summary>
|
||||
@ -1947,7 +1964,7 @@ namespace WeChatWASM
|
||||
|
||||
/// <summary>
|
||||
/// [wx.setStatusBarStyle(Object object)](https://developers.weixin.qq.com/minigame/dev/api/ui/statusbar/wx.setStatusBarStyle.html)
|
||||
/// 当在配置中设置 showStatusBarStyle 时,屏幕顶部会显示状态栏。此接口可以修改状态栏的样式。
|
||||
/// 当在配置中设置 showStatusBar 时,屏幕顶部会显示状态栏。此接口可以修改状态栏的样式。
|
||||
/// </summary>
|
||||
public static void SetStatusBarStyle(SetStatusBarStyleOption callback)
|
||||
{
|
||||
@ -1971,7 +1988,10 @@ namespace WeChatWASM
|
||||
/// <summary>
|
||||
/// [wx.setVisualEffectOnCapture(Object object)](https://developers.weixin.qq.com/minigame/dev/api/device/screen/wx.setVisualEffectOnCapture.html)
|
||||
/// 需要基础库: `3.1.4`
|
||||
/// 设置截屏/录屏时屏幕表现,仅支持在 Android 端调用
|
||||
/// 设置截屏/录屏时屏幕表现
|
||||
/// **Bug & Tip**
|
||||
/// 1. `tip`:iOS 要求基础库版本为 3.3.0 以上,且系统版本为 iOS 16 以上
|
||||
/// 2. `tip`:iOS 目前只支持处理录屏时的表现
|
||||
/// </summary>
|
||||
public static void SetVisualEffectOnCapture(SetVisualEffectOnCaptureOption callback)
|
||||
{
|
||||
@ -2064,6 +2084,9 @@ namespace WeChatWASM
|
||||
/// [wx.showShareImageMenu(Object object)](https://developers.weixin.qq.com/minigame/dev/api/share/wx.showShareImageMenu.html)
|
||||
/// 需要基础库: `2.14.3`
|
||||
/// 打开分享图片弹窗,可以将图片发送给朋友、收藏或下载
|
||||
/// **Bug & Tip**
|
||||
/// 1. `tip`: `needShowEntrance`分享的图片消息是否要带小程序入口,支持申明类目:商家自营、电商平台、餐饮服务(餐饮服务场所/餐饮服务管理企业、点餐平台、外卖平台)、旅游服务(住宿服务、景区服务、OTA、旅游管理单位)、生活服务(家政服务、丽人服务、宠物(非医院类)、婚庆服务、洗浴保健、休闲娱乐、百货/超市/便利店、开锁服务、营业性演出票务、其他宠物健康服务、洗浴保健平台、共享服务、跑腿、寄存、求职/招聘)
|
||||
/// 2. `tip`: `needShowEntrance`小游戏所有类目都支持
|
||||
/// </summary>
|
||||
public static void ShowShareImageMenu(ShowShareImageMenuOption callback)
|
||||
{
|
||||
@ -2464,15 +2487,6 @@ namespace WeChatWASM
|
||||
WXSDKManagerHandler.Instance.OpenPage(callback);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// [wx.requestMidasPaymentGameItem(Object object)]
|
||||
/// 发起米大师支付
|
||||
/// </summary>
|
||||
public static void RequestMidasPaymentGameItem(RequestMidasPaymentGameItemOption callback)
|
||||
{
|
||||
WXSDKManagerHandler.Instance.RequestMidasPaymentGameItem(callback);
|
||||
}
|
||||
|
||||
public static void RequestSubscribeLiveActivity(RequestSubscribeLiveActivityOption callback)
|
||||
{
|
||||
WXSDKManagerHandler.Instance.RequestSubscribeLiveActivity(callback);
|
||||
@ -2542,22 +2556,6 @@ namespace WeChatWASM
|
||||
WXSDKManagerHandler.Instance.ReportEvent(eventId, data);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// [wx.reportMonitor(string name, number value)](https://developers.weixin.qq.com/minigame/dev/api/data-analysis/wx.reportMonitor.html)
|
||||
/// 需要基础库: `2.1.2`
|
||||
/// 自定义业务数据监控上报接口。
|
||||
/// **使用说明**
|
||||
/// 使用前,需要在「小程序管理后台-运维中心-性能监控-业务数据监控」中新建监控事件,配置监控描述与告警类型。每一个监控事件对应唯一的监控ID,开发者最多可以创建128个监控事件。
|
||||
/// **示例代码**
|
||||
/// ```js
|
||||
/// wx.reportMonitor('1', 1)
|
||||
/// ```
|
||||
/// </summary>
|
||||
public static void ReportMonitor(string name, double value)
|
||||
{
|
||||
WXSDKManagerHandler.Instance.ReportMonitor(name, value);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// [wx.reportPerformance(Number id, Number value, String|Array dimensions)](https://developers.weixin.qq.com/minigame/dev/api/base/performance/wx.reportPerformance.html)
|
||||
/// 需要基础库: `2.10.0`
|
||||
@ -2651,6 +2649,9 @@ namespace WeChatWASM
|
||||
/// <summary>
|
||||
/// [wx.shareAppMessage(Object object)](https://developers.weixin.qq.com/minigame/dev/api/share/wx.shareAppMessage.html)
|
||||
/// 主动拉起转发,进入选择通讯录界面。
|
||||
/// ****
|
||||
/// ## 注意事项
|
||||
/// - 转发图片说明:仅当自定义分享图片权限被封禁时用 imageUrlId,其他情况都会用 imageUrl。 imageUrl 不填时使用游戏画面截图。
|
||||
/// </summary>
|
||||
public static void ShareAppMessage(ShareAppMessageOption option)
|
||||
{
|
||||
@ -3107,6 +3108,28 @@ namespace WeChatWASM
|
||||
WXSDKManagerHandler.Instance.OffMemoryWarning(result);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// [wx.onMenuButtonBoundingClientRectWeightChange(function listener)](https://developers.weixin.qq.com/minigame/dev/api/ui/menu/wx.onMenuButtonBoundingClientRectWeightChange.html)
|
||||
/// 需要基础库: `3.4.3`
|
||||
/// 监听菜单按钮(右上角胶囊按钮)的布局位置信息变化事件
|
||||
/// **示例代码**
|
||||
/// ```js
|
||||
/// const callback = res => console.log('menuButtonBoundingClientRectWeightChange', res)
|
||||
/// wx.onMenuButtonBoundingClientRectWeightChange(callback)
|
||||
/// // 取消监听
|
||||
/// wx.offMenuButtonBoundingClientRectWeightChange(callback)
|
||||
/// ```
|
||||
/// </summary>
|
||||
public static void OnMenuButtonBoundingClientRectWeightChange(Action<OnMenuButtonBoundingClientRectWeightChangeListenerResult> result)
|
||||
{
|
||||
WXSDKManagerHandler.Instance.OnMenuButtonBoundingClientRectWeightChange(result);
|
||||
}
|
||||
|
||||
public static void OffMenuButtonBoundingClientRectWeightChange(Action<OnMenuButtonBoundingClientRectWeightChangeListenerResult> result)
|
||||
{
|
||||
WXSDKManagerHandler.Instance.OffMenuButtonBoundingClientRectWeightChange(result);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// [wx.onMessage(function callback)](https://developers.weixin.qq.com/minigame/dev/api/open-api/context/wx.onMessage.html)
|
||||
/// 监听主域发送的消息
|
||||
@ -3270,17 +3293,28 @@ namespace WeChatWASM
|
||||
/// ```js
|
||||
/// wx.onUserCaptureScreen(function (res) {
|
||||
/// console.log('用户截屏了')
|
||||
/// return {
|
||||
/// query: "parameter=test", // 通过截屏图片打开小程序的query参数
|
||||
/// promise: new Promise((resolve) => { // 通过promise延时传递小程序的query参数
|
||||
/// setTimeout(() => {
|
||||
/// resolve({
|
||||
/// query: "parameter=test2",
|
||||
/// })
|
||||
/// }, 1000) // 在1秒内对query进行解析
|
||||
/// })
|
||||
/// }
|
||||
/// }
|
||||
/// )
|
||||
/// ```
|
||||
/// </summary>
|
||||
public static void OnUserCaptureScreen(Action<GeneralCallbackResult> res)
|
||||
public static void OnUserCaptureScreen(Action<OnUserCaptureScreenListenerResult> result)
|
||||
{
|
||||
WXSDKManagerHandler.Instance.OnUserCaptureScreen(res);
|
||||
WXSDKManagerHandler.Instance.OnUserCaptureScreen(result);
|
||||
}
|
||||
|
||||
public static void OffUserCaptureScreen(Action<GeneralCallbackResult> res)
|
||||
public static void OffUserCaptureScreen(Action<OnUserCaptureScreenListenerResult> result)
|
||||
{
|
||||
WXSDKManagerHandler.Instance.OffUserCaptureScreen(res);
|
||||
WXSDKManagerHandler.Instance.OffUserCaptureScreen(result);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@ -3420,6 +3454,9 @@ namespace WeChatWASM
|
||||
/// [wx.onShareTimeline(function listener)](https://developers.weixin.qq.com/minigame/dev/api/share/wx.onShareTimeline.html)
|
||||
/// 需要基础库: `2.11.3`
|
||||
/// 监听用户点击右上角菜单的「分享到朋友圈」按钮时触发的事件。本接口为 Beta 版本,暂只在 Android 平台支持。
|
||||
/// ****
|
||||
/// ## 注意事项
|
||||
/// - 转发图片说明:仅当自定义分享图片权限被封禁时用 imageUrlId,其他情况都会用 imageUrl。 imageUrl 不填时使用当前游戏的icon。
|
||||
/// </summary>
|
||||
public static void OnShareTimeline(Action<Action<OnShareTimelineListenerResult>> callback)
|
||||
{
|
||||
@ -3696,36 +3733,6 @@ namespace WeChatWASM
|
||||
|
||||
/// <summary>
|
||||
/// [Object wx.getSystemInfoSync()](https://developers.weixin.qq.com/minigame/dev/api/base/system/wx.getSystemInfoSync.html)
|
||||
/// [wx.getSystemInfo](https://developers.weixin.qq.com/minigame/dev/api/base/system/wx.getSystemInfo.html) 的同步版本
|
||||
/// **示例代码**
|
||||
/// [在微信开发者工具中查看示例](https://developers.weixin.qq.com/s/WkUCgXmS7mqO)
|
||||
/// ```js
|
||||
/// wx.getSystemInfo({
|
||||
/// success (res) {
|
||||
/// console.log(res.model)
|
||||
/// console.log(res.pixelRatio)
|
||||
/// console.log(res.windowWidth)
|
||||
/// console.log(res.windowHeight)
|
||||
/// console.log(res.language)
|
||||
/// console.log(res.version)
|
||||
/// console.log(res.platform)
|
||||
/// }
|
||||
/// })
|
||||
/// ```
|
||||
/// ```js
|
||||
/// try {
|
||||
/// const res = wx.getSystemInfoSync()
|
||||
/// console.log(res.model)
|
||||
/// console.log(res.pixelRatio)
|
||||
/// console.log(res.windowWidth)
|
||||
/// console.log(res.windowHeight)
|
||||
/// console.log(res.language)
|
||||
/// console.log(res.version)
|
||||
/// console.log(res.platform)
|
||||
/// } catch (e) {
|
||||
/// // Do something when catch error
|
||||
/// }
|
||||
/// ```
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public static SystemInfo GetSystemInfoSync()
|
||||
@ -3776,14 +3783,19 @@ namespace WeChatWASM
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// [[ImageData](https://developers.weixin.qq.com/minigame/dev/api/render/image/ImageData.html) wx.createImageData()](https://developers.weixin.qq.com/minigame/dev/api/render/image/wx.createImageData.html)
|
||||
/// 需要基础库: `2.24.6`
|
||||
/// 创建一个 ImageData 图片数据对象
|
||||
/// [[ImageData](https://developers.weixin.qq.com/minigame/dev/api/render/image/ImageData.html) wx.createImageData(number width, number height)](https://developers.weixin.qq.com/minigame/dev/api/render/image/wx.createImageData.html)
|
||||
/// 需要基础库: `3.4.10`
|
||||
/// 这里有两种使用方法, 一种是指定ImageData的宽和高, 另外一种是使用ImageData, 通过它本身的宽高尺寸来构建新的对象。
|
||||
/// **示例代码**
|
||||
/// ```js
|
||||
/// const imageData1 = wx.createImageData(100, 100)
|
||||
/// const imageData2 = wx.createImageData(imageData1)
|
||||
/// ```
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public static ImageData CreateImageData()
|
||||
public static ImageData CreateImageData(double width, double height)
|
||||
{
|
||||
return WXSDKManagerHandler.Instance.CreateImageData();
|
||||
return WXSDKManagerHandler.Instance.CreateImageData(width, height);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@ -3840,6 +3852,30 @@ namespace WeChatWASM
|
||||
/// <summary>
|
||||
/// [boolean wx.setMessageToFriendQuery(Object object)](https://developers.weixin.qq.com/minigame/dev/api/share/wx.setMessageToFriendQuery.html)
|
||||
/// 设置 wx.shareMessageToFriend 接口 query 字段的值
|
||||
/// **提示</title>
|
||||
/// 1. 此处的 query 参数与 wx.onShow 取到的启动查询参数 query 不是同一个概念,仅仅是启动查询参数会增加一个字段为 query。
|
||||
/// 2. query 参数如涉及 "?"和"&" 等特殊符号,需自行进行 encodeURIComponent 和 decodeURIComponent 等操作。
|
||||
/// <title>示例代码</title>
|
||||
/// ```js
|
||||
/// // 发送方
|
||||
/// wx.setMessageToFriendQuery({
|
||||
/// shareMessageToFriendScene: 1,
|
||||
/// query: 'testquery'
|
||||
/// })
|
||||
/// // 预期接收方可以通过以下方式拿到设置
|
||||
/// wx.getEnterOptionsSync().query.shareMessageToFriendScene // 1
|
||||
/// wx.getEnterOptionsSync().query.query // 'testquery'
|
||||
/// <title>示例代码-特殊字符query**
|
||||
/// ```js
|
||||
/// // 发送方
|
||||
/// wx.setMessageToFriendQuery({
|
||||
/// query: encodeURIComponent('foo=1&bar=2') // 如果 query 涉及特殊符号,需要自行 encodeURIComponent
|
||||
/// })
|
||||
/// // 接收方
|
||||
/// // 预期可以通过以下方式拿到设置
|
||||
/// wx.getEnterOptionsSync().query.query // 此处拿到的是 'foo%3D1%26bar%3D2',需要 decodeURIComponent
|
||||
/// decodeURIComponent(wx.getEnterOptionsSync().query.query) // 'foo=1&bar=2'
|
||||
/// ```
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public static bool SetMessageToFriendQuery(SetMessageToFriendQueryOption option)
|
||||
|
||||
@ -37,7 +37,7 @@ namespace WeChatWASM
|
||||
/// <summary>
|
||||
/// Gets 云函数
|
||||
/// </summary>
|
||||
public static Cloud cloud
|
||||
public static WXCloud cloud
|
||||
{
|
||||
get
|
||||
{
|
||||
@ -265,7 +265,7 @@ namespace WeChatWASM
|
||||
/// <returns>对banner广告做操作的对象,详见 https://developers.weixin.qq.com/minigame/dev/api/ad/BannerAd.html </returns>
|
||||
/// <example>
|
||||
/// // 底部banner广告示例
|
||||
/// var sysInfo = WX.GetSystemInfoSync();
|
||||
/// var windowInfo = WX.GetWindowInfo();
|
||||
/// var banner = WX.CreateBannerAd(new WXCreateBannerAdParam()
|
||||
/// {
|
||||
/// adUnitId = "adunit-2e20328227ca771b",
|
||||
@ -273,8 +273,8 @@ namespace WeChatWASM
|
||||
/// style = new Style()
|
||||
/// {
|
||||
/// left = 0,
|
||||
/// top = sysInfo.windowHeight - 100,
|
||||
/// width = sysInfo.windowWidth,
|
||||
/// top = windowInfo.windowHeight - 100,
|
||||
/// width = windowInfo.windowWidth,
|
||||
/// height = 100
|
||||
/// }
|
||||
/// });
|
||||
@ -287,8 +287,8 @@ namespace WeChatWASM
|
||||
/// });
|
||||
/// banner.OnResize((WXADResizeResponse res) =>
|
||||
/// {
|
||||
/// //拉取的广告可能跟设置的不一样,需要动态调整位置
|
||||
/// banner.style.top = sysInfo.windowHeight - res.height;
|
||||
/// // 拉取的广告可能跟设置的不一样,需要动态调整位置
|
||||
/// banner.style.top = windowInfo.windowHeight - res.height;
|
||||
/// });
|
||||
/// </example>
|
||||
public static WXBannerAd CreateBannerAd(WXCreateBannerAdParam param)
|
||||
@ -1088,6 +1088,16 @@ namespace WeChatWASM
|
||||
{
|
||||
WXSDKManagerHandler.Instance.SetDevicePixelRatio(ratio);
|
||||
}
|
||||
|
||||
public static void CallJSFunction(string sdkName, string functionName, params object[] args)
|
||||
{
|
||||
WXSDKManagerHandler.CallJSFunction(sdkName, functionName, args);
|
||||
}
|
||||
|
||||
public static string CallJSFunctionWithReturn(string sdkName, string functionName, params object[] args)
|
||||
{
|
||||
return WXSDKManagerHandler.CallJSFunctionWithReturn(sdkName, functionName, args);
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
133
Runtime/WXRuntimeExtDef.cs
Normal file
133
Runtime/WXRuntimeExtDef.cs
Normal file
@ -0,0 +1,133 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using UnityEngine;
|
||||
|
||||
namespace WeChatWASM
|
||||
{
|
||||
public class WXRuntimeExtDef
|
||||
{
|
||||
[RuntimeInitializeOnLoadMethod(RuntimeInitializeLoadType.BeforeSplashScreen)]
|
||||
static void OnWXRuntimeExtDefLoadRuntimeMethod()
|
||||
{
|
||||
Init();
|
||||
}
|
||||
|
||||
private static void Init()
|
||||
{
|
||||
|
||||
#if UNITY_2018_1_OR_NEWER
|
||||
WXRuntimeExtEnvDef.SETDEF("UNITY_2018_1_OR_NEWER", true);
|
||||
#else
|
||||
WXRuntimeExtEnvDef.SETDEF("UNITY_2018_1_OR_NEWER", false);
|
||||
#endif
|
||||
|
||||
#if UNITY_2020_1_OR_NEWER
|
||||
WXRuntimeExtEnvDef.SETDEF("UNITY_2020_1_OR_NEWER", true);
|
||||
#else
|
||||
WXRuntimeExtEnvDef.SETDEF("UNITY_2020_1_OR_NEWER", false);
|
||||
#endif
|
||||
|
||||
#if UNITY_2021_1_OR_NEWER
|
||||
WXRuntimeExtEnvDef.SETDEF("UNITY_2021_1_OR_NEWER", true);
|
||||
#else
|
||||
WXRuntimeExtEnvDef.SETDEF("UNITY_2021_1_OR_NEWER", false);
|
||||
#endif
|
||||
#if UNITY_2021_2_OR_NEWER
|
||||
WXRuntimeExtEnvDef.SETDEF("UNITY_2021_2_OR_NEWER", true);
|
||||
#else
|
||||
WXRuntimeExtEnvDef.SETDEF("UNITY_2021_2_OR_NEWER", false);
|
||||
#endif
|
||||
#if UNITY_2021_3_OR_NEWER
|
||||
WXRuntimeExtEnvDef.SETDEF("UNITY_2021_3_OR_NEWER", true);
|
||||
#else
|
||||
WXRuntimeExtEnvDef.SETDEF("UNITY_2021_3_OR_NEWER", false);
|
||||
#endif
|
||||
#if UNITY_EDITOR_OSX
|
||||
WXRuntimeExtEnvDef.SETDEF("UNITY_EDITOR_OSX", true);
|
||||
#else
|
||||
WXRuntimeExtEnvDef.SETDEF("UNITY_EDITOR_OSX", false);
|
||||
#endif
|
||||
#if UNITY_EDITOR_LINUX
|
||||
WXRuntimeExtEnvDef.SETDEF("UNITY_EDITOR_LINUX", true);
|
||||
#else
|
||||
WXRuntimeExtEnvDef.SETDEF("UNITY_EDITOR_LINUX", false);
|
||||
#endif
|
||||
#if UNITY_2020
|
||||
WXRuntimeExtEnvDef.SETDEF("UNITY_2020", true);
|
||||
#else
|
||||
WXRuntimeExtEnvDef.SETDEF("UNITY_2020", false);
|
||||
#endif
|
||||
#if UNITY_2021
|
||||
WXRuntimeExtEnvDef.SETDEF("UNITY_2021", true);
|
||||
#else
|
||||
WXRuntimeExtEnvDef.SETDEF("UNITY_2021", false);
|
||||
#endif
|
||||
#if UNITY_2022
|
||||
WXRuntimeExtEnvDef.SETDEF("UNITY_2022", true);
|
||||
#else
|
||||
WXRuntimeExtEnvDef.SETDEF("UNITY_2022", false);
|
||||
#endif
|
||||
#if UNITY_2022_2_OR_NEWER
|
||||
WXRuntimeExtEnvDef.SETDEF("UNITY_2022_2_OR_NEWER", true);
|
||||
#else
|
||||
WXRuntimeExtEnvDef.SETDEF("UNITY_2022_2_OR_NEWER", false);
|
||||
#endif
|
||||
#if UNITY_INSTANTGAME
|
||||
WXRuntimeExtEnvDef.SETDEF("UNITY_INSTANTGAME", true);
|
||||
#else
|
||||
WXRuntimeExtEnvDef.SETDEF("UNITY_INSTANTGAME", false);
|
||||
#endif
|
||||
#if WEIXINMINIGAME
|
||||
WXRuntimeExtEnvDef.SETDEF("WEIXINMINIGAME", true);
|
||||
#else
|
||||
WXRuntimeExtEnvDef.SETDEF("WEIXINMINIGAME", false);
|
||||
#endif
|
||||
#if TUANJIE_2022_3_OR_NEWER
|
||||
WXRuntimeExtEnvDef.SETDEF("TUANJIE_2022_3_OR_NEWER", true);
|
||||
#else
|
||||
WXRuntimeExtEnvDef.SETDEF("TUANJIE_2022_3_OR_NEWER", false);
|
||||
#endif
|
||||
|
||||
#if PLATFORM_WEIXINMINIGAME
|
||||
WXRuntimeExtEnvDef.SETDEF("PLATFORM_WEIXINMINIGAME", true);
|
||||
#else
|
||||
WXRuntimeExtEnvDef.SETDEF("PLATFORM_WEIXINMINIGAME", false);
|
||||
#endif
|
||||
|
||||
#if PLATFORM_WEBGL
|
||||
WXRuntimeExtEnvDef.SETDEF("PLATFORM_WEBGL", true);
|
||||
#else
|
||||
WXRuntimeExtEnvDef.SETDEF("PLATFORM_WEBGL", false);
|
||||
#endif
|
||||
RegisterController();
|
||||
}
|
||||
|
||||
private static void RegisterController()
|
||||
{
|
||||
// Example:
|
||||
/*
|
||||
WXRuntimeExtDef.RegisterAction("xxx", (args) =>
|
||||
{
|
||||
#if UNITY_2018
|
||||
return 1;
|
||||
#else
|
||||
return 0;
|
||||
#endif
|
||||
});
|
||||
*/
|
||||
WXRuntimeExtEnvDef.RegisterAction("Unity.GetObjectInstanceID", (args) =>
|
||||
{
|
||||
#if UNITY_2021_3_OR_NEWER
|
||||
if (args is UnityEngine.Object unityObject)
|
||||
{
|
||||
return unityObject.GetInstanceID();
|
||||
}
|
||||
#endif
|
||||
// unityObject.GetInstanceID() would never return 0.
|
||||
return 0;
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
7
Runtime/WXRuntimeExtDef.cs.meta
Normal file
7
Runtime/WXRuntimeExtDef.cs.meta
Normal file
@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 1bfa8a2ba04dd8c133e09ac1dcaa6539
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
8
Runtime/WXSDKPerf.meta
Normal file
8
Runtime/WXSDKPerf.meta
Normal file
@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: aef8914ede3654c3fbed916372d75964
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
49
Runtime/WXSDKPerf/WXPerfEngine.cs
Normal file
49
Runtime/WXSDKPerf/WXPerfEngine.cs
Normal file
@ -0,0 +1,49 @@
|
||||
#if ENABLE_WX_PERF_FEATURE
|
||||
|
||||
using System;
|
||||
using System.Diagnostics;
|
||||
using System.Reflection;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Xml;
|
||||
using UnityEngine;
|
||||
using UnityEngine.Scripting;
|
||||
using WXPerf;
|
||||
|
||||
namespace WXSDKPerf
|
||||
{
|
||||
[Preserve]
|
||||
[ComVisible(false)]
|
||||
public class WXPerfEngine
|
||||
{
|
||||
static WXPerfEngine_Implementation m_PerfEngineImplementation = null;
|
||||
|
||||
[RuntimeInitializeOnLoadMethod]
|
||||
public static void StartWXPerfEngine()
|
||||
{
|
||||
#if UNITY_EDITOR
|
||||
return;
|
||||
#endif
|
||||
|
||||
m_PerfEngineImplementation = new WXPerfEngine_Implementation();
|
||||
|
||||
m_PerfEngineImplementation.StartPerfEngine();
|
||||
}
|
||||
|
||||
|
||||
public static void Annotation(string InAnnotationString)
|
||||
{
|
||||
#if UNITY_EDITOR
|
||||
return;
|
||||
#endif
|
||||
if (m_PerfEngineImplementation == null)
|
||||
{
|
||||
UnityEngine.Debug.LogError("Annotation: Invalid m_PerfEngineImplementation! ");
|
||||
return;
|
||||
}
|
||||
|
||||
m_PerfEngineImplementation.Annotation(InAnnotationString);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
#endif // ENABLE_WX_PERF_FEATURE
|
||||
11
Runtime/WXSDKPerf/WXPerfEngine.cs.meta
Normal file
11
Runtime/WXSDKPerf/WXPerfEngine.cs.meta
Normal file
@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 8cf919bdb0222454ca11dee03ff47d57
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@ -37,7 +37,11 @@ public class WXTouchInputOverride : BaseInput
|
||||
protected override void OnEnable()
|
||||
{
|
||||
base.OnEnable();
|
||||
if (string.IsNullOrEmpty(WeChatWASM.WX.GetSystemInfoSync().platform)) return;
|
||||
#if UNITY_WEBGL && !UNITY_EDITOR
|
||||
if (string.IsNullOrEmpty(WeChatWASM.WX.GetDeviceInfo().platform)) return;
|
||||
#else
|
||||
return;
|
||||
#endif
|
||||
InitWechatTouchEvents();
|
||||
if (_standaloneInputModule)
|
||||
{
|
||||
|
||||
@ -1,6 +1,7 @@
|
||||
/* eslint-disable no-multi-assign */
|
||||
/* eslint-disable @typescript-eslint/naming-convention */
|
||||
const { version, SDKVersion, platform, system } = wx.getSystemInfoSync();
|
||||
const { version, SDKVersion } = wx.getAppBaseInfo();
|
||||
const { platform, system } = wx.getDeviceInfo();
|
||||
const accountInfo = wx.getAccountInfoSync();
|
||||
const envVersion = accountInfo?.miniProgram?.envVersion;
|
||||
function compareVersion(v1, v2) {
|
||||
@ -61,6 +62,8 @@ const isPcBrotliInvalid = isPc && !compareVersion(SDKVersion, $LOAD_DATA_FROM_SU
|
||||
const isMobileBrotliInvalid = isMobile && !compareVersion(SDKVersion, '2.21.1');
|
||||
// @ts-ignore
|
||||
const isBrotliInvalid = $COMPRESS_DATA_PACKAGE && (isPcBrotliInvalid || isMobileBrotliInvalid);
|
||||
// iOS系统版本>=17.5时,小游戏退后台会导致异常
|
||||
export const isIOS175 = compareVersion(systemVersion, '17.5') || isH5Renderer;
|
||||
// 是否能以iOS高性能模式运行
|
||||
// 请勿修改GameGlobal.canUseH5Renderer赋值!!!
|
||||
GameGlobal.canUseH5Renderer = isH5Renderer && isH5LibVersionValid;
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 72d6dce4f8fc2897d45ce801d61a4dc2
|
||||
guid: 44a7e1e416ef5132a57ccfa3939eca38
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
fileFormatVersion: 2
|
||||
guid: a2d4f5bdedb1bc3b95c91a779ba77ec6
|
||||
guid: a8c126ddc61c8cc6ed296c38f7f1e957
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 59cfd066f14f854efa857ecb2fadcf4f
|
||||
guid: 98eb2eb98064d124aae821b0310bacf2
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
|
||||
@ -27,8 +27,9 @@ const managerConfig = {
|
||||
'$PRELOAD_LIST',
|
||||
],
|
||||
contextConfig: {
|
||||
contextType: $WEBGL_VERSION, // 1=>webgl1 2=>webgl2 3=>auto
|
||||
contextType: $WEBGL_VERSION, // 1: webgl1 2: webgl2
|
||||
},
|
||||
PROFILER_UPLOAD_URL: '',
|
||||
};
|
||||
GameGlobal.managerConfig = managerConfig;
|
||||
// 版本检查
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 7ec0c02137f9d2e4044b68f37374cd7d
|
||||
guid: d7844e1d7d7626fe49436142ee66a9e6
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
|
||||
@ -23,7 +23,7 @@
|
||||
],
|
||||
"plugins": {
|
||||
"UnityPlugin": {
|
||||
"version": "1.2.57",
|
||||
"version": "1.2.60",
|
||||
"provider": "wxe5a48f1ed5f544b7",
|
||||
"contexts": [
|
||||
{
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 4a9ed3cdd5ee4249a9a0e9d362af10f1
|
||||
guid: 277f37fd525363bcd0ac1e76c7190146
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
fileFormatVersion: 2
|
||||
guid: e1e18f34ba2da9dc774aaa9f71b6c65d
|
||||
guid: 6f7065a76a20ec762f47e6af22bd76d9
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 018bde0dd2339559e0356d0d2b9de69e
|
||||
guid: 1c01ed2e5319c00de34c7913548e1b60
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
fileFormatVersion: 2
|
||||
guid: a68c82a0213815cacd975d33bf6afd9b
|
||||
guid: 3d4add50de1d58ec65ecc3bec54d3de1
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 0fa0f0271021426b2080ded743c8b0bf
|
||||
guid: 471715336cf16bf9aa11245d6cb64343
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 8d11e31e7caca540fdc766f871122c80
|
||||
guid: dc92d9012b6b5518e4ee161dd9ee324f
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 7cb5c1387d3b2acb3ce5356ce57380e6
|
||||
guid: e408a2e1dafb6b88fe6fea613212ccdc
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 02a12edbd7b0f6ee4ba77232630ca383
|
||||
guid: fca653978f3fe1e0541ebe4d81db4271
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 59779c16150d1f382b45ba4866e7dd1c
|
||||
guid: ac9029b2e489f669e74be2600ee58343
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 2532269bcf252fcee88ecba03de5d72d
|
||||
guid: f0bd9aa7e524c03c5dd7d51bc605a57a
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
fileFormatVersion: 2
|
||||
guid: edf0798181946fe765cffbfa275107b8
|
||||
guid: bcc0d1cce30fa211c0684b1cab7aa4ab
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 4f35c0f99890aa7167a8b793ef796f7b
|
||||
guid: 423a761412c9bb3c2fa7e3b745917f8c
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
fileFormatVersion: 2
|
||||
guid: e7f5cdaff48140433dfab80dcc60ff50
|
||||
guid: e9f20942a9f85ab47412b9fce3937954
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
fileFormatVersion: 2
|
||||
guid: e20c703a4afeffbc151a8529e610628f
|
||||
guid: 0b69c585d2010389e4455b910717079f
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
fileFormatVersion: 2
|
||||
guid: f2d4bf3f9e7cca52022c9916a0bc805a
|
||||
guid: 21a2b3bbc3c4c4394354fe38eaebe2f1
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 9fb683a8d8682a682df92d7d4b57bccd
|
||||
guid: 4d933c70f2eadac74f8f05b07b3265f5
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
fileFormatVersion: 2
|
||||
guid: d13bcdff7663b0186343ad1cd5f01351
|
||||
guid: a044c9fb8bcc674808b1922fc08d517a
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
fileFormatVersion: 2
|
||||
guid: aa6c5025c4f439deebc67f3c201ce3fe
|
||||
guid: e05acefc59d97fe85f2d4c5db3ad919e
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 473696906e6decf639a7b151b55b06d0
|
||||
guid: d49e7b1725866a315e43d17ef34ffe02
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
fileFormatVersion: 2
|
||||
guid: a7633767ecff0c165078c8a39a65f57d
|
||||
guid: 9fa840e35fcb24b74a5d7ba50fb15c61
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 3e974b94f0607e60e2ed654660c28197
|
||||
guid: dbc5a57b21ae6ff0474262aa85d04a9f
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 7fd5bda63363df9354b79c947a54c9dc
|
||||
guid: 582c265cbb4802baaeb8b4951551027d
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
fileFormatVersion: 2
|
||||
guid: b2f277527f24b913e7191f7a03bfda7d
|
||||
guid: 5b3878e7fa96b761a24d659858f80a57
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 6ec5bc93a18bd82ab155bb0f188c2330
|
||||
guid: ad740f946e41fcc1eb2a431f058be6d7
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 62e052f5b55673e931795d2d026560aa
|
||||
guid: 70169de3f7f88310e8a581b1d4ee7cd5
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 455e8dee47c748b7f399c53bac8a19f5
|
||||
guid: d92d43031458152693c68d32566ca073
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
|
||||
@ -53,6 +53,12 @@ const unityNamespace = {
|
||||
useBrotliMT: $USE_BROTLI_MT,
|
||||
// Boot config配置,包含例如wait-for-native-debugger、player-connection-ip等信息
|
||||
bootConfig: '$BOOT_CONFIG_INFO',
|
||||
// 是否以Development Build构建
|
||||
isDevelopmentBuild: $Is_Development_Build,
|
||||
// 是否以Profiling Build导出
|
||||
isProfilingBuild: $Is_Profiling_Build,
|
||||
// 预留的堆内存
|
||||
unityHeapReservedMemory: $UnityHeapReservedMemory,
|
||||
};
|
||||
// 最佳实践检测配置
|
||||
unityNamespace.monitorConfig = {
|
||||
@ -131,62 +137,50 @@ function bindGloblException() {
|
||||
console.error('unhandledRejection:', result.reason);
|
||||
});
|
||||
// 上报初始信息
|
||||
function printSystemInfo(systemInfo) {
|
||||
GameGlobal.systemInfoCached = systemInfo;
|
||||
const { version, SDKVersion, platform, renderer, system } = systemInfo;
|
||||
function printSystemInfo(appBaseInfo, deviceInfo) {
|
||||
const { version, SDKVersion } = appBaseInfo;
|
||||
const { platform, system } = deviceInfo;
|
||||
unityNamespace.version = version;
|
||||
unityNamespace.SDKVersion = SDKVersion;
|
||||
unityNamespace.platform = platform;
|
||||
unityNamespace.renderer = renderer;
|
||||
unityNamespace.system = system;
|
||||
unityNamespace.isPc = platform === 'windows' || platform === 'mac';
|
||||
unityNamespace.isDevtools = platform === 'devtools';
|
||||
unityNamespace.isMobile = !unityNamespace.isPc && !unityNamespace.isDevtools;
|
||||
unityNamespace.isH5Renderer = unityNamespace.isMobile && unityNamespace.renderer === 'h5';
|
||||
unityNamespace.isH5Renderer = GameGlobal.isIOSHighPerformanceMode;
|
||||
unityNamespace.isIOS = platform === 'ios';
|
||||
unityNamespace.isAndroid = platform === 'android';
|
||||
const bootinfo = {
|
||||
renderer: systemInfo.renderer || '',
|
||||
renderer: GameGlobal.isIOSHighPerformanceMode ? 'h5' : '',
|
||||
isH5Plus: GameGlobal.isIOSHighPerformanceModePlus || false,
|
||||
abi: systemInfo.abi || '',
|
||||
brand: systemInfo.brand,
|
||||
model: systemInfo.model,
|
||||
platform: systemInfo.platform,
|
||||
system: systemInfo.system,
|
||||
version: systemInfo.version,
|
||||
SDKVersion: systemInfo.SDKVersion,
|
||||
benchmarkLevel: systemInfo.benchmarkLevel,
|
||||
abi: deviceInfo.abi || '',
|
||||
brand: deviceInfo.brand,
|
||||
model: deviceInfo.model,
|
||||
platform: deviceInfo.platform,
|
||||
system: deviceInfo.system,
|
||||
version: appBaseInfo.version,
|
||||
SDKVersion: appBaseInfo.SDKVersion,
|
||||
benchmarkLevel: deviceInfo.benchmarkLevel,
|
||||
};
|
||||
GameGlobal.realtimeLogManager.info('game starting', bootinfo);
|
||||
GameGlobal.logmanager.info('game starting', bootinfo);
|
||||
console.info('game starting', bootinfo);
|
||||
}
|
||||
const systemInfoSync = wx.getSystemInfoSync();
|
||||
const isEmptySystemInfo = systemInfoSync && Object.keys(systemInfoSync).length === 0;
|
||||
// iOS会出现getSystemInfoSync返回空对象的情况,使用异步方法替代
|
||||
if (isEmptySystemInfo) {
|
||||
wx.getSystemInfo({
|
||||
success(systemInfo) {
|
||||
printSystemInfo(systemInfo);
|
||||
},
|
||||
});
|
||||
}
|
||||
else {
|
||||
printSystemInfo(systemInfoSync);
|
||||
}
|
||||
const appBaseInfo = wx.getAppBaseInfo();
|
||||
const deviceInfo = wx.getDeviceInfo();
|
||||
printSystemInfo(appBaseInfo, deviceInfo);
|
||||
}
|
||||
bindGloblException();
|
||||
// eslint-disable-next-line no-multi-assign
|
||||
GameGlobal.onCrash = GameGlobal.unityNamespace.onCrash = function () {
|
||||
GameGlobal.manager.showAbort();
|
||||
// 避免已经修改屏幕尺寸,故不使用缓存的systeminfo
|
||||
const sysInfo = wx.getSystemInfoSync();
|
||||
const windowInfo = wx.getWindowInfo();
|
||||
wx.createFeedbackButton({
|
||||
type: 'text',
|
||||
text: '提交反馈',
|
||||
style: {
|
||||
left: (sysInfo.screenWidth - 184) / 2,
|
||||
top: sysInfo.screenHeight / 3 + 140,
|
||||
left: (windowInfo.screenWidth - 184) / 2,
|
||||
top: windowInfo.screenHeight / 3 + 140,
|
||||
width: 184,
|
||||
height: 40,
|
||||
lineHeight: 40,
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 16e3f2377b457ce84bab2c0dc79372ad
|
||||
guid: 11aed45104c833a22c3f244a3d1e3591
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
|
||||
@ -1,3 +1,4 @@
|
||||
/* eslint-disable @typescript-eslint/naming-convention */
|
||||
import { formatJsonStr, uid, onEventCallback, offEventCallback, getListObject, convertInfoToPointer, formatResponse, convertDataToPointer } from '../utils';
|
||||
const TCPSocketList = {};
|
||||
const wxTCPSocketBindWifiList = {};
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 7915839ff66cc08534f380f28d421a23
|
||||
guid: 8be8a5e031b65ccdd4964fac6fadd791
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
|
||||
@ -1,3 +1,4 @@
|
||||
/* eslint-disable @typescript-eslint/naming-convention */
|
||||
import { formatJsonStr, uid, onEventCallback, offEventCallback, getListObject, convertDataToPointer, convertInfoToPointer, formatResponse } from '../utils';
|
||||
const UDPSocketList = {};
|
||||
const wxUDPSocketCloseList = {};
|
||||
@ -150,12 +151,33 @@ function WX_UDPSocketSetTTL(id, ttl) {
|
||||
}
|
||||
obj.setTTL(ttl);
|
||||
}
|
||||
function WX_UDPSocketWrite(id) {
|
||||
function WX_UDPSocketWriteString(id, data, param) {
|
||||
const obj = getUDPSocketObject(id);
|
||||
if (!obj) {
|
||||
return;
|
||||
}
|
||||
obj.write();
|
||||
const config = formatJsonStr(param);
|
||||
obj.write({
|
||||
address: config.address,
|
||||
message: data,
|
||||
port: config.port,
|
||||
setBroadcast: config.setBroadcast,
|
||||
});
|
||||
}
|
||||
function WX_UDPSocketWriteBuffer(id, dataPtr, dataLength, param) {
|
||||
const obj = getUDPSocketObject(id);
|
||||
if (!obj) {
|
||||
return;
|
||||
}
|
||||
const config = formatJsonStr(param);
|
||||
obj.write({
|
||||
address: config.address,
|
||||
message: GameGlobal.Module.HEAPU8.buffer.slice(dataPtr, dataPtr + dataLength),
|
||||
port: config.port,
|
||||
length: config.length,
|
||||
offset: config.offset,
|
||||
setBroadcast: config.setBroadcast,
|
||||
});
|
||||
}
|
||||
function WX_UDPSocketBind(id, param) {
|
||||
const obj = getUDPSocketObject(id);
|
||||
@ -184,6 +206,7 @@ export default {
|
||||
WX_UDPSocketSendString,
|
||||
WX_UDPSocketSendBuffer,
|
||||
WX_UDPSocketSetTTL,
|
||||
WX_UDPSocketWrite,
|
||||
WX_UDPSocketWriteString,
|
||||
WX_UDPSocketWriteBuffer,
|
||||
WX_RegisterUDPSocketOnMessageCallback,
|
||||
};
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
fileFormatVersion: 2
|
||||
guid: ad0c2af65d2aaa61039b1a91f60c965e
|
||||
guid: 37c799c396873071f6eb977f96c2abd5
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
|
||||
@ -1,3 +1,4 @@
|
||||
/* eslint-disable no-param-reassign */
|
||||
import moduleHelper from './module-helper';
|
||||
import response from './response';
|
||||
import { formatJsonStr, uid } from './utils';
|
||||
@ -34,7 +35,7 @@ export default {
|
||||
return key;
|
||||
},
|
||||
WXCreateFixedBottomMiddleBannerAd(adUnitId, adIntervals, height) {
|
||||
const info = wx.getSystemInfoSync();
|
||||
const info = wx.getWindowInfo();
|
||||
const ad = wx.createBannerAd({
|
||||
adUnitId,
|
||||
adIntervals,
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 4ca24a076f21f26128fcda26c99ff736
|
||||
guid: 37e21b438d686abe321627746a8a0ea4
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
fileFormatVersion: 2
|
||||
guid: b9a20da3800ed88e020b6a62126c4702
|
||||
guid: 8f1ec5dc506b985667e29b95461c737d
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
fileFormatVersion: 2
|
||||
guid: ac82fe9291b4bfbf76796bc4d7098c9e
|
||||
guid: 288b902e490b8deeb4f5a9fbacdbdd94
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 0020cf35611516ccea666c36102ebf84
|
||||
guid: 97555a13c2ad9d2a5028a2045a4a1a49
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
|
||||
@ -1,3 +1,4 @@
|
||||
/* eslint-disable no-param-reassign */
|
||||
import moduleHelper from '../module-helper';
|
||||
import { isSupportPlayBackRate } from '../../check-version';
|
||||
import { audios, localAudioMap, downloadingAudioMap, innerAudioVolume, WEBAudio } from './store';
|
||||
@ -320,8 +321,8 @@ export default {
|
||||
if (key === 'onCanplay') {
|
||||
audios[id][key](() => {
|
||||
|
||||
|
||||
|
||||
// @ts-ignore
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||
const { duration, buffered, referrerPolicy, volume } = audios[id];
|
||||
setTimeout(() => {
|
||||
moduleHelper.send('OnAudioCallback', JSON.stringify({
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 6ac05f55130b3aa93cd6ef326374a2e8
|
||||
guid: 8e7ab8fe88edbd8067c59fe238e64a70
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 52cfb592dc9faceedd5a4aaa660d1f3e
|
||||
guid: 328cd64e28047419abd725446a57bd03
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
|
||||
@ -1,4 +1,7 @@
|
||||
import { isAndroid, isPc, webAudioNeedResume, isSupportBufferURL, isSupportPlayBackRate, isSupportInnerAudio, } from '../../check-version';
|
||||
/* eslint-disable no-param-reassign */
|
||||
/* eslint-disable eqeqeq */
|
||||
/* eslint-disable no-plusplus */
|
||||
import { isAndroid, isPc, webAudioNeedResume, isSupportBufferURL, isSupportPlayBackRate, isSupportInnerAudio, isIOS175, } from '../../check-version';
|
||||
import { WEBAudio, unityAudioVolume } from './store';
|
||||
import { TEMP_DIR_PATH } from './const';
|
||||
import { createInnerAudio, destroyInnerAudio, printErrMsg, resumeWebAudio } from './utils';
|
||||
@ -14,6 +17,7 @@ function jsAudioCreateUncompressedSoundClip(buffer, error, length) {
|
||||
this.buffer = null;
|
||||
WEBAudio.audioBufferLength -= length;
|
||||
},
|
||||
resetGain() { },
|
||||
getLength() {
|
||||
if (!this.buffer) {
|
||||
|
||||
@ -77,10 +81,11 @@ function jsAudioCreateCompressedSoundClip(audioData, ptr, length) {
|
||||
}
|
||||
delete this.url;
|
||||
},
|
||||
resetGain() { },
|
||||
getLength() {
|
||||
return this.length || 0;
|
||||
},
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||
getData(ptr, length) {
|
||||
console.warn('getData() is not supported for compressed sound.');
|
||||
return 0;
|
||||
@ -161,13 +166,18 @@ export class AudioChannelInstance {
|
||||
constructor(callback, userData) {
|
||||
if (WEBAudio.audioContext) {
|
||||
this.gain = WEBAudio.audioContext.createGain();
|
||||
if (this.gain) {
|
||||
this.gain.connect(WEBAudio.audioContext.destination);
|
||||
}
|
||||
this.gain?.connect(WEBAudio.audioContext.destination);
|
||||
}
|
||||
this.callback = callback;
|
||||
this.userData = userData;
|
||||
}
|
||||
resetGain() {
|
||||
if (WEBAudio.audioContext && this.gain) {
|
||||
this.gain.disconnect();
|
||||
this.gain = WEBAudio.audioContext.createGain();
|
||||
this.gain?.connect(WEBAudio.audioContext.destination);
|
||||
}
|
||||
}
|
||||
release() {
|
||||
this.disconnectSource();
|
||||
if (this.gain) {
|
||||
@ -276,8 +286,8 @@ export class AudioChannelInstance {
|
||||
});
|
||||
const fn = () => {
|
||||
if (typeof this.source !== 'undefined' && this.source.mediaElement) {
|
||||
|
||||
|
||||
// @ts-ignore
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||
const { duration } = this.source.mediaElement;
|
||||
setTimeout(() => {
|
||||
if (soundClip && this.source && this.source.mediaElement) {
|
||||
@ -538,7 +548,7 @@ export class AudioChannelInstance {
|
||||
}
|
||||
}, 100);
|
||||
};
|
||||
const innerPlay = () => {
|
||||
const innerPlay = (callback) => {
|
||||
if (this.source && this.source.mediaElement) {
|
||||
if (isSupportBufferURL && this.source.readyToPlay) {
|
||||
if (this.source.stopCache) {
|
||||
@ -551,6 +561,7 @@ export class AudioChannelInstance {
|
||||
innerFixPlay();
|
||||
}
|
||||
this.source.mediaElement.play();
|
||||
callback?.();
|
||||
}
|
||||
}
|
||||
else {
|
||||
@ -561,8 +572,8 @@ export class AudioChannelInstance {
|
||||
this.source.needCanPlay = false;
|
||||
this.source.readyToPlay = true;
|
||||
if (typeof this.source.mediaElement !== 'undefined') {
|
||||
|
||||
|
||||
// @ts-ignore
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||
const { duration } = this.source.mediaElement;
|
||||
|
||||
|
||||
@ -582,6 +593,7 @@ export class AudioChannelInstance {
|
||||
}
|
||||
if (typeof this.source.mediaElement !== 'undefined') {
|
||||
this.source.mediaElement.play();
|
||||
callback?.();
|
||||
}
|
||||
}
|
||||
};
|
||||
@ -594,7 +606,7 @@ export class AudioChannelInstance {
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/naming-convention
|
||||
const _reset = () => {
|
||||
if (!this.source) {
|
||||
return;
|
||||
@ -609,7 +621,7 @@ export class AudioChannelInstance {
|
||||
this.source.stopTicker = undefined;
|
||||
}
|
||||
};
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/naming-convention
|
||||
const _pauseMediaElement = () => {
|
||||
if (typeof this.source === 'undefined') {
|
||||
return;
|
||||
@ -621,28 +633,22 @@ export class AudioChannelInstance {
|
||||
this.source.mediaElement.pause();
|
||||
}
|
||||
};
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/naming-convention
|
||||
const _startPlayback = (offset) => {
|
||||
if (typeof this.source === 'undefined' || !this.source.mediaElement) {
|
||||
return;
|
||||
}
|
||||
if (this.source.playTimeout) {
|
||||
if (typeof this.source.mediaElement.seek === 'function') {
|
||||
this.source.mediaElement.seek(offset);
|
||||
}
|
||||
else {
|
||||
this.source.mediaElement.currentTime = offset;
|
||||
}
|
||||
this.source.pauseRequested = false;
|
||||
return;
|
||||
}
|
||||
innerPlay();
|
||||
if (typeof this.source.mediaElement.seek === 'function') {
|
||||
innerPlay(() => {
|
||||
|
||||
if (this.source && this.source.mediaElement) {
|
||||
this.source.mediaElement.seek(offset);
|
||||
}
|
||||
else {
|
||||
this.source.mediaElement.currentTime = offset;
|
||||
}
|
||||
});
|
||||
};
|
||||
const start = (startTime, offset) => {
|
||||
if (typeof this.source === 'undefined') {
|
||||
@ -710,22 +716,22 @@ export class AudioChannelInstance {
|
||||
start,
|
||||
stop,
|
||||
};
|
||||
|
||||
|
||||
// @ts-ignore
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||
const { buffered, referrerPolicy, volume } = getAudio;
|
||||
const { source } = this;
|
||||
Object.defineProperty(this.source, 'loopStart', {
|
||||
get() {
|
||||
return 0;
|
||||
},
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||
set(v) { },
|
||||
});
|
||||
Object.defineProperty(source, 'loopEnd', {
|
||||
get() {
|
||||
return 0;
|
||||
},
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||
set(v) { },
|
||||
});
|
||||
Object.defineProperty(source, 'loop', {
|
||||
@ -845,7 +851,7 @@ export default {
|
||||
if (!soundClip) {
|
||||
return defaultSoundLength;
|
||||
}
|
||||
const length = soundClip.getLength() || defaultSoundLength;
|
||||
const length = soundClip.getLength();
|
||||
return length;
|
||||
},
|
||||
_JS_Sound_GetLoadState(bufferInstance) {
|
||||
@ -882,13 +888,18 @@ export default {
|
||||
clearTimeout(webAutoResumeTicker);
|
||||
webAutoResumeTicker = null;
|
||||
}
|
||||
|
||||
if (!GameGlobal.isIOSHighPerformanceMode) {
|
||||
WEBAudio.audioContext?.suspend();
|
||||
}
|
||||
});
|
||||
wx.onShow(() => {
|
||||
|
||||
if (isIOS175) {
|
||||
WEBAudio.audioContext?.close();
|
||||
WEBAudio.audioContext = wx.createWebAudioContext();
|
||||
Object.values(WEBAudio.audioInstances).forEach(it => it.resetGain());
|
||||
}
|
||||
else {
|
||||
WEBAudio.audioContext?.resume();
|
||||
}
|
||||
});
|
||||
if (webAudioNeedResume) {
|
||||
|
||||
@ -1033,12 +1044,12 @@ export default {
|
||||
WEBAudio.lOrientation.yUp = yUp;
|
||||
WEBAudio.lOrientation.zUp = zUp;
|
||||
if (WEBAudio.audioContext.listener.forwardX) {
|
||||
WEBAudio.audioContext.listener.forwardX.setValueAtTime(-x, WEBAudio.audioContext.currentTime);
|
||||
WEBAudio.audioContext.listener.forwardY.setValueAtTime(-y, WEBAudio.audioContext.currentTime);
|
||||
WEBAudio.audioContext.listener.forwardZ.setValueAtTime(-z, WEBAudio.audioContext.currentTime);
|
||||
WEBAudio.audioContext.listener.upX.setValueAtTime(xUp, WEBAudio.audioContext.currentTime);
|
||||
WEBAudio.audioContext.listener.upY.setValueAtTime(yUp, WEBAudio.audioContext.currentTime);
|
||||
WEBAudio.audioContext.listener.upZ.setValueAtTime(zUp, WEBAudio.audioContext.currentTime);
|
||||
WEBAudio.audioContext.listener.forwardX = -x;
|
||||
WEBAudio.audioContext.listener.forwardY = -y;
|
||||
WEBAudio.audioContext.listener.forwardZ = -z;
|
||||
WEBAudio.audioContext.listener.upX = xUp;
|
||||
WEBAudio.audioContext.listener.upY = yUp;
|
||||
WEBAudio.audioContext.listener.upZ = zUp;
|
||||
}
|
||||
else {
|
||||
WEBAudio.audioContext.listener.setOrientation(-x, -y, -z, xUp, yUp, zUp);
|
||||
@ -1061,9 +1072,9 @@ export default {
|
||||
WEBAudio.lPosition.y = y;
|
||||
WEBAudio.lPosition.z = z;
|
||||
if (WEBAudio.audioContext.listener.positionX) {
|
||||
WEBAudio.audioContext.listener.positionX.setValueAtTime(x, WEBAudio.audioContext.currentTime);
|
||||
WEBAudio.audioContext.listener.positionY.setValueAtTime(y, WEBAudio.audioContext.currentTime);
|
||||
WEBAudio.audioContext.listener.positionZ.setValueAtTime(z, WEBAudio.audioContext.currentTime);
|
||||
WEBAudio.audioContext.listener.positionX = x;
|
||||
WEBAudio.audioContext.listener.positionY = y;
|
||||
WEBAudio.audioContext.listener.positionZ = z;
|
||||
}
|
||||
else {
|
||||
WEBAudio.audioContext.listener.setPosition(x, y, z);
|
||||
@ -1120,7 +1131,7 @@ export default {
|
||||
printErrMsg(`Invalid audio pitch ${v} specified to WebAudio backend!`);
|
||||
}
|
||||
},
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||
_JS_Sound_SetPosition(channelInstance, x, y, z) {
|
||||
if (WEBAudio.audio3DSupport === 0 || WEBAudio.audioWebSupport === 0 || WEBAudio.audioWebEnabled === 0) {
|
||||
return;
|
||||
@ -1186,7 +1197,7 @@ export default {
|
||||
if (!audioInstance) {
|
||||
return WEBAudio.FAKEMOD_SAMPLERATE;
|
||||
}
|
||||
|
||||
// eslint-disable-next-line no-nested-ternary
|
||||
const buffer = audioInstance.buffer
|
||||
? audioInstance.buffer
|
||||
: audioInstance.source
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
fileFormatVersion: 2
|
||||
guid: e3304f73e6fd57ceed8d59be6fefc04a
|
||||
guid: 02d563b4452e1007500b8f1a82ad59c6
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
|
||||
@ -45,7 +45,7 @@ export const destroyInnerAudio = (id, useCache) => {
|
||||
Object.keys(state).forEach((key) => {
|
||||
try {
|
||||
|
||||
|
||||
// @ts-ignore
|
||||
audios[id][key] = state[key];
|
||||
}
|
||||
catch (e) { }
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 99543aed462d8c06b7ed83009a04cf79
|
||||
guid: d8d8260bbc052f164588d3e5683220b5
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
|
||||
@ -7,7 +7,7 @@ export default {
|
||||
resolveFn = resolve;
|
||||
moduleHelper.send('_OnNeedPrivacyAuthorizationCallback', '{}');
|
||||
};
|
||||
|
||||
// @ts-ignore
|
||||
wx.onNeedPrivacyAuthorization(callback);
|
||||
},
|
||||
WX_PrivacyAuthorizeResolve(conf) {
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 37d6c89cb9a832b610c5c23cb3f808c0
|
||||
guid: c21bc9b30537e30c57d58da5f12d5aa1
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
|
||||
@ -1,3 +1,4 @@
|
||||
/* eslint-disable @typescript-eslint/naming-convention */
|
||||
import { convertDataToPointer } from '../utils';
|
||||
let wxOnBLECharacteristicValueChangeCallback;
|
||||
const OnBLECharacteristicValueChange = (res) => {
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 1c6f77f8b5f01b8c19a73d84cf0b780c
|
||||
guid: 79c014c85810762878fb9fba6d6db4f6
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
fileFormatVersion: 2
|
||||
guid: f817a176c576ff473ef5d3444e8c2643
|
||||
guid: c2c4c40648ddc3e939370bd89d3508f9
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 68f8f465fdafa7882b0af50892a53c33
|
||||
guid: 48e1f02e9b0b91f9c537510dd6b54716
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
fileFormatVersion: 2
|
||||
guid: b8b705a1320c936bd0ea596851bba410
|
||||
guid: cc598f0b5a617250e913512b28f32801
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
|
||||
@ -10,7 +10,7 @@ function createMiniGameChat(options, callback) {
|
||||
try {
|
||||
if (typeof requirePlugin !== 'undefined') {
|
||||
if (!MiniGameChat) {
|
||||
|
||||
// @ts-ignore
|
||||
MiniGameChat = requirePlugin('MiniGameChat', {
|
||||
enableRequireHostModule: true,
|
||||
customEnv: {
|
||||
@ -124,7 +124,7 @@ export default {
|
||||
if (!miniGameChat || typeof onList === 'undefined' || typeof onList[eventType] === 'undefined') {
|
||||
return;
|
||||
}
|
||||
|
||||
// eslint-disable-next-line no-restricted-syntax
|
||||
for (const key in Object.keys(onList[eventType])) {
|
||||
const callback = onList[eventType][key];
|
||||
if (callback) {
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
fileFormatVersion: 2
|
||||
guid: e3380dcf693977eacbdb98eb9bd1df40
|
||||
guid: 42abf1423fd47313211d9aef0fc5d845
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
|
||||
@ -1,37 +1,253 @@
|
||||
import response from './response';
|
||||
import { formatJsonStr } from './utils';
|
||||
/* eslint-disable no-param-reassign */
|
||||
import moduleHelper from './module-helper';
|
||||
import { uid, formatJsonStr, formatResponse } from './utils';
|
||||
const CloudIDObject = {};
|
||||
function fixWXCallFunctionData(data) {
|
||||
|
||||
for (const key in data) {
|
||||
const CDNObject = {};
|
||||
function fixCallFunctionData(data) {
|
||||
Object.keys(data).forEach((key) => {
|
||||
if (typeof data[key] === 'object') {
|
||||
fixWXCallFunctionData(data[key]);
|
||||
fixCallFunctionData(data[key]);
|
||||
}
|
||||
else if (typeof data[key] === 'string' && CloudIDObject[data[key]]) {
|
||||
else if (typeof data[key] === 'string') {
|
||||
if (CloudIDObject[data[key]]) {
|
||||
data[key] = CloudIDObject[data[key]];
|
||||
}
|
||||
if (CDNObject[data[key]]) {
|
||||
data[key] = CDNObject[data[key]];
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
const CloudList = {};
|
||||
export default {
|
||||
WXCallFunctionInit(conf) {
|
||||
const config = formatJsonStr(conf);
|
||||
wx.cloud.init(config);
|
||||
WX_CloudCloud(option) {
|
||||
const config = formatJsonStr(option);
|
||||
// @ts-ignore
|
||||
const cloud = new wx.cloud.Cloud(config);
|
||||
CloudList[config.resourceEnv] = cloud;
|
||||
},
|
||||
WX_CloudInit(option) {
|
||||
const config = formatJsonStr(option);
|
||||
if (config.env === '_default_') {
|
||||
wx.cloud.init();
|
||||
}
|
||||
else {
|
||||
CloudList[config.env].init(config);
|
||||
}
|
||||
},
|
||||
WX_CloudCallFunction(env, conf, callbackId) {
|
||||
const config = formatJsonStr(conf);
|
||||
if (config.data) {
|
||||
fixCallFunctionData(config.data);
|
||||
}
|
||||
let targetCloud;
|
||||
if (env === '_default_') {
|
||||
targetCloud = wx.cloud;
|
||||
}
|
||||
else {
|
||||
targetCloud = CloudList[env];
|
||||
}
|
||||
targetCloud.callFunction({
|
||||
...config,
|
||||
success(res) {
|
||||
formatResponse('CallFunctionResult', res);
|
||||
moduleHelper.send('_CloudCallFunctionCallback', JSON.stringify({
|
||||
callbackId, type: 'success', res: JSON.stringify(res),
|
||||
}));
|
||||
},
|
||||
fail(res) {
|
||||
formatResponse('GeneralCallbackResult', res);
|
||||
moduleHelper.send('_CloudCallFunctionCallback', JSON.stringify({
|
||||
callbackId, type: 'fail', res: JSON.stringify(res),
|
||||
}));
|
||||
},
|
||||
complete(res) {
|
||||
formatResponse('GeneralCallbackResult', res);
|
||||
moduleHelper.send('_CloudCallFunctionCallback', JSON.stringify({
|
||||
callbackId, type: 'complete', res: JSON.stringify(res),
|
||||
}));
|
||||
},
|
||||
WXCallFunction(name, data, conf, s, f, c) {
|
||||
const d = JSON.parse(data);
|
||||
fixWXCallFunctionData(d);
|
||||
wx.cloud.callFunction({
|
||||
name,
|
||||
data: d,
|
||||
config: conf === '' ? null : JSON.parse(conf),
|
||||
...response.handlecloudCallFunction(s, f, c),
|
||||
});
|
||||
},
|
||||
WXCloudID(cloudId) {
|
||||
|
||||
const res = wx.cloud.CloudID(cloudId);
|
||||
const r = JSON.stringify(res);
|
||||
CloudIDObject[r] = res;
|
||||
return r;
|
||||
WX_CloudCloudID(env, cloudID) {
|
||||
let targetCloud;
|
||||
if (env === '_default_') {
|
||||
targetCloud = wx.cloud;
|
||||
}
|
||||
else {
|
||||
targetCloud = CloudList[env];
|
||||
}
|
||||
const res = targetCloud.CloudID(cloudID);
|
||||
const id = `CloudID-${uid()}`;
|
||||
CloudIDObject[id] = res;
|
||||
return id;
|
||||
},
|
||||
WX_CloudCDN(env, target) {
|
||||
let targetCloud;
|
||||
if (env === '_default_') {
|
||||
targetCloud = wx.cloud;
|
||||
}
|
||||
else {
|
||||
targetCloud = CloudList[env];
|
||||
}
|
||||
const res = targetCloud.CDN(target);
|
||||
const id = `CDN-${uid()}`;
|
||||
CDNObject[id] = res;
|
||||
return id;
|
||||
},
|
||||
WX_CloudCallContainer(env, conf, callbackId) {
|
||||
const config = formatJsonStr(conf);
|
||||
let targetCloud;
|
||||
if (env === '_default_') {
|
||||
targetCloud = wx.cloud;
|
||||
}
|
||||
else {
|
||||
targetCloud = CloudList[env];
|
||||
}
|
||||
targetCloud.callContainer({
|
||||
...config,
|
||||
success(res) {
|
||||
formatResponse('CallContainerResult', res);
|
||||
moduleHelper.send('_CloudCallContainerCallback', JSON.stringify({
|
||||
callbackId, type: 'success', res: JSON.stringify(res),
|
||||
}));
|
||||
},
|
||||
fail(res) {
|
||||
formatResponse('GeneralCallbackResult', res);
|
||||
moduleHelper.send('_CloudCallContainerCallback', JSON.stringify({
|
||||
callbackId, type: 'fail', res: JSON.stringify(res),
|
||||
}));
|
||||
},
|
||||
complete(res) {
|
||||
formatResponse('GeneralCallbackResult', res);
|
||||
moduleHelper.send('_CloudCallContainerCallback', JSON.stringify({
|
||||
callbackId, type: 'complete', res: JSON.stringify(res),
|
||||
}));
|
||||
},
|
||||
});
|
||||
},
|
||||
WX_CloudUploadFile(env, conf, callbackId) {
|
||||
const config = formatJsonStr(conf);
|
||||
let targetCloud;
|
||||
if (env === '_default_') {
|
||||
targetCloud = wx.cloud;
|
||||
}
|
||||
else {
|
||||
targetCloud = CloudList[env];
|
||||
}
|
||||
targetCloud.uploadFile({
|
||||
...config,
|
||||
success(res) {
|
||||
formatResponse('UploadFileResult', res);
|
||||
moduleHelper.send('_CloudUploadFileCallback', JSON.stringify({
|
||||
callbackId, type: 'success', res: JSON.stringify(res),
|
||||
}));
|
||||
},
|
||||
fail(res) {
|
||||
formatResponse('GeneralCallbackResult', res);
|
||||
moduleHelper.send('_CloudUploadFileCallback', JSON.stringify({
|
||||
callbackId, type: 'fail', res: JSON.stringify(res),
|
||||
}));
|
||||
},
|
||||
complete(res) {
|
||||
formatResponse('GeneralCallbackResult', res);
|
||||
moduleHelper.send('_CloudUploadFileCallback', JSON.stringify({
|
||||
callbackId, type: 'complete', res: JSON.stringify(res),
|
||||
}));
|
||||
},
|
||||
});
|
||||
},
|
||||
WX_CloudDownloadFile(env, conf, callbackId) {
|
||||
const config = formatJsonStr(conf);
|
||||
let targetCloud;
|
||||
if (env === '_default_') {
|
||||
targetCloud = wx.cloud;
|
||||
}
|
||||
else {
|
||||
targetCloud = CloudList[env];
|
||||
}
|
||||
targetCloud.downloadFile({
|
||||
...config,
|
||||
success(res) {
|
||||
formatResponse('DownloadFileResult', res);
|
||||
moduleHelper.send('_CloudDownloadFileCallback', JSON.stringify({
|
||||
callbackId, type: 'success', res: JSON.stringify(res),
|
||||
}));
|
||||
},
|
||||
fail(res) {
|
||||
formatResponse('GeneralCallbackResult', res);
|
||||
moduleHelper.send('_CloudDownloadFileCallback', JSON.stringify({
|
||||
callbackId, type: 'fail', res: JSON.stringify(res),
|
||||
}));
|
||||
},
|
||||
complete(res) {
|
||||
formatResponse('GeneralCallbackResult', res);
|
||||
moduleHelper.send('_CloudDownloadFileCallback', JSON.stringify({
|
||||
callbackId, type: 'complete', res: JSON.stringify(res),
|
||||
}));
|
||||
},
|
||||
});
|
||||
},
|
||||
WX_CloudGetTempFileURL(env, conf, callbackId) {
|
||||
const config = formatJsonStr(conf);
|
||||
let targetCloud;
|
||||
if (env === '_default_') {
|
||||
targetCloud = wx.cloud;
|
||||
}
|
||||
else {
|
||||
targetCloud = CloudList[env];
|
||||
}
|
||||
targetCloud.getTempFileURL({
|
||||
...config,
|
||||
success(res) {
|
||||
formatResponse('GetTempFileURLResult', res);
|
||||
moduleHelper.send('_CloudGetTempFileURLCallback', JSON.stringify({
|
||||
callbackId, type: 'success', res: JSON.stringify(res),
|
||||
}));
|
||||
},
|
||||
fail(res) {
|
||||
formatResponse('GeneralCallbackResult', res);
|
||||
moduleHelper.send('_CloudGetTempFileURLCallback', JSON.stringify({
|
||||
callbackId, type: 'fail', res: JSON.stringify(res),
|
||||
}));
|
||||
},
|
||||
complete(res) {
|
||||
formatResponse('GeneralCallbackResult', res);
|
||||
moduleHelper.send('_CloudGetTempFileURLCallback', JSON.stringify({
|
||||
callbackId, type: 'complete', res: JSON.stringify(res),
|
||||
}));
|
||||
},
|
||||
});
|
||||
},
|
||||
WX_CloudDeleteFile(env, conf, callbackId) {
|
||||
const config = formatJsonStr(conf);
|
||||
let targetCloud;
|
||||
if (env === '_default_') {
|
||||
targetCloud = wx.cloud;
|
||||
}
|
||||
else {
|
||||
targetCloud = CloudList[env];
|
||||
}
|
||||
targetCloud.deleteFile({
|
||||
...config,
|
||||
success(res) {
|
||||
formatResponse('DeleteFileResult', res);
|
||||
moduleHelper.send('_CloudDeleteFileCallback', JSON.stringify({
|
||||
callbackId, type: 'success', res: JSON.stringify(res),
|
||||
}));
|
||||
},
|
||||
fail(res) {
|
||||
formatResponse('GeneralCallbackResult', res);
|
||||
moduleHelper.send('_CloudDeleteFileCallback', JSON.stringify({
|
||||
callbackId, type: 'fail', res: JSON.stringify(res),
|
||||
}));
|
||||
},
|
||||
complete(res) {
|
||||
formatResponse('GeneralCallbackResult', res);
|
||||
moduleHelper.send('_CloudDeleteFileCallback', JSON.stringify({
|
||||
callbackId, type: 'complete', res: JSON.stringify(res),
|
||||
}));
|
||||
},
|
||||
});
|
||||
},
|
||||
};
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 5fa4b26864e64bd3c5c7c1c830e75fb5
|
||||
guid: 05cd7b2d8a5c623ddede1517790281bc
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 0ed5cfbc1cb1dca5dfd9f4d41870b25e
|
||||
guid: b6624fa1bb3493bc3f3e4f05984deee4
|
||||
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