Auto-publish.

This commit is contained in:
rainhong 2024-11-21 14:37:48 +08:00
parent 8b0fd4f7e3
commit 2fc94b5ff1
109 changed files with 992 additions and 107 deletions

View File

@ -119,6 +119,7 @@ namespace WeChatWASM
CheckBuildTarget(); CheckBuildTarget();
Init(); Init();
ProcessWxPerfBinaries(); ProcessWxPerfBinaries();
MakeEnvForLuaAdaptor();
// JSLib // JSLib
SettingWXTextureMinJSLib(); SettingWXTextureMinJSLib();
UpdateGraphicAPI(); UpdateGraphicAPI();
@ -242,7 +243,7 @@ namespace WeChatWASM
try try
{ {
string metaPath = AssetDatabase.GetTextMetaFilePathFromAssetPath(inAssetPath); // 获取.meta文件的路径 string metaPath = AssetDatabase.GetTextMetaFilePathFromAssetPath(inAssetPath); // 获取.meta文件的路径
string enableFlagStr = inEnabled ? "1" : "0"; string enableFlagStr = inEnabled? "1" : "0";
// 读取.meta文件 // 读取.meta文件
// 处理WebGL // 处理WebGL
@ -313,7 +314,7 @@ namespace WeChatWASM
#else #else
wxPerf2022Importer.SetCompatibleWithPlatform(BuildTarget.WebGL, bShouldEnablePerf2022Plugin); wxPerf2022Importer.SetCompatibleWithPlatform(BuildTarget.WebGL, bShouldEnablePerf2022Plugin);
#endif #endif
SetPluginCompatibilityByModifyingMetadataFile(wxPerfPlugins[1], bShouldEnablePerf2022Plugin); SetPluginCompatibilityByModifyingMetadataFile(wxPerfPlugins[1], bShouldEnablePerf2022Plugin);
} }
{ {
@ -331,6 +332,127 @@ namespace WeChatWASM
AssetDatabase.Refresh(); AssetDatabase.Refresh();
} }
/**
* Lua Adaptor Settings.
*/
private static bool GetRequiredLuaHeaderFiles(out Dictionary<string, string> luaPaths)
{
luaPaths = new Dictionary<string, string>()
{
{"lua.h", null},
{"lobject.h", null},
{"lstate.h", null},
{"lfunc.h", null},
{"lapi.h", null},
{"lstring.h", null},
{"ltable.h", null},
{"lauxlib.h", null},
};
string rootPath = Directory.GetParent(Application.dataPath).ToString();
string[] paths = Directory.GetFiles(rootPath, "*.h", SearchOption.AllDirectories);
foreach (var path in paths)
{
string filename = Path.GetFileName(path);
if (luaPaths.ContainsKey(Path.GetFileName(path)))
{
luaPaths[filename] = path;
}
}
foreach (var expectFile in luaPaths)
{
if (expectFile.Value == null)
{
return false;
}
}
return true;
}
private static string GetLuaAdaptorPath(string filename)
{
string DS = WXAssetsTextTools.DS;
if (UnityUtil.GetSDKMode() == UnityUtil.SDKMode.Package)
{
return $"Packages{DS}com.qq.weixin.minigame{DS}Runtime{DS}Plugins{DS}LuaAdaptor{DS}{filename}";
}
return $"Assets{DS}WX-WASM-SDK-V2{DS}Runtime{DS}Plugins{DS}LuaAdaptor{DS}{filename}";
}
private static void MakeLuaImport(Dictionary<string, string> luaPaths)
{
string luaAdaptorImportHeaderPath = GetLuaAdaptorPath("lua_adaptor_import.h");
if (!File.Exists(luaAdaptorImportHeaderPath))
{
Debug.LogError("Lua Adaptor File Not Found: " + luaAdaptorImportHeaderPath);
return;
}
string includeLuaContent = "//EMSCRIPTEN_ENV_LUA_IMPORT_LOGIC_START";
foreach (var luaPath in luaPaths)
{
includeLuaContent += $"\n#include \"{luaPath.Value.Replace("\\", "\\\\")}\"";
}
includeLuaContent += "\n//EMSCRIPTEN_ENV_LUA_IMPORT_LOGIC_END";
string importHeaderContent = File.ReadAllText(luaAdaptorImportHeaderPath);
importHeaderContent = Regex.Replace(
importHeaderContent,
"//EMSCRIPTEN_ENV_LUA_IMPORT_LOGIC_START([\\s\\S]*?)//EMSCRIPTEN_ENV_LUA_IMPORT_LOGIC_END",
includeLuaContent
);
File.WriteAllText(luaAdaptorImportHeaderPath, importHeaderContent);
}
private static void ManageLuaAdaptorBuildOptions(bool shouldBuild) {
string[] maybeBuildFiles = new string[]
{
"lua_adaptor_501.c",
"lua_adaptor_503.c",
"lua_adaptor_comm.c",
"lua_adaptor_import.h",
};
foreach (var maybeBuildFile in maybeBuildFiles)
{
string path = GetLuaAdaptorPath(maybeBuildFile);
if (!File.Exists(path) && shouldBuild)
{
Debug.LogError("Lua Adaptor File Not Found: " + maybeBuildFile);
continue;
}
var wxPerfJSBridgeImporter = AssetImporter.GetAtPath(path) as PluginImporter;
if (wxPerfJSBridgeImporter == null)
{
Debug.LogError("Lua Adaptor Importer Not Found: " + maybeBuildFile);
continue;
}
#if PLATFORM_WEIXINMINIGAME
wxPerfJSBridgeImporter.SetCompatibleWithPlatform(BuildTarget.WeixinMiniGame, shouldBuild);
#else
wxPerfJSBridgeImporter.SetCompatibleWithPlatform(BuildTarget.WebGL, shouldBuild);
#endif
SetPluginCompatibilityByModifyingMetadataFile(path, shouldBuild);
}
}
private static void MakeEnvForLuaAdaptor()
{
bool hasLuaEnv = GetRequiredLuaHeaderFiles(out var luaPaths);
if (hasLuaEnv)
{
MakeLuaImport(luaPaths);
}
ManageLuaAdaptorBuildOptions(hasLuaEnv && config.CompileOptions.enablePerfAnalysis);
}
private static bool IsCompatibleWithUnity202203OrNewer() private static bool IsCompatibleWithUnity202203OrNewer()
{ {
#if UNITY_2022_3_OR_NEWER #if UNITY_2022_3_OR_NEWER
@ -642,7 +764,7 @@ namespace WeChatWASM
var header = "var OriginalAudioContext = window.AudioContext || window.webkitAudioContext;window.AudioContext = function() {if (this instanceof window.AudioContext) {return wx.createWebAudioContext();} else {return new OriginalAudioContext();}};"; var header = "var OriginalAudioContext = window.AudioContext || window.webkitAudioContext;window.AudioContext = function() {if (this instanceof window.AudioContext) {return wx.createWebAudioContext();} else {return new OriginalAudioContext();}};";
if (config.CompileOptions.DevelopBuild) if (config.CompileOptions.DevelopBuild && config.CompileOptions.enablePerfAnalysis)
{ {
header = header + RenderAnalysisRules.header; header = header + RenderAnalysisRules.header;
for (i = 0; i < RenderAnalysisRules.rules.Length; i++) for (i = 0; i < RenderAnalysisRules.rules.Length; i++)
@ -885,7 +1007,7 @@ namespace WeChatWASM
} }
} }
/// <summary> /// <summary>
/// 等brotli之后统计下资源包加brotli压缩后代码包是否超过了20M小游戏代码分包总大小限制 /// 等brotli之后统计下资源包加brotli压缩后代码包是否超过了30M小游戏代码分包总大小限制
/// </summary> /// </summary>
private static void convertDataPackage(bool brotliError) private static void convertDataPackage(bool brotliError)
{ {
@ -956,8 +1078,8 @@ namespace WeChatWASM
// 计算首资源包大小 // 计算首资源包大小
var tempDataInfo = new FileInfo(tempDataPath); var tempDataInfo = new FileInfo(tempDataPath);
var tempFileSize = tempDataInfo.Length.ToString(); var tempFileSize = tempDataInfo.Length.ToString();
// 胶水层及sdk可能占一定大小粗略按照1M来算则剩余19M // 胶水层及sdk可能占一定大小粗略按照1M来算则剩余29M
if (brcodeSize + int.Parse(tempFileSize) > (20 - 1) * 1024 * 1024) if (brcodeSize + int.Parse(tempFileSize) > (30 - 1) * 1024 * 1024)
{ {
config.ProjectConf.assetLoadType = 0; config.ProjectConf.assetLoadType = 0;
Debug.LogError("资源文件过大不适宜用放小游戏包内加载请上传资源文件到CDN"); Debug.LogError("资源文件过大不适宜用放小游戏包内加载请上传资源文件到CDN");

View File

@ -720,7 +720,20 @@ namespace WeChatWASM
{ {
const string MACRO_ENABLE_WX_PERF_FEATURE = "ENABLE_WX_PERF_FEATURE"; const string MACRO_ENABLE_WX_PERF_FEATURE = "ENABLE_WX_PERF_FEATURE";
string defineSymbols = PlayerSettings.GetScriptingDefineSymbolsForGroup(EditorUserBuildSettings.selectedBuildTargetGroup); string defineSymbols = PlayerSettings.GetScriptingDefineSymbolsForGroup(EditorUserBuildSettings.selectedBuildTargetGroup);
if (this.getDataCheckbox("enablePerfAnalysis") && this.getDataCheckbox("developBuild"))
bool shouldAddSymbol = this.getDataCheckbox("enablePerfAnalysis") && this.getDataCheckbox("developBuild");
#if !UNITY_2021_2_OR_NEWER || UNITY_2023_2_OR_NEWER
if(shouldAddSymbol)
{
shouldAddSymbol = false;
EditorUtility.DisplayDialog("警告", $"当前Unity版本({Application.unityVersion})不在性能分析工具适配范围内(2021.2-2023.1), 性能分析工具将被禁用。", "确定");
config.CompileOptions.enablePerfAnalysis = false;
this.setData("enablePerfAnalysis", false);
}
#endif
if (shouldAddSymbol)
{ {
if (defineSymbols.IndexOf(MACRO_ENABLE_WX_PERF_FEATURE) == -1) if (defineSymbols.IndexOf(MACRO_ENABLE_WX_PERF_FEATURE) == -1)
{ {

View File

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

Binary file not shown.

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: d3b689e5d408dbed9ed74e621b4a87bd
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,141 @@
#include "lua_adaptor_import.h"
#if LUA_VERSION_NUM == 501
static TValue* lua_index2addr(lua_State* L, int idx)
{
CallInfo* ci = L->ci;
if (idx > 0)
{
TValue* o = ci->func + idx;
// api_check(L, idx <= ci->top - (ci->func + 1), "unacceptable index");
if (o >= L->top) return NONVALIDVALUE;
else return o;
}
else if (!ispseudo(idx))
{
/* negative index */
// api_check(L, idx != 0 && -idx <= L->top - (ci->func + 1), "invalid index");
return L->top + idx;
}
else if (idx == LUA_REGISTRYINDEX)
return &G(L)->l_registry;
else
{
/* upvalues */
idx = LUA_REGISTRYINDEX - idx;
// api_check(L, idx <= MAXUPVAL + 1, "upvalue index too large");
if (iscfunction(ci->func))
return NONVALIDVALUE;
else
{
CClosure* func = &ci->func->value.gc->cl.c;
return (idx <= func->nupvalues) ? &func->upvalue[idx - 1] : NONVALIDVALUE;
}
}
}
size_t lua_sizeof(lua_State* L, int idx){
const char* tn = lua_typename(L, lua_type(L, -1));
TValue* o = lua_index2addr(L, idx);
if (!o)
return 0;
switch (ttype(o))
{
case LUA_TTABLE:
{
luaL_checkstack(L, LUA_MINSTACK, NULL);
Table* h = hvalue(o);
if (h == NULL) {
return 0;
}
return (sizeof(Table) + sizeof(TValue) * h->sizearray +
sizeof(Node) * (sizenode(h)));
}
case LUA_TFUNCTION:
{
if (iscfunction(o)) {
return sizeCclosure(o->value.gc->cl.c.nupvalues);
} else {
return sizeLclosure(o->value.gc->cl.l.nupvalues);
}
}
case LUA_TTHREAD:
{
lua_State* th = thvalue(o);
return (sizeof(lua_State) + sizeof(TValue) * th->stacksize +
sizeof(CallInfo) * th->size_ci);
}
case LUA_TPROTO:
{
Proto* p = (Proto*)pvalue(o);
return (sizeof(Proto) +
sizeof(Instruction) * p->sizecode +
sizeof(Proto*) * p->sizep +
sizeof(TValue) * p->sizek +
sizeof(int) * p->sizelineinfo +
sizeof(LocVar) * p->sizelocvars +
sizeof(TString*) * p->sizeupvalues);
}
case LUA_TUSERDATA:
{
return sizeudata(uvalue(o));
}
case LUA_TSTRING:
{
TString* ts = &o->value.gc->ts;
return sizeof(TString) + sizeof(char) * ts->tsv.len + 1;
}
case LUA_TNUMBER:
{
return sizeof(lua_Number);
}
case LUA_TBOOLEAN:
{
return sizeof(int);
}
case LUA_TLIGHTUSERDATA:
{
return sizeof(void*);
}
default: return (size_t)(0);
}
}
uintptr_t lua_getaddr(lua_State* L, int idx) {
TValue* o = lua_index2addr(L, idx);
if (!o)
return (uintptr_t)(lua_topointer(L, -1));
switch (ttype(o))
{
case LUA_TPROTO:
{
return (uintptr_t)(pvalue(o));
}
case LUA_TSTRING:
{
return (uintptr_t)(getstr(o));
}
case LUA_TTABLE:
case LUA_TFUNCTION:
case LUA_TTHREAD:
case LUA_TUSERDATA:
case LUA_TLIGHTUSERDATA:
default: {
return (uintptr_t)(lua_topointer(L, -1));
}
}
}
int (lua_getuservalue) (lua_State *L, int idx) {
lua_pushnil(L);
}
#endif

View File

@ -0,0 +1,74 @@
fileFormatVersion: 2
guid: 596142b9479e1ab4caaf44c77d5a7d8f
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: 1
settings: {}
- first:
WeixinMiniGame: WeixinMiniGame
second:
enabled: 1
settings: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,161 @@
#include "lua_adaptor_import.h"
#if LUA_VERSION_NUM == 503
#define GETTVALUE(v) v
#define tvtype(o) ttnov(o)
#define LUA_PROTO LUA_TPROTO
#define LUA_UPVAL LUA_TUPVAL
#define LUA_TABLE LUA_TTABLE
#define LUA_THREAD LUA_TTHREAD
#define LUA_USERDATA LUA_TUSERDATA
#define LUA_LIGHTUSERDATA LUA_TLIGHTUSERDATA
#define LUA_SHRSTR LUA_TSHRSTR
#define LUA_LNGSTR LUA_TLNGSTR
#define LUA_LCL LUA_TLCL
#define LUA_CCL LUA_TCCL
#define LUA_LCF LUA_TLCF
#define LUA_IS_LUA_C_FUNCTION(f) (ttislcf(f))
#define LUA_C_CLUSTER_VALUE(f) (clCvalue(f))
static TValue* lua_index2addr(lua_State* L, int idx)
{
CallInfo* ci = L->ci;
if (idx > 0)
{
TValue* o = GETTVALUE(ci->func + idx);
api_check(L, idx <= ci->top - (ci->func + 1), "unacceptable index");
if (o >= GETTVALUE(L->top)) return NONVALIDVALUE;
else return o;
}
else if (!ispseudo(idx))
{
/* negative index */
api_check(L, idx != 0 && -idx <= L->top - (ci->func + 1), "invalid index");
return GETTVALUE(L->top + idx);
}
else if (idx == LUA_REGISTRYINDEX)
return &G(L)->l_registry;
else
{
/* upvalues */
idx = LUA_REGISTRYINDEX - idx;
api_check(L, idx <= MAXUPVAL + 1, "upvalue index too large");
if (LUA_IS_LUA_C_FUNCTION(GETTVALUE(ci->func)))
return NONVALIDVALUE;
else
{
CClosure* func = LUA_C_CLUSTER_VALUE(GETTVALUE(ci->func));
return (idx <= func->nupvalues) ? &func->upvalue[idx - 1] : NONVALIDVALUE;
}
}
}
uintptr_t lua_getaddr(lua_State* L, int idx) {
TValue* o = lua_index2addr(L, idx);
if (!o)
return (uintptr_t)(lua_topointer(L, -1));
switch (tvtype(o))
{
case LUA_TPROTO:
{
return (uintptr_t)(pvalue(o));
}
case LUA_SHRSTR:
case LUA_LNGSTR:
{
return (uintptr_t)(tsvalue(o));
}
case LUA_TTABLE:
case LUA_LCL:
case LUA_CCL:
case LUA_LCF:
case LUA_TTHREAD:
case LUA_TUSERDATA:
case LUA_TLIGHTUSERDATA:
default: {
return (uintptr_t)(lua_topointer(L, -1));
}
}
}
size_t lua_sizeof(lua_State* L, int idx){
const char* tn = lua_typename(L, lua_type(L, -1));
TValue* o = lua_index2addr(L, idx);
if (!o)
return 0;
switch (tvtype(o))
{
case LUA_TABLE:
{
luaL_checkstack(L, LUA_MINSTACK, NULL);
Table* h = hvalue(o);
if (h == NULL) {
return 0;
}
return (sizeof(Table) + sizeof(TValue) * h->sizearray +
sizeof(Node) * (isdummy(h) ? 0 : sizenode(h)));
}
case LUA_LCL:
{
LClosure* cl = clLvalue(o);
return sizeLclosure(cl->nupvalues);
}
case LUA_CCL:
{
CClosure* cl = clCvalue(o);
return sizeCclosure(cl->nupvalues);
}
case LUA_TTHREAD:
{
lua_State* th = thvalue(o);
return (sizeof(lua_State) + sizeof(TValue) * th->stacksize +
sizeof(CallInfo) * th->nci);
}
case LUA_PROTO:
{
Proto* p = (Proto*)pvalue(o);
return (sizeof(Proto) +
sizeof(Instruction) * p->sizecode +
sizeof(Proto*) * p->sizep +
sizeof(TValue) * p->sizek +
sizeof(int) * p->sizelineinfo +
sizeof(LocVar) * p->sizelocvars +
sizeof(TString*) * p->sizeupvalues);
}
case LUA_USERDATA:
{
return sizeudata(uvalue(o));
}
case LUA_SHRSTR:
{
TString* ts = gco2ts(o);
return sizelstring(ts->shrlen);
}
case LUA_LNGSTR:
{
TString* ts = gco2ts(o);
return sizelstring(ts->u.lnglen);
}
case LUA_TNUMBER:
{
return sizeof(lua_Number);
}
case LUA_TBOOLEAN:
{
return sizeof(int);
}
case LUA_LIGHTUSERDATA:
{
return sizeof(void*);
}
default: return (size_t)(0);
}
}
#endif

View File

@ -0,0 +1,74 @@
fileFormatVersion: 2
guid: 798157947f88e004d938d2092163d6eb
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: 1
settings: {}
- first:
WeixinMiniGame: WeixinMiniGame
second:
enabled: 1
settings: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,20 @@
#include "lua_adaptor_import.h"
lua_Debug* lua_newdebugar() { return malloc(sizeof(lua_Debug)); }
void lua_deletedebugar(lua_Debug* ar) { return free(ar); }
const char* lua_Debug_getname(lua_Debug* ar) { return ar->name; }
char* lua_Debug_getshortsrc(lua_Debug* ar) { return ar->short_src; }
int lua_Debug_getevent(lua_Debug* ar) { return ar->event; }
int lua_Debug_getlinedefined(lua_Debug* ar) { return ar->linedefined; }
int lua_Debug_getlastlinedefined(lua_Debug* ar) { return ar->lastlinedefined; }
int lua_get_registry_index() { return LUA_REGISTRYINDEX; }
double lua_todouble(lua_State *L, int idx) { return (double)lua_tonumber(L, idx); }
lua_State* lua_State_getmainthread(lua_State* L) { return G(L)->mainthread; }
void (lua_do_sethook) (lua_State *L, lua_Hook func, int mask, int count) {
lua_sethook(L, func, mask, count);
}

View File

@ -0,0 +1,74 @@
fileFormatVersion: 2
guid: 2c61fe7994a261a48a95348a09bd839a
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: 1
settings: {}
- first:
WeixinMiniGame: WeixinMiniGame
second:
enabled: 1
settings: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,33 @@
#pragma once
#include "stdint.h"
#include <stdlib.h>
/* value at a non-valid index */
#define NONVALIDVALUE NULL//cast(TValue *, luaO_nilobject)
/* test for pseudo index */
#define ispseudo(i) ((i) <= LUA_REGISTRYINDEX)
#if LOCAL_DEBUG_USE_LUA_VERSION == 503
#include "lua53/lua.h"
#include "lua53/lobject.h"
#include "lua53/lstate.h"
#include "lua53/lfunc.h"
#include "lua53/lapi.h"
#include "lua53/lstring.h"
#include "lua53/ltable.h"
#include "lua53/lauxlib.h"
#elif LOCAL_DEBUG_USE_LUA_VERSION == 501
#include "lua51/lua.h"
#include "lua51/lobject.h"
#include "lua51/lstate.h"
#include "lua51/lfunc.h"
#include "lua51/lapi.h"
#include "lua51/lstring.h"
#include "lua51/ltable.h"
#include "lua51/lauxlib.h"
#elif __EMSCRIPTEN__
//EMSCRIPTEN_ENV_LUA_IMPORT_LOGIC_START
//EMSCRIPTEN_ENV_LUA_IMPORT_LOGIC_END
#endif

View File

@ -0,0 +1,74 @@
fileFormatVersion: 2
guid: 169ebbbcd2d6ffd4180f421d0ae2bd33
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: 1
settings: {}
- first:
WeixinMiniGame: WeixinMiniGame
second:
enabled: 1
settings: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -81,5 +81,18 @@ mergeInto(LibraryManager.library, {
const content = UTF8ToString(dataPtr); const content = UTF8ToString(dataPtr);
GameGlobal.manager.profiler.uploadStringWithDir({'str': content, 'len': bufSize, 'fileName': name, 'uploadDir': dir, 'cb': _JSProfilerUploadStringWithDirCallback}); GameGlobal.manager.profiler.uploadStringWithDir({'str': content, 'len': bufSize, 'fileName': name, 'uploadDir': dir, 'cb': _JSProfilerUploadStringWithDirCallback});
//} //}
},
JSExportFromIDBFS: function(idbfsPath, targetPath, snapshotFileName, frameIdx) {
const idbfsPathStr = UTF8ToString(idbfsPath);
const targetPathStr = UTF8ToString(targetPath);
const fileName = UTF8ToString(snapshotFileName);
GameGlobal.manager.profiler.uploadSnapshotBuffer({
'fileName': fileName,
'uploadSnapshotPath': targetPathStr,
'frameIdx': frameIdx,
'idbfsPathStr': idbfsPathStr,
'targetPathStr': targetPathStr
})
} }
}); });

Binary file not shown.

View File

@ -14,5 +14,27 @@
If the provided annotation string is null or empty, an error message will be logged. If the provided annotation string is null or empty, an error message will be logged.
</remarks> </remarks>
</member> </member>
<member name="M:WXSDKPerf.WXPerfEngine_Implementation.DeclareCustomStatInfo(System.String,System.String,System.Int32)">
<summary>
声明自定义性能指标
</summary>
<param name="inStatName">性能指标名称</param>
<param name="inStatCategory">性能指标类别</param>
<param name="inStatInterpType">性能指标展示方式1. 线性插值2. Step插值0. 只显示单一值</param>
</member>
<member name="M:WXSDKPerf.WXPerfEngine_Implementation.SetCustomStatInfo(System.String,System.Single)">
<summary>
设置自定义性能值,目前只支持浮点数
</summary>
<param name="inStatName">性能指标名称</param>
<param name="inValue">性能指标数值</param>
</member>
<member name="M:WXSDKPerf.WXPerfEngine_Implementation.SetLuaState(System.IntPtr)">
<summary>
指定luaState
</summary>
<param name="L">luaState</param>
</member>
<!-- Badly formed XML comment ignored for member "M:WXSDKPerf.WXPerfEngine_Implementation.AddCustomStatInfoBy(System.String,System.Single)" -->
</members> </members>
</doc> </doc>

Binary file not shown.

Binary file not shown.

View File

@ -16,12 +16,21 @@ PluginImporter:
second: second:
enabled: 0 enabled: 0
settings: settings:
Exclude Android: 1
Exclude Editor: 1 Exclude Editor: 1
Exclude Linux64: 1 Exclude Linux64: 1
Exclude OSXUniversal: 1 Exclude OSXUniversal: 1
Exclude WebGL: 1 Exclude WebGL: 1
Exclude Win: 1 Exclude Win: 1
Exclude Win64: 1 Exclude Win64: 1
Exclude WindowsStoreApps: 1
- first:
Android: Android
second:
enabled: 0
settings:
AndroidSharedLibraryType: Executable
CPU: ARMv7
- first: - first:
Any: Any:
second: second:
@ -69,6 +78,16 @@ PluginImporter:
second: second:
enabled: 0 enabled: 0
settings: {} settings: {}
- first:
Windows Store Apps: WindowsStoreApps
second:
enabled: 0
settings:
CPU: AnyCPU
DontProcess: false
PlaceholderPath:
SDK: AnySDK
ScriptingBackend: AnyScriptingBackend
userData: userData:
assetBundleName: assetBundleName:
assetBundleVariant: assetBundleVariant:

Binary file not shown.

View File

@ -871,13 +871,10 @@ namespace WeChatWASM
var abBytes = Unity.FontABTool.UnityFontABTool.PacKFontAB(inFontData, "WXFont", fSize * (Math.Abs(ascent) + Math.Abs(descent) + Math.Abs(lineGap)), fSize, fSize * ascent, fSize * descent); var abBytes = Unity.FontABTool.UnityFontABTool.PacKFontAB(inFontData, "WXFont", fSize * (Math.Abs(ascent) + Math.Abs(descent) + Math.Abs(lineGap)), fSize, fSize * ascent, fSize * descent);
try try
{ {
Debug.Log($"GetWXFont success, abBytes:{abBytes.Length}");
var ab = AssetBundle.LoadFromMemory(abBytes); var ab = AssetBundle.LoadFromMemory(abBytes);
Debug.Log($"GetWXFont success, ab:{ab}");
if (ab != null) if (ab != null)
{ {
Font[] fonts = ab.LoadAllAssets<Font>(); Font[] fonts = ab.LoadAllAssets<Font>();
Debug.Log($"GetWXFont success, fonts:{fonts.Length}");
if (fonts.Length != 0) if (fonts.Length != 0)
{ {
WriteLog($"Load font from ab. abBytes:{abBytes.Length}"); WriteLog($"Load font from ab. abBytes:{abBytes.Length}");

View File

@ -6,6 +6,8 @@ using System.Runtime.InteropServices;
using System.Xml; using System.Xml;
using UnityEngine; using UnityEngine;
using UnityEngine.Scripting; using UnityEngine.Scripting;
using System.IO;
#if PLATFORM_WEIXINMINIGAME || PLATFORM_WEBGL || UNITY_EDITOR #if PLATFORM_WEIXINMINIGAME || PLATFORM_WEBGL || UNITY_EDITOR
@ -17,8 +19,10 @@ namespace WXSDKPerf
[ComVisible(false)] [ComVisible(false)]
public class WXPerfEngine public class WXPerfEngine
{ {
#if !UNITY_EDITOR
static WXPerfEngine_Implementation m_PerfEngineImplementation = null; static WXPerfEngine_Implementation m_PerfEngineImplementation = null;
#endif
[RuntimeInitializeOnLoadMethod] [RuntimeInitializeOnLoadMethod]
public static void StartWXPerfEngine() public static void StartWXPerfEngine()
{ {
@ -42,8 +46,49 @@ namespace WXSDKPerf
return; return;
} }
if (InAnnotationString.Contains("CaptureUnityMemorySnapshot"))
{
TakeAndUploadUnityMemorySnapshot();
}
m_PerfEngineImplementation.Annotation(InAnnotationString); m_PerfEngineImplementation.Annotation(InAnnotationString);
#endif #endif
}
private static void TakeAndUploadUnityMemorySnapshot()
{
#if UNITY_EDITOR
return;
#else
DateTime timestamp = DateTime.Now;
var dateString = timestamp.ToLocalTime().ToString("yyyy-MM-dd_HH-mm-ss", System.Globalization.CultureInfo.InvariantCulture);
var snapshotFileName = $"{dateString}.snap";
#if UNITY_2018_3_OR_NEWER && !UNITY_2022_2_OR_NEWER
UnityEngine.Profiling.Memory.Experimental.MemoryProfiler.TakeSnapshot(Path.Combine(Application.persistentDataPath, snapshotFileName),
WXPerfEngine_Implementation.CaptureSnapshotCallback, (UnityEngine.Profiling.Memory.Experimental.CaptureFlags)31);
#elif UNITY_2022_2_OR_NEWER
Unity.Profiling.Memory.MemoryProfiler.TakeSnapshot(Path.Combine(Application.persistentDataPath, snapshotFileName),
WXPerfEngine_Implementation.CaptureSnapshotCallback, (Unity.Profiling.Memory.CaptureFlags)31);
#endif
#endif
}
public static void SetLuaState(IntPtr L)
{
#if UNITY_EDITOR
return;
#else
if (m_PerfEngineImplementation == null)
{
UnityEngine.Debug.LogError("SetLuaState: WXPerfEngine Not Started yet! Please Call WXSDKPerf.StartWXPerfEngine first! ");
return;
}
m_PerfEngineImplementation.SetLuaState(L);
#endif
} }
} }

View File

@ -39,14 +39,12 @@ public class WXTouchInputOverride : BaseInput
base.OnEnable(); base.OnEnable();
#if UNITY_WEBGL && !UNITY_EDITOR #if UNITY_WEBGL && !UNITY_EDITOR
if (string.IsNullOrEmpty(WeChatWASM.WX.GetDeviceInfo().platform)) return; if (string.IsNullOrEmpty(WeChatWASM.WX.GetDeviceInfo().platform)) return;
#else
return;
#endif
InitWechatTouchEvents(); InitWechatTouchEvents();
if (_standaloneInputModule) if (_standaloneInputModule)
{ {
_standaloneInputModule.inputOverride = this; _standaloneInputModule.inputOverride = this;
} }
#endif
} }
protected override void OnDisable() protected override void OnDisable()

View File

@ -1,5 +1,5 @@
fileFormatVersion: 2 fileFormatVersion: 2
guid: 97823f52a32b86a7499a3fa73c96afc9 guid: ccf2a34266eb4502ef44475a2b00cf9c
DefaultImporter: DefaultImporter:
externalObjects: {} externalObjects: {}
userData: userData:

View File

@ -1,5 +1,5 @@
fileFormatVersion: 2 fileFormatVersion: 2
guid: 219794af1ef977713f045cbe43ea9593 guid: 29a949bdafbd9ceb488b5b2e1b624f7e
DefaultImporter: DefaultImporter:
externalObjects: {} externalObjects: {}
userData: userData:

View File

@ -1,5 +1,5 @@
fileFormatVersion: 2 fileFormatVersion: 2
guid: 52fd4dfb2a4d4e613e8972f70f73c72c guid: 520a4e6bcddd4f1dae027c5222227218
DefaultImporter: DefaultImporter:
externalObjects: {} externalObjects: {}
userData: userData:

View File

@ -1,5 +1,5 @@
fileFormatVersion: 2 fileFormatVersion: 2
guid: 61cd022452f0bd8c65af17e4b00743f4 guid: 6da224d0ae358f9e6e630ddf0af13081
DefaultImporter: DefaultImporter:
externalObjects: {} externalObjects: {}
userData: userData:

View File

@ -23,7 +23,7 @@
], ],
"plugins": { "plugins": {
"UnityPlugin": { "UnityPlugin": {
"version": "1.2.62", "version": "1.2.63",
"provider": "wxe5a48f1ed5f544b7", "provider": "wxe5a48f1ed5f544b7",
"contexts": [ "contexts": [
{ {

View File

@ -1,5 +1,5 @@
fileFormatVersion: 2 fileFormatVersion: 2
guid: e60bc789f0ab5bec85bf2e376f8284a3 guid: 74a9e9163efc9424fdf886571ac5f1b1
DefaultImporter: DefaultImporter:
externalObjects: {} externalObjects: {}
userData: userData:

View File

@ -1,5 +1,5 @@
fileFormatVersion: 2 fileFormatVersion: 2
guid: 2f4438df33a0f0ebf2640b0649c8c5ea guid: 32f8fea4dc8e14ff7c61db874491cfc9
DefaultImporter: DefaultImporter:
externalObjects: {} externalObjects: {}
userData: userData:

View File

@ -1,5 +1,5 @@
fileFormatVersion: 2 fileFormatVersion: 2
guid: 6bf88ad8dc98251d2a199479bd560070 guid: 4c4a187b480c0b28a1cd3d2e70faed45
DefaultImporter: DefaultImporter:
externalObjects: {} externalObjects: {}
userData: userData:

View File

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

View File

@ -1,5 +1,5 @@
fileFormatVersion: 2 fileFormatVersion: 2
guid: 8499d1b79a6aa65c94b9c076e74a49e7 guid: 51b4e4fb2d806e82ec1cd8c735a5ce53
DefaultImporter: DefaultImporter:
externalObjects: {} externalObjects: {}
userData: userData:

View File

@ -1,5 +1,5 @@
fileFormatVersion: 2 fileFormatVersion: 2
guid: 9ffb272160ce906f2f05f5e3435100d4 guid: f3b45010071d3666730fe063e545911c
DefaultImporter: DefaultImporter:
externalObjects: {} externalObjects: {}
userData: userData:

View File

@ -1,5 +1,5 @@
fileFormatVersion: 2 fileFormatVersion: 2
guid: 486caede6f8d78b35fbf7f8323743658 guid: 9423febe00226796dc34e7f8946f8110
DefaultImporter: DefaultImporter:
externalObjects: {} externalObjects: {}
userData: userData:

View File

@ -1,5 +1,5 @@
fileFormatVersion: 2 fileFormatVersion: 2
guid: 886bcd79f8ca3b16e32e3a92aeb7e015 guid: 326bbe6f4c4f7358c909123d752eab20
DefaultImporter: DefaultImporter:
externalObjects: {} externalObjects: {}
userData: userData:

View File

@ -1,5 +1,5 @@
fileFormatVersion: 2 fileFormatVersion: 2
guid: f91a6ab5d750ddf85375cc226cd6609c guid: b3a6a12ee2a967c7b5be6be37bff380f
DefaultImporter: DefaultImporter:
externalObjects: {} externalObjects: {}
userData: userData:

View File

@ -1,5 +1,5 @@
fileFormatVersion: 2 fileFormatVersion: 2
guid: 3635de83a92f9e44edfaddbd8e0d1c38 guid: dbfc375a553975a30ea6572f46e95bae
DefaultImporter: DefaultImporter:
externalObjects: {} externalObjects: {}
userData: userData:

View File

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

View File

@ -1,5 +1,5 @@
fileFormatVersion: 2 fileFormatVersion: 2
guid: 2617b66f28a49076abb4ee352d19788d guid: 0c1f7661bca7eed95ee2c508b9c9dfcd
DefaultImporter: DefaultImporter:
externalObjects: {} externalObjects: {}
userData: userData:

View File

@ -1,5 +1,5 @@
fileFormatVersion: 2 fileFormatVersion: 2
guid: 08a1316e269a4f458ee21e2791e53763 guid: ecafbe8e790beeaaf7141ce6567d8876
DefaultImporter: DefaultImporter:
externalObjects: {} externalObjects: {}
userData: userData:

View File

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

View File

@ -1,5 +1,5 @@
fileFormatVersion: 2 fileFormatVersion: 2
guid: 1f2654155397d021638ab87fff9e85dc guid: d24e981f9a7d2d49b0a7c04a0593c214
DefaultImporter: DefaultImporter:
externalObjects: {} externalObjects: {}
userData: userData:

View File

@ -1,5 +1,5 @@
fileFormatVersion: 2 fileFormatVersion: 2
guid: d416737ad97d4b413f04477b5e771bc2 guid: aeeed2514ce16cc7f05345b3f9521f50
DefaultImporter: DefaultImporter:
externalObjects: {} externalObjects: {}
userData: userData:

View File

@ -1,5 +1,5 @@
fileFormatVersion: 2 fileFormatVersion: 2
guid: cc2e5e24b6072b15ceb44361f296df90 guid: ebba417eb8172e9bbe702a5735289827
DefaultImporter: DefaultImporter:
externalObjects: {} externalObjects: {}
userData: userData:

View File

@ -1,5 +1,5 @@
fileFormatVersion: 2 fileFormatVersion: 2
guid: df3778dddf38d6e2e70fb2230cc45337 guid: f619d8dacfcbd1774cc722d200d804c1
DefaultImporter: DefaultImporter:
externalObjects: {} externalObjects: {}
userData: userData:

View File

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

View File

@ -1,5 +1,5 @@
fileFormatVersion: 2 fileFormatVersion: 2
guid: b0e8dd4eb01db512c701e56c49e69cd9 guid: e6cc37182ef4b8b179557f50e756ccc4
DefaultImporter: DefaultImporter:
externalObjects: {} externalObjects: {}
userData: userData:

View File

@ -1,5 +1,5 @@
fileFormatVersion: 2 fileFormatVersion: 2
guid: e59b8cc81e26e2435d6e819b7e281543 guid: d7ee084c53a963329d8c67624f29fe5c
DefaultImporter: DefaultImporter:
externalObjects: {} externalObjects: {}
userData: userData:

View File

@ -1,5 +1,5 @@
fileFormatVersion: 2 fileFormatVersion: 2
guid: 1476c97a5ae10ab844bfa36479cab3a7 guid: b8381e41aa9efc402c4dae6cf4e55d80
DefaultImporter: DefaultImporter:
externalObjects: {} externalObjects: {}
userData: userData:

View File

@ -1,5 +1,5 @@
fileFormatVersion: 2 fileFormatVersion: 2
guid: 68316adf01618a13f5cd11f7a9208233 guid: 06eb6de4ab5c3d5361347ed7b95cc407
DefaultImporter: DefaultImporter:
externalObjects: {} externalObjects: {}
userData: userData:

View File

@ -1,5 +1,5 @@
fileFormatVersion: 2 fileFormatVersion: 2
guid: 8318550ddd214652cc70634265345c11 guid: 285dd620c892b04fde8d53c7adee5f73
DefaultImporter: DefaultImporter:
externalObjects: {} externalObjects: {}
userData: userData:

View File

@ -1,5 +1,5 @@
fileFormatVersion: 2 fileFormatVersion: 2
guid: 9c9cfe00459e3d98d371faed64c6581b guid: 808925ecfe83882b930aa8915119119b
DefaultImporter: DefaultImporter:
externalObjects: {} externalObjects: {}
userData: userData:

View File

@ -1,5 +1,5 @@
fileFormatVersion: 2 fileFormatVersion: 2
guid: b3ef44449b01a4fda7163361762d4410 guid: 993d829f1b6e010ce3a13853aea82ab8
DefaultImporter: DefaultImporter:
externalObjects: {} externalObjects: {}
userData: userData:

View File

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

View File

@ -1,5 +1,5 @@
fileFormatVersion: 2 fileFormatVersion: 2
guid: cabb7315277047b22b847b51e44c97ed guid: 03e6fe6cf161706be643e1644666d28f
DefaultImporter: DefaultImporter:
externalObjects: {} externalObjects: {}
userData: userData:

View File

@ -1,5 +1,5 @@
fileFormatVersion: 2 fileFormatVersion: 2
guid: d5dd1c4f53a95256f92e02877fb24e5f guid: b5ef1647b5cd762f64d0ab13dfd99557
DefaultImporter: DefaultImporter:
externalObjects: {} externalObjects: {}
userData: userData:

View File

@ -1,5 +1,5 @@
fileFormatVersion: 2 fileFormatVersion: 2
guid: 11c407e918b0152a3309161b9cd78113 guid: 482b10da0b2706601681d38393db79f5
DefaultImporter: DefaultImporter:
externalObjects: {} externalObjects: {}
userData: userData:

View File

@ -1,5 +1,5 @@
fileFormatVersion: 2 fileFormatVersion: 2
guid: 783aa54bb010ea4e001f4dbf62730c37 guid: f628323fb9e0f732544f20cea7766f0b
DefaultImporter: DefaultImporter:
externalObjects: {} externalObjects: {}
userData: userData:

View File

@ -1,5 +1,5 @@
fileFormatVersion: 2 fileFormatVersion: 2
guid: 2cbbbdcb93344a7124311e42c55b5bb2 guid: c68ccc85753a9faf1f0a6c5c2444273c
DefaultImporter: DefaultImporter:
externalObjects: {} externalObjects: {}
userData: userData:

View File

@ -1,5 +1,5 @@
fileFormatVersion: 2 fileFormatVersion: 2
guid: 07a9cd0a2626f44595d7f29d733b89ee guid: bd7f20051384d5e4134b23c3cbe318b5
DefaultImporter: DefaultImporter:
externalObjects: {} externalObjects: {}
userData: userData:

View File

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

View File

@ -1,5 +1,5 @@
fileFormatVersion: 2 fileFormatVersion: 2
guid: d5f05ca3bdc81cb9fce357c95ec873ae guid: 268ef4451a563ec6ae6450349b337d5f
DefaultImporter: DefaultImporter:
externalObjects: {} externalObjects: {}
userData: userData:

View File

@ -1,5 +1,5 @@
fileFormatVersion: 2 fileFormatVersion: 2
guid: 42929f66945c40a1d6d27644eff5cdf8 guid: 154e362b9229f75de20114cc74d343e7
DefaultImporter: DefaultImporter:
externalObjects: {} externalObjects: {}
userData: userData:

View File

@ -1,5 +1,5 @@
fileFormatVersion: 2 fileFormatVersion: 2
guid: ed4b2cab639c630ca3ae91405b19f7a8 guid: e7436d923afc2bcd7d010aa0b6c740ed
DefaultImporter: DefaultImporter:
externalObjects: {} externalObjects: {}
userData: userData:

View File

@ -1,5 +1,5 @@
fileFormatVersion: 2 fileFormatVersion: 2
guid: ffd9799c3467460af171681de07ea8b3 guid: 057ad3ebce73e566ef30009c9faf2e94
DefaultImporter: DefaultImporter:
externalObjects: {} externalObjects: {}
userData: userData:

View File

@ -1,5 +1,5 @@
fileFormatVersion: 2 fileFormatVersion: 2
guid: b9c33b8412e5529abb99f494e90d195a guid: 402713fe2a94ff34e0f0c20f181c8985
DefaultImporter: DefaultImporter:
externalObjects: {} externalObjects: {}
userData: userData:

View File

@ -1,5 +1,5 @@
fileFormatVersion: 2 fileFormatVersion: 2
guid: 2e1346d6e21a1c9008083a29bf887f34 guid: 465796cb21dc7d7dbe7ccaff2b905761
DefaultImporter: DefaultImporter:
externalObjects: {} externalObjects: {}
userData: userData:

View File

@ -1,5 +1,5 @@
fileFormatVersion: 2 fileFormatVersion: 2
guid: 3940f77c0d31f92afedf9024e7cfaf8a guid: 9b48a59242d255858967545db41b28cc
DefaultImporter: DefaultImporter:
externalObjects: {} externalObjects: {}
userData: userData:

View File

@ -1,5 +1,5 @@
fileFormatVersion: 2 fileFormatVersion: 2
guid: 997eefbec821961e1c44cd531f677b89 guid: 6acffcc315c1b9a749ebb5f885379d0b
DefaultImporter: DefaultImporter:
externalObjects: {} externalObjects: {}
userData: userData:

View File

@ -1,5 +1,5 @@
fileFormatVersion: 2 fileFormatVersion: 2
guid: 93139bc3bc57742bb0e6bb28f79915be guid: 18ab124765c9532fec612a7aec44e188
DefaultImporter: DefaultImporter:
externalObjects: {} externalObjects: {}
userData: userData:

View File

@ -1,5 +1,5 @@
fileFormatVersion: 2 fileFormatVersion: 2
guid: e552b83734628fe150e6f4213ddcc171 guid: 020754010adb3defdf7df2a3ef8c8135
DefaultImporter: DefaultImporter:
externalObjects: {} externalObjects: {}
userData: userData:

View File

@ -1,5 +1,5 @@
fileFormatVersion: 2 fileFormatVersion: 2
guid: 74e8a24aabc55f3f76d1650805e8d59f guid: fbee4e1f8c2a53f18567d81a2352aa85
DefaultImporter: DefaultImporter:
externalObjects: {} externalObjects: {}
userData: userData:

View File

@ -1,5 +1,5 @@
fileFormatVersion: 2 fileFormatVersion: 2
guid: 591e3b86c2697b322b94b4b7e2fb5a33 guid: 52ed6219a21188e1d534001a42aa2a26
DefaultImporter: DefaultImporter:
externalObjects: {} externalObjects: {}
userData: userData:

View File

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

View File

@ -1,5 +1,5 @@
fileFormatVersion: 2 fileFormatVersion: 2
guid: ad25169a36e6869eaab6fcc60d72a89d guid: 06eb9b4dcbed2e072bc4ed281ac81e23
DefaultImporter: DefaultImporter:
externalObjects: {} externalObjects: {}
userData: userData:

View File

@ -107,7 +107,8 @@ function handleGetFontData(config, forceFallback) {
xhr.onload = () => { xhr.onload = () => {
if ((xhr.status === 200 || xhr.status === 0) && xhr.response) { if ((xhr.status === 200 || xhr.status === 0) && xhr.response) {
fontDataCache = xhr.response; const notoFontData = xhr.response;
fontDataCache = notoFontData;
isReadFromCache = xhr.isReadFromCache; isReadFromCache = xhr.isReadFromCache;
resolve(); resolve();
} }
@ -128,7 +129,6 @@ function handleGetFontData(config, forceFallback) {
GameGlobal.manager.font.getCommonFont({ GameGlobal.manager.font.getCommonFont({
success(fontData) { success(fontData) {
console.warn('[font] get common font success', fontData);
if (isIOS) { if (isIOS) {
fixCmapTable(fontData); fixCmapTable(fontData);
@ -163,22 +163,19 @@ function WXGetFontRawData(conf, callbackId, forceFallback = false) {
moduleHelper.send('GetFontRawDataCallback', JSON.stringify({ callbackId, type: 'success', res: JSON.stringify({ byteLength: fontDataCache.byteLength, ascent, descent, lineGap, unitsPerEm }) })); moduleHelper.send('GetFontRawDataCallback', JSON.stringify({ callbackId, type: 'success', res: JSON.stringify({ byteLength: fontDataCache.byteLength, ascent, descent, lineGap, unitsPerEm }) }));
GameGlobal.manager.Logger.pluginLog(`[font] load font from ${forceFallback || loadFromRemote ? `network, url=${config.fallbackUrl}` : 'local'}`); GameGlobal.manager.Logger.pluginLog(`[font] load font from ${forceFallback || loadFromRemote ? `network, url=${config.fallbackUrl}` : 'local'}`);
fontDataCache = null;
} }
else { else {
GameGlobal.manager.Logger.pluginError('[font] load font error: empty content');
console.error('[font] load font error: empty content');
} }
}) })
.catch((err) => { .catch((err) => {
if (err.errmsg === 'no support font' && forceFallback === false) { if (err.errmsg === 'no support font' && forceFallback === false) {
console.error('[font] load font error: ', err);
WXGetFontRawData(conf, callbackId, true); WXGetFontRawData(conf, callbackId, true);
} }
else { else {
console.error('[font] load font error: ', err); GameGlobal.manager.Logger.pluginError('[font] load font error: ', err);
} }
}); });
} }

View File

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

View File

@ -1,5 +1,5 @@
fileFormatVersion: 2 fileFormatVersion: 2
guid: 5c4220407509f086556fd09d47523a80 guid: fbb6c4303ddbb250be3efa99af42183f
DefaultImporter: DefaultImporter:
externalObjects: {} externalObjects: {}
userData: userData:

View File

@ -1,5 +1,5 @@
fileFormatVersion: 2 fileFormatVersion: 2
guid: 93120f072ec0e97e9dbbaad83dd6264b guid: 22909590c123f56734bbd4c32d4035a1
DefaultImporter: DefaultImporter:
externalObjects: {} externalObjects: {}
userData: userData:

View File

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

View File

@ -1,5 +1,5 @@
fileFormatVersion: 2 fileFormatVersion: 2
guid: d43b2048c15507ff952311dd4975a6f7 guid: e9cfa9cb6d9c853ed585f971372bf4b6
DefaultImporter: DefaultImporter:
externalObjects: {} externalObjects: {}
userData: userData:

View File

@ -1,5 +1,5 @@
fileFormatVersion: 2 fileFormatVersion: 2
guid: 0629da08b9ed9bc78800b7707920904d guid: dbb0b1932d80f9ead1280ae79f5099e0
DefaultImporter: DefaultImporter:
externalObjects: {} externalObjects: {}
userData: userData:

View File

@ -1,5 +1,5 @@
fileFormatVersion: 2 fileFormatVersion: 2
guid: 3538b8cb04e79dcbd23932e665c49570 guid: 5dbdd939e674d05bb3b7e8969d2ac4d4
DefaultImporter: DefaultImporter:
externalObjects: {} externalObjects: {}
userData: userData:

View File

@ -1,5 +1,5 @@
fileFormatVersion: 2 fileFormatVersion: 2
guid: 510960ca7aeaf2d109e39d87f418bfd3 guid: 654611af3f1fb71e128e428c78b93d9f
DefaultImporter: DefaultImporter:
externalObjects: {} externalObjects: {}
userData: userData:

View File

@ -1,5 +1,5 @@
fileFormatVersion: 2 fileFormatVersion: 2
guid: 41651647986da622c2de3a6bf8abd589 guid: 58d20e869065599ccfbfa15b2feee70f
DefaultImporter: DefaultImporter:
externalObjects: {} externalObjects: {}
userData: userData:

View File

@ -1,5 +1,5 @@
fileFormatVersion: 2 fileFormatVersion: 2
guid: e386199736a704f9eb7dd8bf2d84cba7 guid: 2bf9d8d424d64713fd3ea86d652688a2
DefaultImporter: DefaultImporter:
externalObjects: {} externalObjects: {}
userData: userData:

View File

@ -1,5 +1,5 @@
fileFormatVersion: 2 fileFormatVersion: 2
guid: e4d1b5736fa31ad35b1cab6b4cb2bea9 guid: 371db24bccd1ddcb49131c3c85c5ca53
DefaultImporter: DefaultImporter:
externalObjects: {} externalObjects: {}
userData: userData:

View File

@ -1,5 +1,5 @@
fileFormatVersion: 2 fileFormatVersion: 2
guid: 852149f40d98494e395cb22681f1c701 guid: 09d18db4b1cd06cdcc9fcc3e887f3c52
DefaultImporter: DefaultImporter:
externalObjects: {} externalObjects: {}
userData: userData:

View File

@ -1,5 +1,5 @@
fileFormatVersion: 2 fileFormatVersion: 2
guid: a039e1b7d1c2b2a74bcd5924d927e798 guid: e39c99aa4165395ea627f553172d0a94
DefaultImporter: DefaultImporter:
externalObjects: {} externalObjects: {}
userData: userData:

View File

@ -1,5 +1,5 @@
fileFormatVersion: 2 fileFormatVersion: 2
guid: 635110f65389afaf552220dbe3b04127 guid: 77a75894fdb83d708e67ed6e66e788d2
DefaultImporter: DefaultImporter:
externalObjects: {} externalObjects: {}
userData: userData:

View File

@ -1,5 +1,5 @@
fileFormatVersion: 2 fileFormatVersion: 2
guid: d9d4fe654bf8d10368f7fb8698c5cf53 guid: 5e7f5a53df74b1b85139c2137ccbdf71
DefaultImporter: DefaultImporter:
externalObjects: {} externalObjects: {}
userData: userData:

View File

@ -1,5 +1,5 @@
fileFormatVersion: 2 fileFormatVersion: 2
guid: 6a02e1786ff7bd64dcc1666431083fb2 guid: 4ffbd4401b92b3e5fe16d24453dfa70f
DefaultImporter: DefaultImporter:
externalObjects: {} externalObjects: {}
userData: userData:

View File

@ -1,5 +1,5 @@
fileFormatVersion: 2 fileFormatVersion: 2
guid: 6b647c457a5d224d39f1791bfea7f147 guid: 829de4c0605641a277acf2122dedabfe
DefaultImporter: DefaultImporter:
externalObjects: {} externalObjects: {}
userData: userData:

View File

@ -1,5 +1,5 @@
fileFormatVersion: 2 fileFormatVersion: 2
guid: 232fef8a6fe6463c4a85091f365b1af0 guid: 2dce980b099f541df69160d8ed5cff48
DefaultImporter: DefaultImporter:
externalObjects: {} externalObjects: {}
userData: userData:

View File

@ -1,5 +1,5 @@
fileFormatVersion: 2 fileFormatVersion: 2
guid: e6ea56d507c644af15140723897ee925 guid: 06d57b0529df1ce51d424c61e7ccc60f
DefaultImporter: DefaultImporter:
externalObjects: {} externalObjects: {}
userData: userData:

View File

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

View File

@ -1,5 +1,5 @@
fileFormatVersion: 2 fileFormatVersion: 2
guid: d6cf469ed6e1258294cbd05f2467202f guid: b44b4270d9ad55a3995dfea7ec29390e
DefaultImporter: DefaultImporter:
externalObjects: {} externalObjects: {}
userData: userData:

View File

@ -1,5 +1,5 @@
fileFormatVersion: 2 fileFormatVersion: 2
guid: 4ceadc2e9a3bfa49441e1922525a918f guid: 6d5d101559226a440dc532cf586c8fe4
DefaultImporter: DefaultImporter:
externalObjects: {} externalObjects: {}
userData: userData:

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