Initial commit: Client Doc docs Server Tools

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
ud18010
2026-07-10 10:24:29 +08:00
co-authored by Cursor
commit 7e35d8da31
3374 changed files with 680813 additions and 0 deletions
@@ -0,0 +1,33 @@
#if UNITY_WEBGL|| WEIXINMINIGAME || UNITY_EDITOR
using System;
using UnityEngine;
using WeChatWASM;
internal class CheckFrame : MonoBehaviour
{
private int frameCnt = 0;
public void Update()
{
frameCnt++;
if (frameCnt == 2)
{
#if (UNITY_WEBGL|| WEIXINMINIGAME) && !UNITY_EDITOR
WXSDKManagerHandler.Instance.HideLoadingPage();
#endif
Destroy(this);
}
}
}
internal class HideLoadingPage : MonoBehaviour
{
[RuntimeInitializeOnLoadMethod(RuntimeInitializeLoadType.BeforeSceneLoad)]
private static void OnGameLaunch()
{
var gameObject = new GameObject("HideLoadingPage");
gameObject.AddComponent<CheckFrame>();
DontDestroyOnLoad(gameObject);
}
}
#endif
@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: c209e0053cc1f462680a6855c0b6ae45
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 7382fe491f92f1e46afc3ab38ee41f91
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,33 @@
fileFormatVersion: 2
guid: e3bcb9f6d2b014d38815ff3cdeb11f6f
PluginImporter:
externalObjects: {}
serializedVersion: 2
iconMap: {}
executionOrder: {}
defineConstraints: []
isPreloaded: 0
isOverridable: 0
isExplicitlyReferenced: 0
validateReferences: 1
platformData:
- first:
Any:
second:
enabled: 1
settings: {}
- first:
Editor: Editor
second:
enabled: 0
settings:
DefaultValueInitialized: true
- first:
Windows Store Apps: WindowsStoreApps
second:
enabled: 0
settings:
CPU: AnyCPU
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,967 @@
mergeInto(LibraryManager.library, {
WXPointer_stringify_adaptor:function(str){
if (typeof UTF8ToString !== "undefined") {
return UTF8ToString(str)
}
return Pointer_stringify(str)
},
glGenTextures: function (n, textures) {
for (var i = 0; i < n; i++) {
var texture = GLctx.createTexture();
if (!texture) {
GL.recordError(1282);
while (i < n) HEAP32[textures + i++ * 4 >> 2] = 0;
return
}
var id = GL.getNewId(GL.textures);
texture.name = id;
GL.textures[id] = texture;
window._lastTextureId = id;
HEAP32[textures + i * 4 >> 2] = id
}
},
glBindTexture:function(target, texture) {
window._lastBoundTexture = texture;
GLctx.bindTexture(target, texture ? GL.textures[texture] : null)
},
WXInitializeSDK: function (version) {
window.WXWASMSDK.WXInitializeSDK(_WXPointer_stringify_adaptor(version));
if (typeof emscriptenMemoryProfiler !== "undefined") {
GameGlobal.memprofiler = emscriptenMemoryProfiler
GameGlobal.memprofiler.onDump = function () {
var fs = wx.getFileSystemManager();
var allocation_used=GameGlobal.memprofiler.allocationsAtLoc;
if (typeof allocation_used === "undefined") allocation_used=GameGlobal.memprofiler.allocationSiteStatistics;
var calls = [];
for (var i in allocation_used) {
calls.push(i);
}
calls.sort((function (a, b) {
return allocation_used[b][1] - allocation_used[a][1];
}));
console.log('WXDumpUnityHeap begin', Object.keys(allocation_used).length, calls.length);
wx.getFileSystemManager().open({
filePath: wx.env.USER_DATA_PATH + '/alloc_used.csv',
flag: 'w',
success: function(res) {
var wxfile = res.fd;
fs.write({
fd: wxfile,
data:'callback;count;size;malloc;free\r\n',
fail: function(res) {
console.error(res);
}
})
var errorCount = 0;
for (var i = 0; i < 100000 && i < calls.length; ++i) {
var callstack = calls[i];
var item = allocation_used[callstack];
if (typeof item === "undefined") {
// console.error('callstack not fond', callstack);
++errorCount;
continue
}
var posOfThisFunc = callstack.indexOf('emscripten_trace_record_') + "emscripten_trace_record_".length;
if (posOfThisFunc != -1) callstack = callstack.substr(posOfThisFunc);
var posOfRaf = callstack.lastIndexOf("InitWebGLPlayeriPPc ");
if (posOfRaf != -1) callstack = callstack.substr(0, posOfRaf);
posOfRaf = callstack.lastIndexOf("InitPlayerLoopCallbacks");
if (posOfRaf != -1) callstack = callstack.substr(0, posOfRaf);
callstack = callstack.replace(/\(.*?\)/g, '')
callstack = callstack.replace(/[A-Z0-9]{40}/g, '')
callstack = callstack.replace(/\n/g, "<-")
callstack = callstack.replace(/_malloc <-.*?MemLabelId15AllocateOptions/g, '')
callstack = callstack.replace(/<- at dynCall.*?at invoke_/g, '')
fs.write({
fd: wxfile,
data: callstack + ';' + item[0] + ';' + item[1] + ';' + item[2] + ';' + item[3] + '\r\n',
fail: function(res) {
console.error(res)
}
})
}
console.log("WXDumpUnityHeap end", errorCount)
}
})
}
}
},
WXStorageSetIntSync: function (key, value) {
window.WXWASMSDK.WXStorageSetIntSync(_WXPointer_stringify_adaptor(key), value);
},
WXStorageGetIntSync: function (key, defaultValue) {
return window.WXWASMSDK.WXStorageGetIntSync(_WXPointer_stringify_adaptor(key), defaultValue);
},
WXStorageSetFloatSync: function (key, value) {
window.WXWASMSDK.WXStorageSetFloatSync(_WXPointer_stringify_adaptor(key), value);
},
WXStorageGetFloatSync: function (key, defaultValue) {
return window.WXWASMSDK.WXStorageGetFloatSync(_WXPointer_stringify_adaptor(key), defaultValue);
},
WXStorageSetStringSync: function (key, value) {
window.WXWASMSDK.WXStorageSetStringSync(_WXPointer_stringify_adaptor(key), _WXPointer_stringify_adaptor(value));
},
WXStorageGetStringSync: function (key, defaultValue) {
var returnStr = window.WXWASMSDK.WXStorageGetStringSync(_WXPointer_stringify_adaptor(key), _WXPointer_stringify_adaptor(defaultValue));
var bufferSize = lengthBytesUTF8(returnStr || '') + 1;
var buffer = _malloc(bufferSize);
stringToUTF8(returnStr, buffer, bufferSize);
return buffer;
},
WXStorageDeleteAllSync: function () {
window.WXWASMSDK.WXStorageDeleteAllSync();
},
WXStorageDeleteKeySync: function (key) {
window.WXWASMSDK.WXStorageDeleteKeySync(_WXPointer_stringify_adaptor(key));
},
WXStorageHasKeySync: function (key) {
return window.WXWASMSDK.WXStorageHasKeySync(_WXPointer_stringify_adaptor(key));
},
WXCheckSession: function (s, f, c) {
window.WXWASMSDK.WXCheckSession(_WXPointer_stringify_adaptor(s), _WXPointer_stringify_adaptor(f), _WXPointer_stringify_adaptor(c));
},
WXAuthorize: function (scope, s, f, c) {
window.WXWASMSDK.WXAuthorize(_WXPointer_stringify_adaptor(scope), _WXPointer_stringify_adaptor(s), _WXPointer_stringify_adaptor(f), _WXPointer_stringify_adaptor(c));
},
WXCreateUserInfoButton: function (x, y, width, height, lang, withCredentials) {
var returnStr = window.WXWASMSDK.WXCreateUserInfoButton(x, y, width, height, _WXPointer_stringify_adaptor(lang), withCredentials);
var bufferSize = lengthBytesUTF8(returnStr || '') + 1;
var buffer = _malloc(bufferSize);
stringToUTF8(returnStr, buffer, bufferSize);
return buffer;
},
WXUserInfoButtonShow: function (id) {
window.WXWASMSDK.WXUserInfoButtonShow(_WXPointer_stringify_adaptor(id));
},
WXUserInfoButtonDestroy: function (id) {
window.WXWASMSDK.WXUserInfoButtonDestroy(_WXPointer_stringify_adaptor(id));
},
WXUserInfoButtonHide: function (id) {
window.WXWASMSDK.WXUserInfoButtonHide(_WXPointer_stringify_adaptor(id));
},
WXUserInfoButtonOffTap: function (id) {
window.WXWASMSDK.WXUserInfoButtonOffTap(_WXPointer_stringify_adaptor(id));
},
WXUserInfoButtonOnTap: function (id) {
window.WXWASMSDK.WXUserInfoButtonOnTap(_WXPointer_stringify_adaptor(id));
},
WXOnShareAppMessage: function (conf, isPromise) {
return window.WXWASMSDK.WXOnShareAppMessage(_WXPointer_stringify_adaptor(conf), isPromise);
},
WXOnShareAppMessageResolve: function (conf) {
return window.WXWASMSDK.WXOnShareAppMessageResolve(_WXPointer_stringify_adaptor(conf));
},
WXOffShareAppMessage: function () {
return window.WXWASMSDK.WXOffShareAppMessage();
},
WXCreateBannerAd: function (conf) {
var returnStr = window.WXWASMSDK.WXCreateBannerAd(_WXPointer_stringify_adaptor(conf));
var bufferSize = lengthBytesUTF8(returnStr || '') + 1;
var buffer = _malloc(bufferSize);
stringToUTF8(returnStr, buffer, bufferSize);
return buffer;
},
WXCreateRewardedVideoAd: function (conf) {
var returnStr = window.WXWASMSDK.WXCreateRewardedVideoAd(_WXPointer_stringify_adaptor(conf));
var bufferSize = lengthBytesUTF8(returnStr || '') + 1;
var buffer = _malloc(bufferSize);
stringToUTF8(returnStr, buffer, bufferSize);
return buffer;
},
WXGetFontRawData: function (conf, callbackId) {
window.WXWASMSDK.WXGetFontRawData(_WXPointer_stringify_adaptor(conf), _WXPointer_stringify_adaptor(callbackId))
},
WXShareFontBuffer:function(offset,callbackId){
window.WXWASMSDK.WXShareFontBuffer(
HEAPU8,
offset,
_WXPointer_stringify_adaptor(callbackId)
)
},
WXRewardedVideoAdReportShareBehavior: function (id, conf) {
var returnStr = window.WXWASMSDK.WXReportShareBehavior(_WXPointer_stringify_adaptor(id), _WXPointer_stringify_adaptor(conf));
var bufferSize = lengthBytesUTF8(returnStr || '') + 1;
var buffer = _malloc(bufferSize);
stringToUTF8(returnStr, buffer, bufferSize);
return buffer;
},
WXCreateInterstitialAd: function (conf) {
var returnStr = window.WXWASMSDK.WXCreateInterstitialAd(_WXPointer_stringify_adaptor(conf));
var bufferSize = lengthBytesUTF8(returnStr || '') + 1;
var buffer = _malloc(bufferSize);
stringToUTF8(returnStr, buffer, bufferSize);
return buffer;
},
WXCreateCustomAd: function (conf) {
var returnStr = window.WXWASMSDK.WXCreateCustomAd(_WXPointer_stringify_adaptor(conf));
var bufferSize = lengthBytesUTF8(returnStr || '') + 1;
var buffer = _malloc(bufferSize);
stringToUTF8(returnStr, buffer, bufferSize);
return buffer;
},
WXADStyleChange: function (id, key, value) {
window.WXWASMSDK.WXADStyleChange(_WXPointer_stringify_adaptor(id), _WXPointer_stringify_adaptor(key), value);
},
WXShowAd: function (id, s, f) {
window.WXWASMSDK.WXShowAd(_WXPointer_stringify_adaptor(id), _WXPointer_stringify_adaptor(s), _WXPointer_stringify_adaptor(f));
},
WXShowAd2: function (id,branchId,branchDim, s, f) {
window.WXWASMSDK.WXShowAd2(_WXPointer_stringify_adaptor(id),_WXPointer_stringify_adaptor(branchId),_WXPointer_stringify_adaptor(branchDim), _WXPointer_stringify_adaptor(s), _WXPointer_stringify_adaptor(f));
},
WXHideAd: function (id, s, f) {
window.WXWASMSDK.WXHideAd(_WXPointer_stringify_adaptor(id), _WXPointer_stringify_adaptor(s), _WXPointer_stringify_adaptor(f));
},
WXADGetStyleValue: function (id, key) {
return window.WXWASMSDK.WXADGetStyleValue(_WXPointer_stringify_adaptor(id), _WXPointer_stringify_adaptor(key));
},
WXADDestroy: function (id) {
window.WXWASMSDK.WXADDestroy(_WXPointer_stringify_adaptor(id));
},
WXADLoad: function (id, succ, fail) {
window.WXWASMSDK.WXADLoad(_WXPointer_stringify_adaptor(id), _WXPointer_stringify_adaptor(succ), _WXPointer_stringify_adaptor(fail));
},
WXToTempFilePath: function (conf, s, f, c) {
window.WXWASMSDK.WXToTempFilePath(_WXPointer_stringify_adaptor(conf), _WXPointer_stringify_adaptor(s), _WXPointer_stringify_adaptor(f), _WXPointer_stringify_adaptor(c))
},
WXToTempFilePathSync: function (conf) {
var returnStr = window.WXWASMSDK.WXToTempFilePathSync(_WXPointer_stringify_adaptor(conf));
var bufferSize = lengthBytesUTF8(returnStr || '') + 1;
var buffer = _malloc(bufferSize);
stringToUTF8(returnStr, buffer, bufferSize);
return buffer;
},
WXGetUserDataPath: function () {
var returnStr = window.WXWASMSDK.WXGetUserDataPath();
var bufferSize = lengthBytesUTF8(returnStr || '') + 1;
var buffer = _malloc(bufferSize);
stringToUTF8(returnStr, buffer, bufferSize);
return buffer;
},
WXWriteFileSync: function (filePath, data, encoding) {
var returnStr = window.WXWASMSDK.WXWriteFileSync(_WXPointer_stringify_adaptor(filePath), _WXPointer_stringify_adaptor(data), _WXPointer_stringify_adaptor(encoding));
var bufferSize = lengthBytesUTF8(returnStr || '') + 1;
var buffer = _malloc(bufferSize);
stringToUTF8(returnStr, buffer, bufferSize);
return buffer;
},
WXCreateFixedBottomMiddleBannerAd: function (adUnitId, adIntervals, height) {
var returnStr = window.WXWASMSDK.WXCreateFixedBottomMiddleBannerAd(_WXPointer_stringify_adaptor(adUnitId), adIntervals, height);
var bufferSize = lengthBytesUTF8(returnStr || '') + 1;
var buffer = _malloc(bufferSize);
stringToUTF8(returnStr, buffer, bufferSize);
return buffer;
},
WXDataContextPostMessage: function (msg) {
window.WXWASMSDK.WXDataContextPostMessage(_WXPointer_stringify_adaptor(msg));
},
WXShowOpenData: function (id, x, y, width, height) {
window.WXWASMSDK.WXShowOpenData(id, x, y, width, height);
},
WXHideOpenData: function () {
window.WXWASMSDK.WXHideOpenData();
},
WXReportGameStart: function () {
window.WXWASMSDK.WXReportGameStart();
},
WXReportGameSceneError: function(sceneId, errorType, errStr, extJsonStr) {
window.WXWASMSDK.WXReportGameSceneError(sceneId, errorType, _WXPointer_stringify_adaptor(errStr), _WXPointer_stringify_adaptor(extJsonStr));
},
WXWriteLog: function (str) {
window.WXWASMSDK.WXWriteLog(_WXPointer_stringify_adaptor(str))
},
WXWriteWarn: function (str) {
window.WXWASMSDK.WXWriteWarn(_WXPointer_stringify_adaptor(str))
},
WXPreloadConcurrent: function (count) {
window.WXWASMSDK.WXPreloadConcurrent(count);
},
WXAccessFileSync: function (path) {
var returnStr = window.WXWASMSDK.WXAccessFileSync(_WXPointer_stringify_adaptor(path));
var bufferSize = lengthBytesUTF8(returnStr || '') + 1;
var buffer = _malloc(bufferSize);
stringToUTF8(returnStr, buffer, bufferSize);
return buffer;
},
WXAccessFile: function (path, s, f, c) {
return window.WXWASMSDK.WXAccessFile(_WXPointer_stringify_adaptor(path), _WXPointer_stringify_adaptor(s), _WXPointer_stringify_adaptor(f), _WXPointer_stringify_adaptor(c));
},
WXCopyFileSync: function (srcPath, destPath) {
var returnStr = window.WXWASMSDK.WXCopyFileSync(_WXPointer_stringify_adaptor(srcPath), _WXPointer_stringify_adaptor(destPath));
var bufferSize = lengthBytesUTF8(returnStr || '') + 1;
var buffer = _malloc(bufferSize);
stringToUTF8(returnStr, buffer, bufferSize);
return buffer;
},
WXCopyFile: function (srcPath, destPath, s, f, c) {
return window.WXWASMSDK.WXCopyFile(_WXPointer_stringify_adaptor(srcPath), _WXPointer_stringify_adaptor(destPath), _WXPointer_stringify_adaptor(s), _WXPointer_stringify_adaptor(f), _WXPointer_stringify_adaptor(c));
},
WXUnlinkSync: function (filePath) {
var returnStr = window.WXWASMSDK.WXUnlinkSync(_WXPointer_stringify_adaptor(filePath));
var bufferSize = lengthBytesUTF8(returnStr || '') + 1;
var buffer = _malloc(bufferSize);
stringToUTF8(returnStr, buffer, bufferSize);
return buffer;
},
WXUnlink: function (filePath, s, f, c) {
return window.WXWASMSDK.WXUnlink(_WXPointer_stringify_adaptor(filePath), _WXPointer_stringify_adaptor(s), _WXPointer_stringify_adaptor(f), _WXPointer_stringify_adaptor(c));
},
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;
var buffer = _malloc(bufferSize);
stringToUTF8(returnStr, buffer, bufferSize);
return buffer;
},
WXInnerAudioContextSetBool: function (id, k, v) {
window.WXWASMSDK.WXInnerAudioContextSetBool(_WXPointer_stringify_adaptor(id), _WXPointer_stringify_adaptor(k), v);
},
WXInnerAudioContextSetString: function (id, k, v) {
window.WXWASMSDK.WXInnerAudioContextSetString(_WXPointer_stringify_adaptor(id), _WXPointer_stringify_adaptor(k), _WXPointer_stringify_adaptor(v));
},
WXInnerAudioContextSetFloat: function (id, k, v) {
window.WXWASMSDK.WXInnerAudioContextSetFloat(_WXPointer_stringify_adaptor(id), _WXPointer_stringify_adaptor(k), v);
},
WXInnerAudioContextGetFloat: function (id, k) {
return window.WXWASMSDK.WXInnerAudioContextGetFloat(_WXPointer_stringify_adaptor(id), _WXPointer_stringify_adaptor(k));
},
WXInnerAudioContextGetBool: function (id, k) {
return window.WXWASMSDK.WXInnerAudioContextGetBool(_WXPointer_stringify_adaptor(id), _WXPointer_stringify_adaptor(k));
},
WXInnerAudioContextPlay: function (id) {
window.WXWASMSDK.WXInnerAudioContextPlay(_WXPointer_stringify_adaptor(id));
},
WXInnerAudioContextStop: function (id) {
window.WXWASMSDK.WXInnerAudioContextStop(_WXPointer_stringify_adaptor(id));
},
WXInnerAudioContextPause: function (id) {
window.WXWASMSDK.WXInnerAudioContextPause(_WXPointer_stringify_adaptor(id));
},
WXInnerAudioContextDestroy: function (id) {
window.WXWASMSDK.WXInnerAudioContextDestroy(_WXPointer_stringify_adaptor(id));
},
WXInnerAudioContextSeek: function (id, position) {
window.WXWASMSDK.WXInnerAudioContextSeek(_WXPointer_stringify_adaptor(id), position);
},
WXInnerAudioContextAddListener: function (id, key) {
window.WXWASMSDK.WXInnerAudioContextAddListener(_WXPointer_stringify_adaptor(id), _WXPointer_stringify_adaptor(key));
},
WXInnerAudioContextRemoveListener: function (id, key) {
window.WXWASMSDK.WXInnerAudioContextRemoveListener(_WXPointer_stringify_adaptor(id), _WXPointer_stringify_adaptor(key));
},
WXPreDownloadAudios: function (paths, id) {
window.WXWASMSDK.WXPreDownloadAudios(_WXPointer_stringify_adaptor(paths), id);
},
WXSetDataCDN: function(path) {
window.WXWASMSDK.WXSetDataCDN(_WXPointer_stringify_adaptor(path));
},
WXSetPreloadList: function(paths) {
window.WXWASMSDK.WXSetPreloadList(_WXPointer_stringify_adaptor(paths));
},
WXCreateGameClubButton: function (conf) {
var returnStr = window.WXWASMSDK.WXCreateGameClubButton(_WXPointer_stringify_adaptor(conf));
var bufferSize = lengthBytesUTF8(returnStr || '') + 1;
var buffer = _malloc(bufferSize);
stringToUTF8(returnStr, buffer, bufferSize);
return buffer;
},
WXGameClubButtonDestroy: function(id) {
window.WXWASMSDK.WXGameClubButtonDestroy(_WXPointer_stringify_adaptor(id));
},
WXGameClubButtonHide: function(id) {
window.WXWASMSDK.WXGameClubButtonHide(_WXPointer_stringify_adaptor(id));
},
WXGameClubButtonShow: function(id) {
window.WXWASMSDK.WXGameClubButtonShow(_WXPointer_stringify_adaptor(id));
},
WXGameClubButtonAddListener: function(id, key) {
window.WXWASMSDK.WXGameClubButtonAddListener(_WXPointer_stringify_adaptor(id), _WXPointer_stringify_adaptor(key));
},
WXGameClubButtonRemoveListener: function(id, key) {
window.WXWASMSDK.WXGameClubButtonRemoveListener(_WXPointer_stringify_adaptor(id), _WXPointer_stringify_adaptor(key));
},
WXGameClubButtonSetProperty: function(id, key, value) {
window.WXWASMSDK.WXGameClubButtonSetProperty(_WXPointer_stringify_adaptor(id), _WXPointer_stringify_adaptor(key), _WXPointer_stringify_adaptor(value));
},
WXGameClubStyleChangeInt: function(id, key, value) {
window.WXWASMSDK.WXGameClubStyleChangeInt(_WXPointer_stringify_adaptor(id), _WXPointer_stringify_adaptor(key), value);
},
WXGameClubStyleChangeStr: function(id, key, value) {
window.WXWASMSDK.WXGameClubStyleChangeStr(_WXPointer_stringify_adaptor(id), _WXPointer_stringify_adaptor(key), _WXPointer_stringify_adaptor(value));
},
WXCreateVideo: function(conf) {
var returnStr = window.WXWASMSDK.WXCreateVideo(_WXPointer_stringify_adaptor(conf));
var bufferSize = lengthBytesUTF8(returnStr || '') + 1;
var buffer = _malloc(bufferSize);
stringToUTF8(returnStr, buffer, bufferSize);
return buffer;
},
WXVideoPlay: function(id) {
window.WXWASMSDK.WXVideoPlay(_WXPointer_stringify_adaptor(id));
},
WXVideoAddListener: function(id,key) {
window.WXWASMSDK.WXVideoAddListener(_WXPointer_stringify_adaptor(id), _WXPointer_stringify_adaptor(key));
},
WXVideoDestroy: function(id) {
window.WXWASMSDK.WXVideoDestroy(_WXPointer_stringify_adaptor(id));
},
WXVideoExitFullScreen: function(id) {
window.WXWASMSDK.WXVideoExitFullScreen(_WXPointer_stringify_adaptor(id));
},
WXVideoPause: function(id){
window.WXWASMSDK.WXVideoPause(_WXPointer_stringify_adaptor(id));
},
WXVideoRequestFullScreen:function(id,direction){
window.WXWASMSDK.WXVideoRequestFullScreen(_WXPointer_stringify_adaptor(id),direction);
},
WXVideoSeek:function(id,time){
window.WXWASMSDK.WXVideoSeek(_WXPointer_stringify_adaptor(id),time);
},
WXVideoStop:function(id){
window.WXWASMSDK.WXVideoStop(_WXPointer_stringify_adaptor(id));
},
WXVideoRemoveListener:function(id,key){
window.WXWASMSDK.WXVideoRemoveListener(_WXPointer_stringify_adaptor(id), _WXPointer_stringify_adaptor(key));
},
WXHideLoadingPage: function() {
window.WXWASMSDK && window.WXWASMSDK.WXHideLoadingPage()
},
WXWriteFile:function(filePath, data, dataLength, encoding, s, f, c) {
window.WXWASMSDK.WXWriteFile(
_WXPointer_stringify_adaptor(filePath),
HEAPU8.slice(data, dataLength + data),
_WXPointer_stringify_adaptor(encoding),
_WXPointer_stringify_adaptor(s),
_WXPointer_stringify_adaptor(f),
_WXPointer_stringify_adaptor(c)
)
},
WXWriteStringFile:function (filePath,data,encoding, s, f, c) {
window.WXWASMSDK.WXWriteStringFile(
_WXPointer_stringify_adaptor(filePath),
_WXPointer_stringify_adaptor(data),
_WXPointer_stringify_adaptor(encoding),
_WXPointer_stringify_adaptor(s),
_WXPointer_stringify_adaptor(f),
_WXPointer_stringify_adaptor(c)
)
},
WXAppendFile:function(filePath, data, dataLength, encoding, s, f, c) {
window.WXWASMSDK.WXAppendFile(
_WXPointer_stringify_adaptor(filePath),
HEAPU8.slice(data, dataLength + data),
_WXPointer_stringify_adaptor(encoding),
_WXPointer_stringify_adaptor(s),
_WXPointer_stringify_adaptor(f),
_WXPointer_stringify_adaptor(c)
)
},
WXAppendStringFile:function (filePath, data, encoding, s, f, c) {
window.WXWASMSDK.WXAppendStringFile(
_WXPointer_stringify_adaptor(filePath),
_WXPointer_stringify_adaptor(data),
_WXPointer_stringify_adaptor(encoding),
_WXPointer_stringify_adaptor(s),
_WXPointer_stringify_adaptor(f),
_WXPointer_stringify_adaptor(c)
)
},
WXWriteBinFileSync:function(filePath, data, dataLength, encoding) {
var returnStr = window.WXWASMSDK.WXWriteBinFileSync(
_WXPointer_stringify_adaptor(filePath),
HEAPU8.slice(data, dataLength + data),
_WXPointer_stringify_adaptor(encoding)
);
var bufferSize = lengthBytesUTF8(returnStr || '') + 1;
var buffer = _malloc(bufferSize);
stringToUTF8(returnStr, buffer, bufferSize);
return buffer;
},
WXReadFile:function(option, callbackId) {
window.WXWASMSDK.WXReadFile(_WXPointer_stringify_adaptor(option), _WXPointer_stringify_adaptor(callbackId));
},
WXReadFileSync:function(option) {
var returnStr = window.WXWASMSDK.WXReadFileSync(_WXPointer_stringify_adaptor(option));
var bufferSize = lengthBytesUTF8(returnStr || '') + 1;
var buffer = _malloc(bufferSize);
stringToUTF8(returnStr, buffer, bufferSize);
return buffer;
},
WXGetTotalMemorySize: function() {
if (typeof TOTAL_MEMORY !== "undefined") {
return TOTAL_MEMORY
}
return buffer.byteLength;
},
WXGetTotalStackSize: function() {
return TOTAL_STACK;
},
WXGetStaticMemorySize: function() {
return STATICTOP - STATIC_BASE;
},
WXGetDynamicMemorySize: function() {
if (typeof DYNAMIC_BASE !== "undefined") {
return HEAP32[DYNAMICTOP_PTR >> 2] - DYNAMIC_BASE
}
var heap_base = 7936880;
if (typeof Module["___heap_base"] !== "undefined") {
heap_base = Module["___heap_base"];
}
var heap_end = _sbrk();
return heap_end - heap_base;
},
WXGetUsedMemorySize: function() {
if (typeof emscriptenMemoryProfiler !== "undefined") {
return emscriptenMemoryProfiler.totalMemoryAllocated;
}
},
WXGetUnAllocatedMemorySize: function() {
var heap_end = _sbrk()
return HEAP8.length - heap_end
return 0
},
WXGetEXFrameTime : function() {
if(typeof GameGlobal.calcFrameTimeFunc == "undefined")
{
GameGlobal.calcFrameTimeFunc = function ()
{
var frameCount = 0;
var exTotalTime = 0;
return function update(frameStart, frameEnd) {
frameCount++;
exTotalTime += (frameEnd - frameStart);
if (frameCount >= 60) {
GameGlobal.avgExFrameTime = exTotalTime / 60;
frameCount = 0;
exTotalTime = 0;
}
};
}();
}
return GameGlobal.avgExFrameTime
},
WXProfilingMemoryDump: function() {
if (typeof emscriptenMemoryProfiler !== "undefined") {
GameGlobal.memprofiler.onDump();
wx.showModal({
title: 'ProfilingMemory',
content: 'OnDump Complete!'
});
return;
}
console.error('Please call WX.InitSDK & Select ProfilingMemory Option')
},
WXLogManagerDebug:function(str){
window.WXWASMSDK.WXLogManagerDebug(
_WXPointer_stringify_adaptor(str)
);
},
WXLogManagerInfo:function(str){
window.WXWASMSDK.WXLogManagerInfo(
_WXPointer_stringify_adaptor(str)
);
},
WXLogManagerLog:function(str){
window.WXWASMSDK.WXLogManagerLog(
_WXPointer_stringify_adaptor(str)
);
},
WXLogManagerWarn:function(str){
window.WXWASMSDK.WXLogManagerWarn(
_WXPointer_stringify_adaptor(str)
);
},
WXIsCloudTest:function(){
return window.WXWASMSDK.WXIsCloudTest();
},
WXCleanAllFileCache:function() {
var returnStr = window.WXWASMSDK.WXCleanAllFileCache();
var bufferSize = lengthBytesUTF8(returnStr || '') + 1;
var buffer = _malloc(bufferSize);
stringToUTF8(returnStr, buffer, bufferSize);
return buffer;
},
WXCleanFileCache: function(fileSize) {
var returnStr = window.WXWASMSDK.WXCleanFileCache(fileSize);
var bufferSize = lengthBytesUTF8(returnStr || '') + 1;
var buffer = _malloc(bufferSize);
stringToUTF8(returnStr, buffer, bufferSize);
return buffer;
},
WXRemoveFile: function(path) {
var returnStr = window.WXWASMSDK.WXRemoveFile(_WXPointer_stringify_adaptor(path));
var bufferSize = lengthBytesUTF8(returnStr || '') + 1;
var buffer = _malloc(bufferSize);
stringToUTF8(returnStr, buffer, bufferSize);
return buffer;
},
WXGetCachePath: function(url) {
var returnStr = window.WXWASMSDK.WXGetCachePath(_WXPointer_stringify_adaptor(url));
var bufferSize = lengthBytesUTF8(returnStr || '') + 1;
var buffer = _malloc(bufferSize);
stringToUTF8(returnStr, buffer, bufferSize);
return buffer;
},
WXGetPluginCachePath: function() {
var returnStr = window.WXWASMSDK.WXGetPluginCachePath();
var bufferSize = lengthBytesUTF8(returnStr || '') + 1;
var buffer = _malloc(bufferSize);
stringToUTF8(returnStr, buffer, bufferSize);
return buffer;
},
WXOnLaunchProgress: function() {
var returnStr = window.WXWASMSDK.WXOnLaunchProgress();
var bufferSize = lengthBytesUTF8(returnStr || '') + 1;
var buffer = _malloc(bufferSize);
stringToUTF8(returnStr, buffer, bufferSize);
return buffer;
},
WXUncaughtException: function() {
window.WXWASMSDK.WXUncaughtException(false);
},
WXMkdir:function(dirPath, recursive, s, f, c){
window.WXWASMSDK.WXMkdir(_WXPointer_stringify_adaptor(dirPath), recursive, _WXPointer_stringify_adaptor(s), _WXPointer_stringify_adaptor(f), _WXPointer_stringify_adaptor(c));
},
WXMkdirSync: function (dirPath, recursive) {
var returnStr = window.WXWASMSDK.WXMkdirSync(_WXPointer_stringify_adaptor(dirPath),recursive);
var bufferSize = lengthBytesUTF8(returnStr || '') + 1;
var buffer = _malloc(bufferSize);
stringToUTF8(returnStr, buffer, bufferSize);
return buffer;
},
WXRmdir: function(dirPath, recursive, s, f, c) {
window.WXWASMSDK.WXRmdir(_WXPointer_stringify_adaptor(dirPath), recursive, _WXPointer_stringify_adaptor(s), _WXPointer_stringify_adaptor(f), _WXPointer_stringify_adaptor(c));
},
WXRmdirSync: function(dirPath, recursive) {
var returnStr = window.WXWASMSDK.WXRmdirSync(_WXPointer_stringify_adaptor(dirPath),recursive);
var bufferSize = lengthBytesUTF8(returnStr || '') + 1;
var buffer = _malloc(bufferSize);
stringToUTF8(returnStr, buffer, bufferSize);
return buffer;
},
WXCameraCreateCamera: function (option, callbackId) {
window.WXWASMSDK.WXCameraCreateCamera(_WXPointer_stringify_adaptor(option), _WXPointer_stringify_adaptor(callbackId));
},
WXCameraCloseFrameChange: function (id) {
window.WXWASMSDK.WXCameraCloseFrameChange(_WXPointer_stringify_adaptor(id));
},
WXCameraDestroy: function (id) {
window.WXWASMSDK.WXCameraDestroy(_WXPointer_stringify_adaptor(id));
},
WXCameraListenFrameChange: function (id) {
window.WXWASMSDK.WXCameraListenFrameChange(_WXPointer_stringify_adaptor(id));
},
WXCameraOnAuthCancel: function (id) {
window.WXWASMSDK.WXCameraOnAuthCancel(_WXPointer_stringify_adaptor(id));
},
WXCameraOnCameraFrame: function (id) {
window.WXWASMSDK.WXCameraOnCameraFrame(_WXPointer_stringify_adaptor(id));
},
WXCameraOnStop:function (id) {
window.WXWASMSDK.WXCameraOnStop(_WXPointer_stringify_adaptor(id));
},
WX_GetRecorderManager:function(
){
var res = window.WXWASMSDK.WX_GetRecorderManager();
var bufferSize = lengthBytesUTF8(res || '') + 1;
var buffer = _malloc(bufferSize);
stringToUTF8(res, buffer, bufferSize);
return buffer;
},
WX_OnRecorderError:function(id){
window.WXWASMSDK.WX_OnRecorderError(_WXPointer_stringify_adaptor(id));
},
WX_OnRecorderFrameRecorded:function(id){
window.WXWASMSDK.WX_OnRecorderFrameRecorded(_WXPointer_stringify_adaptor(id));
},
WX_OnRecorderInterruptionBegin:function(id){
window.WXWASMSDK.WX_OnRecorderInterruptionBegin(_WXPointer_stringify_adaptor(id));
},
WX_OnRecorderInterruptionEnd:function(id){
window.WXWASMSDK.WX_OnRecorderInterruptionEnd(_WXPointer_stringify_adaptor(id));
},
WX_OnRecorderPause:function(id){
window.WXWASMSDK.WX_OnRecorderPause(_WXPointer_stringify_adaptor(id));
},
WX_OnRecorderResume:function(id){
window.WXWASMSDK.WX_OnRecorderResume(_WXPointer_stringify_adaptor(id));
},
WX_OnRecorderStart:function(id){
window.WXWASMSDK.WX_OnRecorderStart(_WXPointer_stringify_adaptor(id));
},
WX_OnRecorderStop:function(id){
window.WXWASMSDK.WX_OnRecorderStop(_WXPointer_stringify_adaptor(id));
},
WX_RecorderPause:function(id){
window.WXWASMSDK.WX_RecorderPause(_WXPointer_stringify_adaptor(id));
},
WX_RecorderResume:function(id){
window.WXWASMSDK.WX_RecorderResume(_WXPointer_stringify_adaptor(id));
},
WX_RecorderStart:function(id,option){
window.WXWASMSDK.WX_RecorderStart(_WXPointer_stringify_adaptor(id),_WXPointer_stringify_adaptor(option));
},
WX_RecorderStop:function(id){
window.WXWASMSDK.WX_RecorderStop(_WXPointer_stringify_adaptor(id));
},
WX_UploadFile:function(conf, callbackId){
window.WXWASMSDK.WX_UploadFile(_WXPointer_stringify_adaptor(conf), _WXPointer_stringify_adaptor(callbackId));
},
WXUploadTaskAbort:function(id){
window.WXWASMSDK.WXUploadTaskAbort(_WXPointer_stringify_adaptor(id));
},
WXUploadTaskOffHeadersReceived:function(id){
window.WXWASMSDK.WXUploadTaskOffHeadersReceived(_WXPointer_stringify_adaptor(id));
},
WXUploadTaskOffProgressUpdate:function(id){
window.WXWASMSDK.WXUploadTaskOffProgressUpdate(_WXPointer_stringify_adaptor(id));
},
WXUploadTaskOnHeadersReceived:function(id){
window.WXWASMSDK.WXUploadTaskOnHeadersReceived(_WXPointer_stringify_adaptor(id));
},
WXUploadTaskOnProgressUpdate:function(id){
window.WXWASMSDK.WXUploadTaskOnProgressUpdate(_WXPointer_stringify_adaptor(id));
},
WXStat: function (conf, callbackId) {
window.WXWASMSDK.WXStat(_WXPointer_stringify_adaptor(conf), _WXPointer_stringify_adaptor(callbackId))
},
WX_GetGameRecorder:function() {
var res = window.WXWASMSDK.WX_GetGameRecorder();
var bufferSize = lengthBytesUTF8(res || '') + 1;
var buffer = _malloc(bufferSize);
stringToUTF8(res, buffer, bufferSize);
return buffer;
},
WX_GameRecorderOff:function(id, eventType){
window.WXWASMSDK.WX_GameRecorderOff(_WXPointer_stringify_adaptor(id), _WXPointer_stringify_adaptor(eventType));
},
WX_GameRecorderOn:function(id, eventType){
window.WXWASMSDK.WX_GameRecorderOn(_WXPointer_stringify_adaptor(id), _WXPointer_stringify_adaptor(eventType));
},
WX_GameRecorderStart:function(id,option){
window.WXWASMSDK.WX_GameRecorderStart(_WXPointer_stringify_adaptor(id),_WXPointer_stringify_adaptor(option));
},
WX_GameRecorderAbort:function(id){
window.WXWASMSDK.WX_GameRecorderAbort(_WXPointer_stringify_adaptor(id));
},
WX_GameRecorderPause:function(id){
window.WXWASMSDK.WX_GameRecorderPause(_WXPointer_stringify_adaptor(id));
},
WX_GameRecorderResume:function(id){
window.WXWASMSDK.WX_GameRecorderResume(_WXPointer_stringify_adaptor(id));
},
WX_GameRecorderStop:function(id){
window.WXWASMSDK.WX_GameRecorderStop(_WXPointer_stringify_adaptor(id));
},
WX_OperateGameRecorderVideo:function(option){
window.WXWASMSDK.WX_OperateGameRecorderVideo(_WXPointer_stringify_adaptor(option));
},
WXChatCreate: function (option) {
return window.WXWASMSDK.WXChatCreate(_WXPointer_stringify_adaptor(option));
},
WXChatHide: function () {
window.WXWASMSDK.WXChatHide();
},
WXChatShow: function (option) {
window.WXWASMSDK.WXChatShow(_WXPointer_stringify_adaptor(option));
},
WXChatClose: function () {
window.WXWASMSDK.WXChatClose();
},
WXChatOpen: function (pageKey) {
window.WXWASMSDK.WXChatOpen(_WXPointer_stringify_adaptor(pageKey));
},
WXChatSetTabs: function (pageKeys) {
window.WXWASMSDK.WXChatSetTabs(_WXPointer_stringify_adaptor(pageKeys));
},
WXChatOn: function (eventType) {
window.WXWASMSDK.WXChatOn(_WXPointer_stringify_adaptor(eventType));
},
WXChatOff: function (eventType) {
window.WXWASMSDK.WXChatOff(_WXPointer_stringify_adaptor(eventType));
},
WXChatSetSignature: function (signature) {
window.WXWASMSDK.WXChatSetSignature(_WXPointer_stringify_adaptor(signature));
},
WXSetArrayBuffer: function (offset,callbackId){
window.WXWASMSDK.WXSetArrayBuffer(
HEAPU8,
offset,
_WXPointer_stringify_adaptor(callbackId)
)
},
WX_FileSystemManagerAppendFileSync:function(filePath, data, dataLength, encoding) {
window.WXWASMSDK.WX_FileSystemManagerAppendFileSync(
_WXPointer_stringify_adaptor(filePath),
HEAPU8.slice(data, dataLength + data),
_WXPointer_stringify_adaptor(encoding)
);
},
WX_FileSystemManagerAppendFileStringSync:function(filePath, data, encoding) {
window.WXWASMSDK.WX_FileSystemManagerAppendFileStringSync(_WXPointer_stringify_adaptor(filePath), _WXPointer_stringify_adaptor(data), _WXPointer_stringify_adaptor(encoding));
},
WX_FileSystemManagerReaddirSync:function(dirPath) {
var res = window.WXWASMSDK.WX_FileSystemManagerReaddirSync(_WXPointer_stringify_adaptor(dirPath));
var bufferSize = lengthBytesUTF8(res) + 1;
var buffer = _malloc(bufferSize);
stringToUTF8(res, buffer, bufferSize);
return buffer;
},
WX_FileSystemManagerReadCompressedFileSync:function(option, callbackId) {
var res = window.WXWASMSDK.WX_FileSystemManagerReadCompressedFileSync(_WXPointer_stringify_adaptor(option), _WXPointer_stringify_adaptor(callbackId));
var bufferSize = lengthBytesUTF8(res) + 1;
var buffer = _malloc(bufferSize);
stringToUTF8(res, buffer, bufferSize);
return buffer;
},
WX_FileSystemManagerClose:function(option, callbackId) {
window.WXWASMSDK.WX_FileSystemManagerClose(_WXPointer_stringify_adaptor(option), _WXPointer_stringify_adaptor(callbackId));
},
WX_FileSystemManagerFstat:function(option, callbackId) {
window.WXWASMSDK.WX_FileSystemManagerFstat(_WXPointer_stringify_adaptor(option), _WXPointer_stringify_adaptor(callbackId));
},
WX_FileSystemManagerFtruncate:function(option, callbackId) {
window.WXWASMSDK.WX_FileSystemManagerFtruncate(_WXPointer_stringify_adaptor(option), _WXPointer_stringify_adaptor(callbackId));
},
WX_FileSystemManagerGetFileInfo:function(option, callbackId) {
window.WXWASMSDK.WX_FileSystemManagerGetFileInfo(_WXPointer_stringify_adaptor(option), _WXPointer_stringify_adaptor(callbackId));
},
WX_FileSystemManagerGetSavedFileList:function(option, callbackId) {
window.WXWASMSDK.WX_FileSystemManagerGetSavedFileList(_WXPointer_stringify_adaptor(option), _WXPointer_stringify_adaptor(callbackId));
},
WX_FileSystemManagerOpen:function(option, callbackId) {
window.WXWASMSDK.WX_FileSystemManagerOpen(_WXPointer_stringify_adaptor(option), _WXPointer_stringify_adaptor(callbackId));
},
WX_FileSystemManagerRead:function(option, data, dataLength, callbackId) {
window.WXWASMSDK.WX_FileSystemManagerRead(_WXPointer_stringify_adaptor(option), HEAPU8.slice(data, dataLength + data), _WXPointer_stringify_adaptor(callbackId));
},
WX_FileSystemManagerReadCompressedFile:function(option, callbackId) {
window.WXWASMSDK.WX_FileSystemManagerReadCompressedFile(_WXPointer_stringify_adaptor(option), _WXPointer_stringify_adaptor(callbackId));
},
WX_FileSystemManagerReadZipEntry:function(option, callbackId) {
window.WXWASMSDK.WX_FileSystemManagerReadZipEntry(_WXPointer_stringify_adaptor(option), _WXPointer_stringify_adaptor(callbackId));
},
WX_FileSystemManagerReadZipEntryString:function(option, callbackId) {
window.WXWASMSDK.WX_FileSystemManagerReadZipEntryString(_WXPointer_stringify_adaptor(option), _WXPointer_stringify_adaptor(callbackId));
},
WX_FileSystemManagerReaddir:function(option, callbackId) {
window.WXWASMSDK.WX_FileSystemManagerReaddir(_WXPointer_stringify_adaptor(option), _WXPointer_stringify_adaptor(callbackId));
},
WX_FileSystemManagerRemoveSavedFile:function(option, callbackId) {
window.WXWASMSDK.WX_FileSystemManagerRemoveSavedFile(_WXPointer_stringify_adaptor(option), _WXPointer_stringify_adaptor(callbackId));
},
WX_FileSystemManagerRename:function(option, callbackId) {
window.WXWASMSDK.WX_FileSystemManagerRename(_WXPointer_stringify_adaptor(option), _WXPointer_stringify_adaptor(callbackId));
},
WX_FileSystemManagerSaveFile:function(option, callbackId) {
window.WXWASMSDK.WX_FileSystemManagerSaveFile(_WXPointer_stringify_adaptor(option), _WXPointer_stringify_adaptor(callbackId));
},
WX_FileSystemManagerTruncate:function(option, callbackId) {
window.WXWASMSDK.WX_FileSystemManagerTruncate(_WXPointer_stringify_adaptor(option), _WXPointer_stringify_adaptor(callbackId));
},
WX_FileSystemManagerUnzip:function(option, callbackId) {
window.WXWASMSDK.WX_FileSystemManagerUnzip(_WXPointer_stringify_adaptor(option), _WXPointer_stringify_adaptor(callbackId));
},
WX_FileSystemManagerWrite:function(option, data, dataLength, callbackId) {
window.WXWASMSDK.WX_FileSystemManagerWrite(_WXPointer_stringify_adaptor(option), HEAPU8.slice(data, dataLength + data), _WXPointer_stringify_adaptor(callbackId));
},
WX_FileSystemManagerWriteString:function(option, callbackId) {
window.WXWASMSDK.WX_FileSystemManagerWriteString(_WXPointer_stringify_adaptor(option), _WXPointer_stringify_adaptor(callbackId));
},
WX_FileSystemManagerRenameSync:function(oldPath, newPath) {
window.WXWASMSDK.WX_FileSystemManagerRenameSync(_WXPointer_stringify_adaptor(oldPath), _WXPointer_stringify_adaptor(newPath));
},
WX_FileSystemManagerReadSync:function(option, callbackId) {
var res = window.WXWASMSDK.WX_FileSystemManagerReadSync(_WXPointer_stringify_adaptor(option), _WXPointer_stringify_adaptor(callbackId));
var bufferSize = lengthBytesUTF8(res) + 1;
var buffer = _malloc(bufferSize);
stringToUTF8(res, buffer, bufferSize);
return buffer;
},
WX_FileSystemManagerFstatSync:function(option) {
var res = window.WXWASMSDK.WX_FileSystemManagerFstatSync(_WXPointer_stringify_adaptor(option));
var bufferSize = lengthBytesUTF8(res) + 1;
var buffer = _malloc(bufferSize);
stringToUTF8(res, buffer, bufferSize);
return buffer;
},
WX_FileSystemManagerStatSync:function(path, recursive) {
var res = window.WXWASMSDK.WX_FileSystemManagerStatSync(_WXPointer_stringify_adaptor(path), recursive);
var bufferSize = lengthBytesUTF8(res) + 1;
var buffer = _malloc(bufferSize);
stringToUTF8(res, buffer, bufferSize);
return buffer;
},
WX_FileSystemManagerWriteSync:function(option, data, dataLength) {
var res = window.WXWASMSDK.WX_FileSystemManagerWriteSync(_WXPointer_stringify_adaptor(option), HEAPU8.slice(data, dataLength + data));
var bufferSize = lengthBytesUTF8(res) + 1;
var buffer = _malloc(bufferSize);
stringToUTF8(res, buffer, bufferSize);
return buffer;
},
WX_FileSystemManagerWriteStringSync:function(option) {
var res = window.WXWASMSDK.WX_FileSystemManagerWriteStringSync(_WXPointer_stringify_adaptor(option));
var bufferSize = lengthBytesUTF8(res) + 1;
var buffer = _malloc(bufferSize);
stringToUTF8(res, buffer, bufferSize);
return buffer;
},
WX_FileSystemManagerOpenSync:function(option) {
var res = window.WXWASMSDK.WX_FileSystemManagerOpenSync(_WXPointer_stringify_adaptor(option));
var bufferSize = lengthBytesUTF8(res) + 1;
var buffer = _malloc(bufferSize);
stringToUTF8(res, buffer, bufferSize);
return buffer;
},
WX_FileSystemManagerSaveFileSync:function(tempFilePath, filePath) {
var res = window.WXWASMSDK.WX_FileSystemManagerSaveFileSync(_WXPointer_stringify_adaptor(tempFilePath), _WXPointer_stringify_adaptor(filePath));
var bufferSize = lengthBytesUTF8(res) + 1;
var buffer = _malloc(bufferSize);
stringToUTF8(res, buffer, bufferSize);
return buffer;
},
WX_FileSystemManagerCloseSync:function(option) {
window.WXWASMSDK.WX_FileSystemManagerCloseSync(_WXPointer_stringify_adaptor(option));
},
WX_FileSystemManagerFtruncateSync:function(option) {
window.WXWASMSDK.WX_FileSystemManagerFtruncateSync(_WXPointer_stringify_adaptor(option));
},
WX_FileSystemManagerTruncateSync:function(option) {
window.WXWASMSDK.WX_FileSystemManagerTruncateSync(_WXPointer_stringify_adaptor(option));
},
WXVideoSetProperty: function(id, key, value) {
window.WXWASMSDK.WXVideoSetProperty(_WXPointer_stringify_adaptor(id), _WXPointer_stringify_adaptor(key), _WXPointer_stringify_adaptor(value));
},
WX_OnNeedPrivacyAuthorization:function() {
window.WXWASMSDK.WX_OnNeedPrivacyAuthorization();
},
WX_PrivacyAuthorizeResolve: function(option) {
window.WXWASMSDK.WX_PrivacyAuthorizeResolve(_WXPointer_stringify_adaptor(option));
}
});
@@ -0,0 +1,74 @@
fileFormatVersion: 2
guid: 63afc2a12fd6d404092ed133a0c10433
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:
Standalone: Linux64
second:
enabled: 0
settings:
CPU: x86_64
- 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:
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,74 @@
fileFormatVersion: 2
guid: 340c9937849614db7bd7a069ff60c77b
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:
Standalone: Linux64
second:
enabled: 0
settings:
CPU: x86_64
- 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:
@@ -0,0 +1,324 @@
mergeInto(LibraryManager.library, {
glCompressedTexImage2D: function(target, level, internalFormat, width, height, border, imageSize, data) {
var lastTid = window._lastTextureId;
var isMiniProgram = typeof wx !== 'undefined';
function getMatchId() {
var webgl1c = internalFormat == 36196;
if (isMiniProgram && GameGlobal.USED_TEXTURE_COMPRESSION && webgl1c) {
var length = HEAPU8.subarray(data, data + 1)[0];
var d = HEAPU8.subarray(data + 1, data + 1 + length);
var res = [];
d.forEach(function(v) {
res.push(String.fromCharCode(v));
});
var matchId = res.join('');
var start0 = res.length - 8;
var start1 = res.length - 5;
if (res[start0] == '_') {
start0++;
var header = ['a', 's', 't', 'c'];
for (var i = 0; i < header.length; i++) {
if (res[start0 + i] != header[i]) {
return [matchId, '8x8', false];
}
}
start0--;
var astcBlockSize = matchId.substring(start0 + 5);
return [matchId.substr(0, start0), astcBlockSize, false];
} else if (res[start1] == '_') {
start1++;
var size = res[start1++];
if (size != '4' && size != '5' && size != '6' && size != '8') {
return [matchId, '8x8', false];
}
var astcBlockSize = size + 'x' + size;
var limit = res[start1];
var limitType = false;
if (limit != '#') {
limitType = true;
}
start1 -= 2;
return [matchId.substr(0, start1), astcBlockSize, limitType];
} else {
return [matchId, '8x8', false];
}
}
return [-1, '8x8', false];
}
var matchIdInfo = getMatchId();
var matchId = matchIdInfo[0];
var astcBlockSize = matchIdInfo[1];
var limitType = matchIdInfo[2];
function compressedImage2D(rawData) {
var format = 0;
var dataOffset = 16;
var compressFormat = limitType ? GameGlobal.NoneLimitSupportedTexture : GameGlobal.TextureCompressedFormat;
switch (compressFormat) {
case "astc":
var astcList = GLctx.getExtension("WEBGL_compressed_texture_astc");
if (astcBlockSize == '4x4') {
format = astcList.COMPRESSED_RGBA_ASTC_4x4_KHR;
break;
}
if (astcBlockSize == '5x5') {
format = astcList.COMPRESSED_RGBA_ASTC_5x5_KHR;
break;
}
if (astcBlockSize == '6x6') {
format = 0x93B4;
break;
}
format = astcList.COMPRESSED_RGBA_ASTC_8x8_KHR;
break;
case "etc2":
format = GLctx.getExtension("WEBGL_compressed_texture_etc").COMPRESSED_RGBA8_ETC2_EAC;
break;
case "dds":
format = GLctx.getExtension("WEBGL_compressed_texture_s3tc").COMPRESSED_RGBA_S3TC_DXT5_EXT;
dataOffset = 128;
break;
case "pvr":
format = GLctx.getExtension("WEBGL_compressed_texture_pvrtc").COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;
var PVR_HEADER_METADATA = 12;
var PVR_HEADER_LENGTH = 13; // The header length in 32 bit ints.
var header = new Int32Array(rawData, 0, PVR_HEADER_LENGTH);
dataOffset = header[PVR_HEADER_METADATA] + 52;
break;
case "etc1":
format = GLctx.getExtension("WEBGL_compressed_texture_etc1").COMPRESSED_RGB_ETC1_WEBGL;
break
}
GLctx["compressedTexImage2D"](target, level, format, width, height, border, new Uint8Array(rawData, dataOffset))
}
function texImage2D(image) {
GLctx.texImage2D(GLctx.TEXTURE_2D, 0, GLctx.RGBA, GLctx.RGBA, GLctx.UNSIGNED_BYTE, image)
}
function renderTexture(id) {
if (!GL.textures[lastTid]) {
return;
}
var PotList = [1, 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024, 2048, 4096];
var _data = GameGlobal.DownloadedTextures[id].data;
var tid = lastTid;
if (!GL.textures[tid]) {
return;
}
GLctx.bindTexture(GLctx.TEXTURE_2D, GL.textures[tid]);
if (limitType && !GameGlobal.NoneLimitSupportedTexture) {
texImage2D(_data);
} else if (!GameGlobal.TextureCompressedFormat) {
texImage2D(_data);
} else if (GameGlobal.TextureCompressedFormat == "pvr" && (width !== height || PotList.indexOf(height) == -1)) {
texImage2D(_data);
} else if (GameGlobal.TextureCompressedFormat == 'dds' && (height % 4 !== 0 || width % 4 !== 0)) {
texImage2D(_data);
} else {
compressedImage2D(_data);
}
GLctx.bindTexture(GLctx.TEXTURE_2D, window._lastBoundTexture ? GL.textures[window._lastBoundTexture] : null);
}
function renderTransparent() {
GLctx.texImage2D(GLctx.TEXTURE_2D, 0, GLctx.RGBA, 1, 1, 0, GLctx.RGBA, GLctx.UNSIGNED_SHORT_4_4_4_4, new Uint16Array([0, 0]))
}
if (matchId != -1) {
if (GameGlobal.DownloadedTextures[matchId] && GameGlobal.DownloadedTextures[matchId].data) {
renderTexture(matchId)
} else {
renderTransparent();
window.WXWASMSDK.WXDownloadTexture(matchId, width, height, (function() {
renderTexture(matchId)
}), limitType)
}
return
}
if (GL.currentContext.supportsWebGL2EntryPoints) {
GLctx["compressedTexImage2D"](target, level, internalFormat, width, height, border, HEAPU8, data, imageSize);
return
}
GLctx["compressedTexImage2D"](target, level, internalFormat, width, height, border, data ? HEAPU8.subarray(data, data + imageSize) : null)
},
glCompressedTexSubImage2D: function(target, level, xoffset, yoffset, width, height, format, imageSize, data) {
var lastTid = window._lastTextureId;
var isMiniProgram = typeof wx !== 'undefined';
function getMatchId() {
var webgl1c = format == 36196;
if (isMiniProgram && GameGlobal.USED_TEXTURE_COMPRESSION && webgl1c) {
var length = HEAPU8.subarray(data, data + 1)[0];
var d = HEAPU8.subarray(data + 1, data + 1 + length);
var res = [];
d.forEach(function(v) {
res.push(String.fromCharCode(v));
});
var matchId = res.join('');
var start0 = res.length - 8;
var start1 = res.length - 5;
if (res[start0] == '_') {
start0++;
var header = ['a', 's', 't', 'c'];
for (var i = 0; i < header.length; i++) {
if (res[start0 + i] != header[i]) {
return [matchId, '8x8', false];
}
}
start0--;
var astcBlockSize = matchId.substring(start0 + 5);
return [matchId.substr(0, start0), astcBlockSize, false];
} else if (res[start1] == '_') {
start1++;
var size = res[start1++];
if (size != '4' && size != '5' && size != '6' && size != '8') {
return [matchId, '8x8', false];
}
var astcBlockSize = size + 'x' + size;
var limit = res[start1];
var limitType = false;
if (limit != '#') {
limitType = true;
}
start1 -= 2;
return [matchId.substr(0, start1), astcBlockSize, limitType];
} else {
return [matchId, '8x8', false];
}
}
return [-1, '8x8', false];
}
var matchIdInfo = getMatchId();
var matchId = matchIdInfo[0];
var astcBlockSize = matchIdInfo[1];
var limitType = matchIdInfo[2];
function compressedImage2D(rawData) {
var format = 0;
var dataOffset = 16;
var compressFormat = limitType ? GameGlobal.NoneLimitSupportedTexture : GameGlobal.TextureCompressedFormat;
switch (compressFormat) {
case "astc":
var astcList = GLctx.getExtension("WEBGL_compressed_texture_astc");
if (astcBlockSize == '4x4') {
format = astcList.COMPRESSED_RGBA_ASTC_4x4_KHR;
break;
}
if (astcBlockSize == '5x5') {
format = astcList.COMPRESSED_RGBA_ASTC_5x5_KHR;
break;
}
if (astcBlockSize == '6x6') {
format = 0x93B4;
break;
}
format = astcList.COMPRESSED_RGBA_ASTC_8x8_KHR;
break;
case "etc2":
format = GLctx.getExtension("WEBGL_compressed_texture_etc").COMPRESSED_RGBA8_ETC2_EAC;
break;
case "dds":
format = GLctx.getExtension("WEBGL_compressed_texture_s3tc").COMPRESSED_RGBA_S3TC_DXT5_EXT;
dataOffset = 128;
break;
case "pvr":
format = GLctx.getExtension("WEBGL_compressed_texture_pvrtc").COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;
var PVR_HEADER_METADATA = 12;
var PVR_HEADER_LENGTH = 13; // The header length in 32 bit ints.
var header = new Int32Array(rawData, 0, PVR_HEADER_LENGTH);
dataOffset = header[PVR_HEADER_METADATA] + 52;
break;
case "etc1":
format = GLctx.getExtension("WEBGL_compressed_texture_etc1").COMPRESSED_RGB_ETC1_WEBGL;
break
}
GLctx["compressedTexSubImage2D"](target, level, xoffset, yoffset, width, height, format, new Uint8Array(rawData, dataOffset))
}
function texImage2D(image) {
GLctx.texSubImage2D(target, level, xoffset, yoffset, width, height, GLctx.RGBA, GLctx.UNSIGNED_BYTE, image)
}
function renderTexture(id) {
if (!GL.textures[lastTid]) {
return;
}
var _data = GameGlobal.DownloadedTextures[id].data;
var tid = lastTid;
if (!GL.textures[tid]) {
return;
}
GLctx.bindTexture(GLctx.TEXTURE_2D, GL.textures[tid]);
if (limitType && !GameGlobal.NoneLimitSupportedTexture) {
texImage2D(_data);
} else if (!GameGlobal.TextureCompressedFormat) {
texImage2D(_data);
} else if (GameGlobal.TextureCompressedFormat == "pvr" && (width !== height || PotList.indexOf(height) == -1)) {
texImage2D(_data);
} else if (GameGlobal.TextureCompressedFormat == 'dds' && (height % 4 !== 0 || width % 4 !== 0)) {
texImage2D(_data);
} else {
compressedImage2D(_data);
}
GLctx.bindTexture(GLctx.TEXTURE_2D, window._lastBoundTexture ? GL.textures[window._lastBoundTexture] : null);
}
var p = window._lastTexStorage2DParams;
if (matchId != -1) {
var f = GLctx.RGBA8;
switch (GameGlobal.TextureCompressedFormat) {
case "astc":
var astcList = GLctx.getExtension("WEBGL_compressed_texture_astc");
if (astcBlockSize == '4x4') {
f = astcList.COMPRESSED_RGBA_ASTC_4x4_KHR;
break;
}
if (astcBlockSize == '5x5') {
f = astcList.COMPRESSED_RGBA_ASTC_5x5_KHR;
break;
}
if (astcBlockSize == '6x6') {
f = 0x93B4;
break;
}
f = astcList.COMPRESSED_RGBA_ASTC_8x8_KHR;
break;
case "etc2":
f = GLctx.getExtension("WEBGL_compressed_texture_etc").COMPRESSED_RGBA8_ETC2_EAC;
break;
case "dds":
f = GLctx.getExtension("WEBGL_compressed_texture_s3tc").COMPRESSED_RGBA_S3TC_DXT5_EXT;
break;
case "pvr":
f = GLctx.getExtension("WEBGL_compressed_texture_pvrtc").COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;
break;
}
GLctx["texStorage2D"](p[0], p[1], f, width, height);
if (GameGlobal.DownloadedTextures[matchId] && GameGlobal.DownloadedTextures[matchId].data) {
renderTexture(matchId)
} else {
window.WXWASMSDK.WXDownloadTexture(matchId, width, height, (function() {
renderTexture(matchId)
}), limitType)
}
return
}
if (GL.currentContext.supportsWebGL2EntryPoints) {
GLctx["compressedTexSubImage2D"](target, level, xoffset, yoffset, width, height, format, HEAPU8, data, imageSize);
return
}
GLctx["compressedTexSubImage2D"](target, level, xoffset, yoffset, width, height, format, data ? HEAPU8.subarray(data, data + imageSize) : null)
},
});
@@ -0,0 +1,37 @@
fileFormatVersion: 2
guid: d55bbf266368a4d91b5b8750b746dc78
PluginImporter:
externalObjects: {}
serializedVersion: 2
iconMap: {}
executionOrder: {}
defineConstraints: []
isPreloaded: 0
isOverridable: 0
isExplicitlyReferenced: 0
validateReferences: 1
platformData:
- first:
Any:
second:
enabled: 0
settings: {}
- first:
Editor: Editor
second:
enabled: 0
settings:
DefaultValueInitialized: true
- first:
WebGL: WebGL
second:
enabled: 0
settings: {}
- first:
WeixinMiniGame: WeixinMiniGame
second:
enabled: 0
settings: {}
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,324 @@
mergeInto(LibraryManager.library, {
glCompressedTexImage2D: function(target, level, internalFormat, width, height, border, imageSize, data) {
var lastTid = window._lastTextureId;
var isMiniProgram = typeof wx !== 'undefined';
function getMatchId() {
var webgl2c = internalFormat == 37493;
if (isMiniProgram && GameGlobal.USED_TEXTURE_COMPRESSION && webgl2c) {
var length = HEAPU8.subarray(data, data + 1)[0];
var d = HEAPU8.subarray(data + 1, data + 1 + length);
var res = [];
d.forEach(function(v) {
res.push(String.fromCharCode(v));
});
var matchId = res.join('');
var start0 = res.length - 8;
var start1 = res.length - 5;
if (res[start0] == '_') {
start0++;
var header = ['a', 's', 't', 'c'];
for (var i = 0; i < header.length; i++) {
if (res[start0 + i] != header[i]) {
return [matchId, '8x8', false];
}
}
start0--;
var astcBlockSize = matchId.substring(start0 + 5);
return [matchId.substr(0, start0), astcBlockSize, false];
} else if (res[start1] == '_') {
start1++;
var size = res[start1++];
if (size != '4' && size != '5' && size != '6' && size != '8') {
return [matchId, '8x8', false];
}
var astcBlockSize = size + 'x' + size;
var limit = res[start1];
var limitType = false;
if (limit != '#') {
limitType = true;
}
start1 -= 2;
return [matchId.substr(0, start1), astcBlockSize, limitType];
} else {
return [matchId, '8x8', false];
}
}
return [-1, '8x8', false];
}
var matchIdInfo = getMatchId();
var matchId = matchIdInfo[0];
var astcBlockSize = matchIdInfo[1];
var limitType = matchIdInfo[2];
function compressedImage2D(rawData) {
var format = 0;
var dataOffset = 16;
var compressFormat = limitType ? GameGlobal.NoneLimitSupportedTexture : GameGlobal.TextureCompressedFormat;
switch (compressFormat) {
case "astc":
var astcList = GLctx.getExtension("WEBGL_compressed_texture_astc");
if (astcBlockSize == '4x4') {
format = astcList.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR;
break;
}
if (astcBlockSize == '5x5') {
format = astcList.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR;
break;
}
if (astcBlockSize == '6x6') {
format = astcList.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR;
break;
}
format = astcList.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR;
break;
case "etc2":
format = GLctx.getExtension("WEBGL_compressed_texture_etc").COMPRESSED_RGBA8_ETC2_EAC;
break;
case "dds":
format = GLctx.getExtension("WEBGL_compressed_texture_s3tc").COMPRESSED_RGBA_S3TC_DXT5_EXT;
dataOffset = 128;
break;
case "pvr":
format = GLctx.getExtension("WEBGL_compressed_texture_pvrtc").COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;
var PVR_HEADER_METADATA = 12;
var PVR_HEADER_LENGTH = 13; // The header length in 32 bit ints.
var header = new Int32Array(rawData, 0, PVR_HEADER_LENGTH);
dataOffset = header[PVR_HEADER_METADATA] + 52;
break;
case "etc1":
format = GLctx.getExtension("WEBGL_compressed_texture_etc1").COMPRESSED_RGB_ETC1_WEBGL;
break
}
GLctx["compressedTexImage2D"](target, level, format, width, height, border, new Uint8Array(rawData, dataOffset))
}
function texImage2D(image) {
GLctx.texImage2D(GLctx.TEXTURE_2D, 0, GLctx.RGBA, GLctx.RGBA, GLctx.UNSIGNED_BYTE, image)
}
function renderTexture(id) {
if (!GL.textures[lastTid]) {
return;
}
var PotList = [1, 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024, 2048, 4096];
var _data = GameGlobal.DownloadedTextures[id].data;
var tid = lastTid;
if (!GL.textures[tid]) {
return;
}
GLctx.bindTexture(GLctx.TEXTURE_2D, GL.textures[tid]);
if (limitType && !GameGlobal.NoneLimitSupportedTexture) {
texImage2D(_data);
} else if (!GameGlobal.TextureCompressedFormat) {
texImage2D(_data);
} else if (GameGlobal.TextureCompressedFormat == "pvr" && (width !== height || PotList.indexOf(height) == -1)) {
texImage2D(_data);
} else if (GameGlobal.TextureCompressedFormat == 'dds' && (height % 4 !== 0 || width % 4 !== 0)) {
texImage2D(_data);
} else {
compressedImage2D(_data);
}
GLctx.bindTexture(GLctx.TEXTURE_2D, window._lastBoundTexture ? GL.textures[window._lastBoundTexture] : null);
}
function renderTransparent() {
GLctx.texImage2D(GLctx.TEXTURE_2D, 0, GLctx.RGBA, 1, 1, 0, GLctx.RGBA, GLctx.UNSIGNED_SHORT_4_4_4_4, new Uint16Array([0, 0]))
}
if (matchId != -1) {
if (GameGlobal.DownloadedTextures[matchId] && GameGlobal.DownloadedTextures[matchId].data) {
renderTexture(matchId)
} else {
renderTransparent();
window.WXWASMSDK.WXDownloadTexture(matchId, width, height, (function() {
renderTexture(matchId)
}), limitType)
}
return
}
if (GL.currentContext.supportsWebGL2EntryPoints) {
GLctx["compressedTexImage2D"](target, level, internalFormat, width, height, border, HEAPU8, data, imageSize);
return
}
GLctx["compressedTexImage2D"](target, level, internalFormat, width, height, border, data ? HEAPU8.subarray(data, data + imageSize) : null)
},
glCompressedTexSubImage2D: function(target, level, xoffset, yoffset, width, height, format, imageSize, data) {
var lastTid = window._lastTextureId;
var isMiniProgram = typeof wx !== 'undefined';
function getMatchId() {
var webgl2c = format == 37493;
if (isMiniProgram && GameGlobal.USED_TEXTURE_COMPRESSION && webgl2c) {
var length = HEAPU8.subarray(data, data + 1)[0];
var d = HEAPU8.subarray(data + 1, data + 1 + length);
var res = [];
d.forEach(function(v) {
res.push(String.fromCharCode(v));
});
var matchId = res.join('');
var start0 = res.length - 8;
var start1 = res.length - 5;
if (res[start0] == '_') {
start0++;
var header = ['a', 's', 't', 'c'];
for (var i = 0; i < header.length; i++) {
if (res[start0 + i] != header[i]) {
return [matchId, '8x8', false];
}
}
start0--;
var astcBlockSize = matchId.substring(start0 + 5);
return [matchId.substr(0, start0), astcBlockSize, false];
} else if (res[start1] == '_') {
start1++;
var size = res[start1++];
if (size != '4' && size != '5' && size != '6' && size != '8') {
return [matchId, '8x8', false];
}
var astcBlockSize = size + 'x' + size;
var limit = res[start1];
var limitType = false;
if (limit != '#') {
limitType = true;
}
start1 -= 2;
return [matchId.substr(0, start1), astcBlockSize, limitType];
} else {
return [matchId, '8x8', false];
}
}
return [-1, '8x8', false];
}
var matchIdInfo = getMatchId();
var matchId = matchIdInfo[0];
var astcBlockSize = matchIdInfo[1];
var limitType = matchIdInfo[2];
function compressedImage2D(rawData) {
var format = 0;
var dataOffset = 16;
var compressFormat = limitType ? GameGlobal.NoneLimitSupportedTexture : GameGlobal.TextureCompressedFormat;
switch (compressFormat) {
case "astc":
var astcList = GLctx.getExtension("WEBGL_compressed_texture_astc");
if (astcBlockSize == '4x4') {
format = astcList.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR;
break;
}
if (astcBlockSize == '5x5') {
format = astcList.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR;
break;
}
if (astcBlockSize == '6x6') {
format = astcList.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR;
break;
}
format = astcList.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR;
break;
case "etc2":
format = GLctx.getExtension("WEBGL_compressed_texture_etc").COMPRESSED_RGBA8_ETC2_EAC;
break;
case "dds":
format = GLctx.getExtension("WEBGL_compressed_texture_s3tc").COMPRESSED_RGBA_S3TC_DXT5_EXT;
dataOffset = 128;
break;
case "pvr":
format = GLctx.getExtension("WEBGL_compressed_texture_pvrtc").COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;
var PVR_HEADER_METADATA = 12;
var PVR_HEADER_LENGTH = 13; // The header length in 32 bit ints.
var header = new Int32Array(rawData, 0, PVR_HEADER_LENGTH);
dataOffset = header[PVR_HEADER_METADATA] + 52;
break;
case "etc1":
format = GLctx.getExtension("WEBGL_compressed_texture_etc1").COMPRESSED_RGB_ETC1_WEBGL;
break
}
GLctx["compressedTexSubImage2D"](target, level, xoffset, yoffset, width, height, format, new Uint8Array(rawData, dataOffset))
}
function texImage2D(image) {
GLctx.texSubImage2D(target, level, xoffset, yoffset, width, height, GLctx.RGBA, GLctx.UNSIGNED_BYTE, image)
}
function renderTexture(id) {
if (!GL.textures[lastTid]) {
return;
}
var _data = GameGlobal.DownloadedTextures[id].data;
var tid = lastTid;
if (!GL.textures[tid]) {
return;
}
GLctx.bindTexture(GLctx.TEXTURE_2D, GL.textures[tid]);
if (limitType && !GameGlobal.NoneLimitSupportedTexture) {
texImage2D(_data);
} else if (!GameGlobal.TextureCompressedFormat) {
texImage2D(_data);
} else if (GameGlobal.TextureCompressedFormat == "pvr" && (width !== height || PotList.indexOf(height) == -1)) {
texImage2D(_data);
} else if (GameGlobal.TextureCompressedFormat == 'dds' && (height % 4 !== 0 || width % 4 !== 0)) {
texImage2D(_data);
} else {
compressedImage2D(_data);
}
GLctx.bindTexture(GLctx.TEXTURE_2D, window._lastBoundTexture ? GL.textures[window._lastBoundTexture] : null);
}
var p = window._lastTexStorage2DParams;
if (matchId != -1) {
var f = GLctx.RGBA8;
switch (GameGlobal.TextureCompressedFormat) {
case "astc":
var astcList = GLctx.getExtension("WEBGL_compressed_texture_astc");
if (astcBlockSize == '4x4') {
f = astcList.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR;
break;
}
if (astcBlockSize == '5x5') {
f = astcList.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR;
break;
}
if (astcBlockSize == '6x6') {
f = astcList.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR;
break;
}
f = astcList.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR;
break;
case "etc2":
f = GLctx.getExtension("WEBGL_compressed_texture_etc").COMPRESSED_RGBA8_ETC2_EAC;
break;
case "dds":
f = GLctx.getExtension("WEBGL_compressed_texture_s3tc").COMPRESSED_RGBA_S3TC_DXT5_EXT;
break;
case "pvr":
f = GLctx.getExtension("WEBGL_compressed_texture_pvrtc").COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;
break;
}
GLctx["texStorage2D"](p[0], p[1], f, width, height);
if (GameGlobal.DownloadedTextures[matchId] && GameGlobal.DownloadedTextures[matchId].data) {
renderTexture(matchId)
} else {
window.WXWASMSDK.WXDownloadTexture(matchId, width, height, (function() {
renderTexture(matchId)
}), limitType)
}
return
}
if (GL.currentContext.supportsWebGL2EntryPoints) {
GLctx["compressedTexSubImage2D"](target, level, xoffset, yoffset, width, height, format, HEAPU8, data, imageSize);
return
}
GLctx["compressedTexSubImage2D"](target, level, xoffset, yoffset, width, height, format, data ? HEAPU8.subarray(data, data + imageSize) : null)
},
});
@@ -0,0 +1,37 @@
fileFormatVersion: 2
guid: f1315910877e64f9898a2c5a31a63994
PluginImporter:
externalObjects: {}
serializedVersion: 2
iconMap: {}
executionOrder: {}
defineConstraints: []
isPreloaded: 0
isOverridable: 0
isExplicitlyReferenced: 0
validateReferences: 1
platformData:
- first:
Any:
second:
enabled: 0
settings: {}
- first:
Editor: Editor
second:
enabled: 0
settings:
DefaultValueInitialized: true
- first:
WebGL: WebGL
second:
enabled: 1
settings: {}
- first:
WeixinMiniGame: WeixinMiniGame
second:
enabled: 1
settings: {}
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,324 @@
mergeInto(LibraryManager.library, {
glCompressedTexImage2D: function(target, level, internalFormat, width, height, border, imageSize, data) {
var lastTid = window._lastTextureId;
var isMiniProgram = typeof wx !== 'undefined';
function getMatchId() {
var webgl2c = internalFormat == 37492;
if (isMiniProgram && GameGlobal.USED_TEXTURE_COMPRESSION && webgl2c) {
var length = HEAPU8.subarray(data, data + 1)[0];
var d = HEAPU8.subarray(data + 1, data + 1 + length);
var res = [];
d.forEach(function(v) {
res.push(String.fromCharCode(v));
});
var matchId = res.join('');
var start0 = res.length - 8;
var start1 = res.length - 5;
if (res[start0] == '_') {
start0++;
var header = ['a', 's', 't', 'c'];
for (var i = 0; i < header.length; i++) {
if (res[start0 + i] != header[i]) {
return [matchId, '8x8', false];
}
}
start0--;
var astcBlockSize = matchId.substring(start0 + 5);
return [matchId.substr(0, start0), astcBlockSize, false];
} else if (res[start1] == '_') {
start1++;
var size = res[start1++];
if (size != '4' && size != '5' && size != '6' && size != '8') {
return [matchId, '8x8', false];
}
var astcBlockSize = size + 'x' + size;
var limit = res[start1];
var limitType = false;
if (limit != '#') {
limitType = true;
}
start1 -= 2;
return [matchId.substr(0, start1), astcBlockSize, limitType];
} else {
return [matchId, '8x8', false];
}
}
return [-1, '8x8', false];
}
var matchIdInfo = getMatchId();
var matchId = matchIdInfo[0];
var astcBlockSize = matchIdInfo[1];
var limitType = matchIdInfo[2];
function compressedImage2D(rawData) {
var format = 0;
var dataOffset = 16;
var compressFormat = limitType ? GameGlobal.NoneLimitSupportedTexture : GameGlobal.TextureCompressedFormat;
switch (compressFormat) {
case "astc":
var astcList = GLctx.getExtension("WEBGL_compressed_texture_astc");
if (astcBlockSize == '4x4') {
format = astcList.COMPRESSED_RGBA_ASTC_4x4_KHR;
break;
}
if (astcBlockSize == '5x5') {
format = astcList.COMPRESSED_RGBA_ASTC_5x5_KHR;
break;
}
if (astcBlockSize == '6x6') {
format = 0x93B4;
break;
}
format = astcList.COMPRESSED_RGBA_ASTC_8x8_KHR;
break;
case "etc2":
format = GLctx.getExtension("WEBGL_compressed_texture_etc").COMPRESSED_RGBA8_ETC2_EAC;
break;
case "dds":
format = GLctx.getExtension("WEBGL_compressed_texture_s3tc").COMPRESSED_RGBA_S3TC_DXT5_EXT;
dataOffset = 128;
break;
case "pvr":
format = GLctx.getExtension("WEBGL_compressed_texture_pvrtc").COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;
var PVR_HEADER_METADATA = 12;
var PVR_HEADER_LENGTH = 13; // The header length in 32 bit ints.
var header = new Int32Array(rawData, 0, PVR_HEADER_LENGTH);
dataOffset = header[PVR_HEADER_METADATA] + 52;
break;
case "etc1":
format = GLctx.getExtension("WEBGL_compressed_texture_etc1").COMPRESSED_RGB_ETC1_WEBGL;
break
}
GLctx["compressedTexImage2D"](target, level, format, width, height, border, new Uint8Array(rawData, dataOffset))
}
function texImage2D(image) {
GLctx.texImage2D(GLctx.TEXTURE_2D, 0, GLctx.RGBA, GLctx.RGBA, GLctx.UNSIGNED_BYTE, image)
}
function renderTexture(id) {
if (!GL.textures[lastTid]) {
return;
}
var PotList = [1, 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024, 2048, 4096];
var _data = GameGlobal.DownloadedTextures[id].data;
var tid = lastTid;
if (!GL.textures[tid]) {
return;
}
GLctx.bindTexture(GLctx.TEXTURE_2D, GL.textures[tid]);
if (limitType && !GameGlobal.NoneLimitSupportedTexture) {
texImage2D(_data);
} else if (!GameGlobal.TextureCompressedFormat) {
texImage2D(_data);
} else if (GameGlobal.TextureCompressedFormat == "pvr" && (width !== height || PotList.indexOf(height) == -1)) {
texImage2D(_data);
} else if (GameGlobal.TextureCompressedFormat == 'dds' && (height % 4 !== 0 || width % 4 !== 0)) {
texImage2D(_data);
} else {
compressedImage2D(_data);
}
GLctx.bindTexture(GLctx.TEXTURE_2D, window._lastBoundTexture ? GL.textures[window._lastBoundTexture] : null);
}
function renderTransparent() {
GLctx.texImage2D(GLctx.TEXTURE_2D, 0, GLctx.RGBA, 1, 1, 0, GLctx.RGBA, GLctx.UNSIGNED_SHORT_4_4_4_4, new Uint16Array([0, 0]))
}
if (matchId != -1) {
if (GameGlobal.DownloadedTextures[matchId] && GameGlobal.DownloadedTextures[matchId].data) {
renderTexture(matchId)
} else {
renderTransparent();
window.WXWASMSDK.WXDownloadTexture(matchId, width, height, (function() {
renderTexture(matchId)
}), limitType)
}
return
}
if (GL.currentContext.supportsWebGL2EntryPoints) {
GLctx["compressedTexImage2D"](target, level, internalFormat, width, height, border, HEAPU8, data, imageSize);
return
}
GLctx["compressedTexImage2D"](target, level, internalFormat, width, height, border, data ? HEAPU8.subarray(data, data + imageSize) : null)
},
glCompressedTexSubImage2D: function(target, level, xoffset, yoffset, width, height, format, imageSize, data) {
var lastTid = window._lastTextureId;
var isMiniProgram = typeof wx !== 'undefined';
function getMatchId() {
var webgl2c = format == 37492;
if (isMiniProgram && GameGlobal.USED_TEXTURE_COMPRESSION && webgl2c) {
var length = HEAPU8.subarray(data, data + 1)[0];
var d = HEAPU8.subarray(data + 1, data + 1 + length);
var res = [];
d.forEach(function(v) {
res.push(String.fromCharCode(v));
});
var matchId = res.join('');
var start0 = res.length - 8;
var start1 = res.length - 5;
if (res[start0] == '_') {
start0++;
var header = ['a', 's', 't', 'c'];
for (var i = 0; i < header.length; i++) {
if (res[start0 + i] != header[i]) {
return [matchId, '8x8', false];
}
}
start0--;
var astcBlockSize = matchId.substring(start0 + 5);
return [matchId.substr(0, start0), astcBlockSize, false];
} else if (res[start1] == '_') {
start1++;
var size = res[start1++];
if (size != '4' && size != '5' && size != '6' && size != '8') {
return [matchId, '8x8', false];
}
var astcBlockSize = size + 'x' + size;
var limit = res[start1];
var limitType = false;
if (limit != '#') {
limitType = true;
}
start1 -= 2;
return [matchId.substr(0, start1), astcBlockSize, limitType];
} else {
return [matchId, '8x8', false];
}
}
return [-1, '8x8', false];
}
var matchIdInfo = getMatchId();
var matchId = matchIdInfo[0];
var astcBlockSize = matchIdInfo[1];
var limitType = matchIdInfo[2];
function compressedImage2D(rawData) {
var format = 0;
var dataOffset = 16;
var compressFormat = limitType ? GameGlobal.NoneLimitSupportedTexture : GameGlobal.TextureCompressedFormat;
switch (compressFormat) {
case "astc":
var astcList = GLctx.getExtension("WEBGL_compressed_texture_astc");
if (astcBlockSize == '4x4') {
format = astcList.COMPRESSED_RGBA_ASTC_4x4_KHR;
break;
}
if (astcBlockSize == '5x5') {
format = astcList.COMPRESSED_RGBA_ASTC_5x5_KHR;
break;
}
if (astcBlockSize == '6x6') {
format = 0x93B4;
break;
}
format = astcList.COMPRESSED_RGBA_ASTC_8x8_KHR;
break;
case "etc2":
format = GLctx.getExtension("WEBGL_compressed_texture_etc").COMPRESSED_RGBA8_ETC2_EAC;
break;
case "dds":
format = GLctx.getExtension("WEBGL_compressed_texture_s3tc").COMPRESSED_RGBA_S3TC_DXT5_EXT;
dataOffset = 128;
break;
case "pvr":
format = GLctx.getExtension("WEBGL_compressed_texture_pvrtc").COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;
var PVR_HEADER_METADATA = 12;
var PVR_HEADER_LENGTH = 13; // The header length in 32 bit ints.
var header = new Int32Array(rawData, 0, PVR_HEADER_LENGTH);
dataOffset = header[PVR_HEADER_METADATA] + 52;
break;
case "etc1":
format = GLctx.getExtension("WEBGL_compressed_texture_etc1").COMPRESSED_RGB_ETC1_WEBGL;
break
}
GLctx["compressedTexSubImage2D"](target, level, xoffset, yoffset, width, height, format, new Uint8Array(rawData, dataOffset))
}
function texImage2D(image) {
GLctx.texSubImage2D(target, level, xoffset, yoffset, width, height, GLctx.RGBA, GLctx.UNSIGNED_BYTE, image)
}
function renderTexture(id) {
if (!GL.textures[lastTid]) {
return;
}
var _data = GameGlobal.DownloadedTextures[id].data;
var tid = lastTid;
if (!GL.textures[tid]) {
return;
}
GLctx.bindTexture(GLctx.TEXTURE_2D, GL.textures[tid]);
if (limitType && !GameGlobal.NoneLimitSupportedTexture) {
texImage2D(_data);
} else if (!GameGlobal.TextureCompressedFormat) {
texImage2D(_data);
} else if (GameGlobal.TextureCompressedFormat == "pvr" && (width !== height || PotList.indexOf(height) == -1)) {
texImage2D(_data);
} else if (GameGlobal.TextureCompressedFormat == 'dds' && (height % 4 !== 0 || width % 4 !== 0)) {
texImage2D(_data);
} else {
compressedImage2D(_data);
}
GLctx.bindTexture(GLctx.TEXTURE_2D, window._lastBoundTexture ? GL.textures[window._lastBoundTexture] : null);
}
var p = window._lastTexStorage2DParams;
if (matchId != -1) {
var f = GLctx.RGBA8;
switch (GameGlobal.TextureCompressedFormat) {
case "astc":
var astcList = GLctx.getExtension("WEBGL_compressed_texture_astc");
if (astcBlockSize == '4x4') {
f = astcList.COMPRESSED_RGBA_ASTC_4x4_KHR;
break;
}
if (astcBlockSize == '5x5') {
f = astcList.COMPRESSED_RGBA_ASTC_5x5_KHR;
break;
}
if (astcBlockSize == '6x6') {
f = 0x93B4;
break;
}
f = astcList.COMPRESSED_RGBA_ASTC_8x8_KHR;
break;
case "etc2":
f = GLctx.getExtension("WEBGL_compressed_texture_etc").COMPRESSED_RGBA8_ETC2_EAC;
break;
case "dds":
f = GLctx.getExtension("WEBGL_compressed_texture_s3tc").COMPRESSED_RGBA_S3TC_DXT5_EXT;
break;
case "pvr":
f = GLctx.getExtension("WEBGL_compressed_texture_pvrtc").COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;
break;
}
GLctx["texStorage2D"](p[0], p[1], f, width, height);
if (GameGlobal.DownloadedTextures[matchId] && GameGlobal.DownloadedTextures[matchId].data) {
renderTexture(matchId)
} else {
window.WXWASMSDK.WXDownloadTexture(matchId, width, height, (function() {
renderTexture(matchId)
}), limitType)
}
return
}
if (GL.currentContext.supportsWebGL2EntryPoints) {
GLctx["compressedTexSubImage2D"](target, level, xoffset, yoffset, width, height, format, HEAPU8, data, imageSize);
return
}
GLctx["compressedTexSubImage2D"](target, level, xoffset, yoffset, width, height, format, data ? HEAPU8.subarray(data, data + imageSize) : null)
},
});
@@ -0,0 +1,37 @@
fileFormatVersion: 2
guid: 3940ebcc91b954d46ab08a5ee248e437
PluginImporter:
externalObjects: {}
serializedVersion: 2
iconMap: {}
executionOrder: {}
defineConstraints: []
isPreloaded: 0
isOverridable: 0
isExplicitlyReferenced: 0
validateReferences: 1
platformData:
- first:
Any:
second:
enabled: 0
settings: {}
- first:
Editor: Editor
second:
enabled: 0
settings:
DefaultValueInitialized: true
- first:
WebGL: WebGL
second:
enabled: 0
settings: {}
- first:
WeixinMiniGame: WeixinMiniGame
second:
enabled: 0
settings: {}
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,114 @@
var UDPSocketLibrary =
{
$udpSocketManager:
{
/*
* Map of instances
*
* Instance structure:
* {
* url: string,
* ws: WebSocket
* }
*/
instances: {},
/* Last instance ID */
lastId: 0,
/* Event listeners */
onOpen: null,
onMessage: null,
onError: null,
onClose: null,
},
WXCreateUDPSocket: function (server, remotePort, localPort) {
var instanceId = ++udpSocketManager.lastId;
var udpSocket = wx.createUDPSocket();
if (localPort == 0) {
localPort = udpSocket.bind()
} else {
udpSocket.bind(localPort)
}
var instance = {
instanceId: instanceId,
socket: udpSocket,
server: UTF8ToString(server),
remotePort: remotePort,
localPort: localPort,
OnMessage: (function (res) {
if (udpSocketManager.onMessage) {
var dataBuffer = new Uint8Array(res.message);
var buffer = _malloc(dataBuffer.length);
HEAPU8.set(dataBuffer, buffer);
Module.dynCall_viii(udpSocketManager.onMessage, instanceId, buffer, dataBuffer.length);
_free(buffer)
}
}),
OnError: (function (res) {
if (udpSocketManager.onError) {
var msg = res.errMsg;
console.log("udp socket on error " + instanceId + " " + msg);
var length = lengthBytesUTF8(msg) + 1;
var buffer = _malloc(length);
stringToUTF8(msg, buffer, length);
Module.dynCall_vii(udpSocketManager.onError, instanceId, buffer);
_free(buffer)
}
}),
OnClose: (function (res) {
if (udpSocketManager.onClose) {
Module.dynCall_vi(udpSocketManager.onClose, instanceId)
}
})
};
udpSocket.onMessage(instance.OnMessage);
udpSocket.onError(instance.OnError);
udpSocket.onClose(instance.OnClose);
udpSocket.connect({
address:instance.server,
port:instance.remotePort
});
udpSocketManager.instances[instanceId] = instance;
return instanceId
},
WXSendUDPSocket: function (instanceId, bufferPtr, offset, length) {
var instance = udpSocketManager.instances[instanceId];
if (instance && instance.socket) {
instance.socket.write({
address: instance.server,
port: instance.remotePort,
message: buffer.slice(bufferPtr + offset, bufferPtr + length)
})
} else {
console.log("udp socket instance not found " + instanceId)
}
},
WXCloseUDPSocket: function (instanceId) {
var instance = udpSocketManager.instances[instanceId];
if (instance && instance.socket) {
instance.socket.close();
instance.socket = null;
delete udpSocketManager.instances[instanceId]
} else {
console.log("udp socket instance not found " + instanceId)
}
},
WXUDPSocketSetOnMessage: function (callback) {
udpSocketManager.onMessage = callback
},
WXUDPSocketSetOnClose: function (callback) {
udpSocketManager.onClose = callback
},
WXUDPSocketSetOnError: function (callback) {
udpSocketManager.onError = callback
}
};
autoAddDeps(UDPSocketLibrary, '$udpSocketManager');
mergeInto(LibraryManager.library, UDPSocketLibrary);
@@ -0,0 +1,74 @@
fileFormatVersion: 2
guid: 1a619860d36bdfb4eaa583d3ba561e99
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:
Standalone: Linux64
second:
enabled: 0
settings:
CPU: x86_64
- 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:
@@ -0,0 +1,33 @@
fileFormatVersion: 2
guid: f17a7c2339e372b468d80e48b8a1fbb8
PluginImporter:
externalObjects: {}
serializedVersion: 2
iconMap: {}
executionOrder: {}
defineConstraints: []
isPreloaded: 0
isOverridable: 0
isExplicitlyReferenced: 0
validateReferences: 1
platformData:
- first:
Any:
second:
enabled: 1
settings: {}
- first:
Editor: Editor
second:
enabled: 0
settings:
DefaultValueInitialized: true
- first:
Windows Store Apps: WindowsStoreApps
second:
enabled: 0
settings:
CPU: AnyCPU
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,439 @@
var WXAssetBundleLibrary = {
$WXFS: {},
WXFSInit: function (ttl, capacity) {
function _instanceof(left, right) { if (right != null && typeof Symbol !== "undefined" && right[Symbol.hasInstance]) { return !!right[Symbol.hasInstance](left); } else { return left instanceof right; } }
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
function _classCallCheck(instance, Constructor) { if (!_instanceof(instance, Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
var WXMap = /*#__PURE__*/function () {
function WXMap(hash, rename) {
_classCallCheck(this, WXMap);
this.hash = hash;
this.rename = rename;
this.size = 0;
}
_createClass(WXMap, [{
key: "get",
value: function get(key) {
return this.hash.get(this.rename(key));
}
}, {
key: "set",
value: function set(key, value) {
this.delete(key);
this.size += value;
return this.hash.set(this.rename(key), value);
}
}, {
key: "has",
value: function has(key) {
return this.hash.has(this.rename(key));
}
}, {
key: "delete",
value: function _delete(key) {
this.size -= this.hash.get(this.rename(key))|0;
return this.hash.delete(this.rename(key));
}
}]);
return WXMap;
}();
WXFS.WXABErrorSteps = {
"kWebRequestResponse": 0,
"kLoadBundleFromFile": 1,
"kCacheGet" : 2
};
WXFS.disk = new WXMap(unityNamespace.WXAssetBundles,unityNamespace.PathInFileOS);
WXFS.msg = "";
WXFS.fd2wxStream = new Map;
WXFS.path2fd = new Map;
WXFS.fs = wx.getFileSystemManager();
WXFS.nowfd = FS.MAX_OPEN_FDS + 1;
WXFS.isWXAssetBundle = function(url){
if(url.startsWith(GameGlobal.unityNamespace.DATA_CDN)||url.startsWith('/vfs_streamingassets')){
return unityNamespace.isWXAssetBundle(WXFS.url2path(url));
}
return unityNamespace.isWXAssetBundle(url);
}
WXFS.newfd = function(){
return WXFS.nowfd++;
}
WXFS.doWXAccess = function(path, amode){
if (amode & ~7) {
return -28;
}
try{
WXFS.fs.accessSync(path);
} catch(e){
return -44;
}
return 0
}
var WXFileCache = /*#__PURE__*/function () {
function WXFileCache(ttl, capacity) {
_classCallCheck(this, WXFileCache);
this.ttl = ttl;
if (capacity > 0) this.capacity = capacity;
this.hash = new Map();
this.size = 0;
this.maxSize = 0;
this.obsolete = "";
}
// record obsolete file path when file not found
_createClass(WXFileCache, [{
key: "record",
value: function record(path) {
if (!this.obsolete.includes(path)) {
if (this.obsolete != "") this.obsolete += ";";
this.obsolete += path;
}
}
}, {
key: "get",
value: function get(key) {
var temp = this.hash.get(key);
if (temp !== undefined) {
if(temp.cleanable && unityNamespace.isAndroid && temp.time + this.ttl * 1000 < Date.now()){
try {
var check_path = WXFS.fd2wxStream.get(key).path
if(!GameGlobal.manager.getCachePath(check_path)){
throw new Error("No such file in the wx cache system")
}
WXFS.fs.statSync(check_path)
} catch (e) {
GameGlobal.manager.reporter.wxAssetBundle.reportEmptyContent({stage: WXFS.WXABErrorSteps['kCacheGet'], path: check_path, error: !!e ? e.toString() : 'unknown'});
GameGlobal.manager.Logger.pluginLog('[WXAssetBundle]Android statSync path: ' + check_path + ' error: ' + (!!e ? e.toString() : 'unknown'));
}
}
this.hash.delete(key);
temp.time = Date.now();
this.hash.set(key, temp);
return temp.ab;
}
return -1;
}
}, {
key: "put",
value: function put(key, ab, cleanable) {
if(!ab)return;
cleanable = cleanable != undefined ? cleanable : true;
var value = {
ab: ab,
time: Date.now(),
cleanable: cleanable
};
var temp = this.hash.get(key);
if (temp !== undefined) {
this.size -= temp.ab.byteLength;
this.hash.delete(key);
this.hash.set(key, value);
} else {
if (this.capacity !== undefined && this.size >= this.capacity) {
var idx = this.hash.keys().next().value;
this.size -= idx.ab.byteLength;
this.hash.delete(idx);
this.hash.set(key, value);
} else {
this.hash.set(key, value);
}
}
this.size += value.ab.byteLength;
this.maxSize = Math.max(this.size, this.maxSize);
}
}, {
key: "cleanable",
value: function cleanable(key, _cleanable) {
_cleanable = _cleanable != undefined ? _cleanable : true;
var temp = this.hash.get(key);
if (temp !== undefined) {
// this.hash.delete(key);
// temp.time = Date.now();
temp.cleanable = _cleanable;
this.hash.set(key, temp);
return 0;
} else {
return -1;
}
}
}, {
key: "cleanbytime",
value: function cleanbytime(deadline) {
var iter = this.hash.keys(),
key,
value;
while ((key = iter.next().value) != undefined && (value = this.hash.get(key)).time < deadline) {
if (value.cleanable) {
this.size -= value.ab.byteLength;
this.hash.delete(key);
}
}
}
}, {
key: "RegularCleaning",
value: function RegularCleaning(kIntervalSecond) {
var _this = this;
setInterval(function () {
_this.cleanbytime(Date.now() - _this.ttl * 1000);
}, kIntervalSecond * 1000);
}
}, {
key: "delete",
value: function _delete(key) {
this.size -= this.hash.get(key).ab.byteLength;
return this.hash.delete(key)
}
}, {
key: "has",
value: function _has(key) {
return this.hash.has(key)
}
}
]);
return WXFileCache;
}();
WXFS.cache = new WXFileCache(ttl, capacity);
if(!unityNamespace.isAndroid) {
WXFS.cache.RegularCleaning(1);
}
WXFS.wxstat = function(path){
try {
var fd = WXFS.path2fd.get(path)
if (fd !== undefined){
var stat = {
mode: 33206,
size: WXFS.cache.get(fd).byteLength,
dev: 1,
ino: 1,
nlink: 1,
uid: 0,
gid: 0,
rdev: 0,
atime: new Date(),
mtime: new Date(0),
ctime: new Date(),
blksize: 4096
}
stat.blocks = Math.ceil(stat.size / stat.blksize);
return stat;
}
var stat = WXFS.fs.statSync(path);
// something not in wx.FileSystemManager, just fill in 0/1
stat.dev = 1;
stat.ino = 1;
stat.nlink = 1;
stat.uid = 0;
stat.gid = 0;
stat.rdev = 0;
stat.atime = new Date(stat.lastAccessedTime * 1000);
stat.mtime = new Date(0); // if update modified time, wasm will log error "Archive file was modified when opened"
stat.ctime = new Date(stat.lastModifiedTime * 1000); // time of permission modification, just use mtime to instand
delete stat.lastAccessedTime;
delete stat.lastModifiedTime;
stat.blksize = 4096;
stat.blocks = Math.ceil(stat.size / stat.blksize);
return stat;
} catch (e){
console.error(e)
throw e;
}
}
WXFS._url2path = new Map();
WXFS.url2path = function(url) {
if(WXFS._url2path.has(url)){
return WXFS._url2path.get(url);
}
if(url.startsWith('/vfs_streamingassets/')){
var path = url.replace('/vfs_streamingassets/', wx.env.USER_DATA_PATH + "/__GAME_FILE_CACHE/StreamingAssets/");
}
else{
var path = url.replace(GameGlobal.unityNamespace.DATA_CDN, wx.env.USER_DATA_PATH+'/__GAME_FILE_CACHE/');
}
if(path.indexOf('?') > -1){
path = path.substring(0,path.indexOf("?"));
}
WXFS._url2path.set(url, path);
return path;
};
WXFS.LoadBundleFromFile = function(path){
try {
var res = WXFS.fs.readFileSync(path);
} catch(e) {
var err_msg = !!e ? e.toString() : 'unknown';
}
var expected_size = WXFS.disk.get(path);
if(!res || res.byteLength != expected_size){
var wxab_error = {
stage: WXFS.WXABErrorSteps['kLoadBundleFromFile'],
path: path,
size: (!!res ? res.byteLength : 0),
expected_size: expected_size,
error: err_msg
};
GameGlobal.manager.reporter.wxAssetBundle.reportEmptyContent(wxab_error);
GameGlobal.manager.Logger.pluginLog('[WXAssetBundle]readFileSync at path ' + path + ' return size ' + (!!res?res.byteLength:0) + ', different from expected size ' + expected_size + ' error: ' + err_msg);
wx.setStorageSync("wxfs_unserviceable",true);
GameGlobal.onCrash();
return "";
}
return res;
};
WXFS.read = function(stream, buffer, offset, length, position){
var contents = WXFS.cache.get(stream.fd);
if (contents === -1) {
var res = WXFS.LoadBundleFromFile(stream.path);
WXFS.cache.put(stream.fd, res);
contents = res;
}
if (position >= stream.node.usedBytes) return 0;
var size = Math.min(stream.node.usedBytes - position, length);
assert(size >= 0);
buffer.set(new Uint8Array(contents.slice(position, position + size)), offset);
return size;
};
},
GetObsoleteFilePath: function () {
var bufferSize = lengthBytesUTF8(WXFS.cache.obsolete) + 1;
var buffer = _malloc(bufferSize);
stringToUTF8(WXFS.cache.obsolete, buffer, bufferSize);
WXFS.cache.obsolete = "";
return buffer;
},
UnCleanbyPath: function (ptr) {
var url = UTF8ToString(ptr);
var path = WXFS.url2path(url);
if(!WXFS.disk.has(path)){
WXFS.disk.set(path, 0);
}
},
UnloadbyPath: function (ptr) {
var path = WXFS.url2path(UTF8ToString(ptr));
var fd = WXFS.path2fd.get(path);
if(WXFS.cache.has(fd)){
WXFS.cache.delete(fd);
}
if(WXFS.disk.has(path)){
WXFS.disk.delete(path);
}
},
CheckWXFSReady: function () {
return WXFS.fs!==undefined;
},
WXGetBundleFromXML: function(url, id, callback, needRetry){
needRetry = needRetry?needRetry:true;
var _url = UTF8ToString(url);
var _id = UTF8ToString(id);
var len = lengthBytesUTF8(_id) + 1;
var idPtr = _malloc(len);
stringToUTF8(_id, idPtr, len);
var xhr = new GameGlobal.unityNamespace.UnityLoader.UnityCache.XMLHttpRequest;
xhr.open('GET', _url, true);
xhr.responseType = "arraybuffer";
xhr.onload = function (e) {
if (xhr.status >= 400 && needRetry) {
setTimeout(function () {
_WXGetBundleFromXML(url, false);
}, 1000);
xhr=null;
return false;
}
if (callback) {
var kWebRequestOK = 0;
var kNoResponseBuffer = 1111;
var xhrByteArray = new Uint8Array(xhr.response);
if (xhrByteArray.length != 0) {
var arrayBuffer = xhr.response;
var path = WXFS.url2path(_url);
var numberfd = WXFS.path2fd.get(path);
if (numberfd == undefined) {
numberfd = WXFS.newfd();
WXFS.path2fd.set(path, numberfd);
}
var wxStream = WXFS.fd2wxStream.get(numberfd);
if (wxStream == undefined) {
wxStream = {
fd: numberfd,
path: path,
seekable: true,
position: 0,
stream_ops: MEMFS.stream_ops,
ungotten: [],
node:{mode:32768,usedBytes:xhrByteArray.length},
error: false
};
wxStream.stream_ops.read = WXFS.read;
WXFS.fd2wxStream.set(numberfd, wxStream);
}
WXFS.cache.put(numberfd, arrayBuffer, xhr.isReadFromCache);
WXFS.disk.set(path, xhrByteArray.length);
dynCall("viii", callback, [idPtr, kWebRequestOK, 0]);
if(xhr.isReadFromCache){
_free(idPtr);
}
} else {
dynCall('viii', callback, [idPtr, kNoResponseBuffer, 0]);
_free(idPtr);
}
}
};
xhr.onsave = function xhr_onsave(e){
WXFS.cache.cleanable(WXFS.path2fd.get(e));
_free(idPtr);
}
function XHRHandleError(err, code) {
if (needRetry) {
return setTimeout(function () {
_WXGetBundleFromXML(url, false);
}, 1e3);
}
if (callback) {
var len = lengthBytesUTF8(err) + 1;
var buffer = _malloc(len);
stringToUTF8(err, buffer, len);
dynCall("viii", callback, [idPtr, code, buffer]);
_free(buffer);
_free(idPtr);
}
}
xhr.onerror = function xhr_onerror(e) {
var kWebErrorUnknown = 2;
XHRHandleError("Unknown error.", kWebErrorUnknown);
};
xhr.ontimeout = function xhr_onerror(e) {
var kWebErrorTimeout = 14;
XHRHandleError("Connection timed out.", kWebErrorTimeout);
};
xhr.onabort = function xhr_onerror(e) {
var kWebErrorAborted = 17;
XHRHandleError("Aborted.", kWebErrorAborted);
}
xhr.send();
},
WXGetBundleNumberInMemory: function () {
return WXFS&&WXFS.cache&&WXFS.cache.hash&&WXFS.cache.hash.size;
},
WXGetBundleNumberOnDisk: function () {
return WXFS&&WXFS.disk&&WXFS.disk.hash&&WXFS.disk.hash.size;
},
WXGetBundleSizeInMemory: function () {
return WXFS&&WXFS.cache&&WXFS.cache.size;
},
WXGetBundleSizeOnDisk: function () {
return WXFS&&WXFS.disk&&WXFS.disk.size;
}
};
autoAddDeps(WXAssetBundleLibrary, '$WXFS');
mergeInto(LibraryManager.library, WXAssetBundleLibrary);
@@ -0,0 +1,79 @@
fileFormatVersion: 2
guid: f0312171d672c4253a88f587630cce43
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:
@@ -0,0 +1,43 @@
mergeInto(LibraryManager.library, {
_WXPointer_stringify_adaptor:function(str){
if (typeof UTF8ToString !== "undefined") {
return UTF8ToString(str)
}
return Pointer_stringify(str)
},
DumpUICallback: function (str) {
if(typeof GameGlobal!='undefined'){
GameGlobal.monkeyCallback(_WXPointer_stringify_adaptor(str));
}
},
GetScreenSizeCallback: function(width, height){
if(typeof GameGlobal!='undefined'){
GameGlobal.monkeyCallback([width, height]);
}
},
GetUnityVersionCallback: function(version){
if(typeof GameGlobal!='undefined'){
GameGlobal.monkeyCallback(_WXPointer_stringify_adaptor(version));
}
},
GetUnityFrameRateCallback: function(rate){
if(typeof GameGlobal!='undefined'){
GameGlobal.monkeyCallback(rate)
}
},
GetUnityCacheDetailCallback: function(str) {
if(typeof GameGlobal!='undefined'){
GameGlobal.monkeyCallback(_WXPointer_stringify_adaptor(str));
}
},
SetUnityUIType: function(str){
if(typeof GameGlobal!='undefined'){
GameGlobal.UnityUIType = _WXPointer_stringify_adaptor(str);
}
},
DumpProfileStatsCallback: function(str){
if(typeof GameGlobal!='undefined') {
GameGlobal.monkeyCallback(_WXPointer_stringify_adaptor(str));
}
}
});
@@ -0,0 +1,74 @@
fileFormatVersion: 2
guid: dae845d21bfc9479cbd0cbe4e34ac070
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:
Standalone: Linux64
second:
enabled: 0
settings:
CPU: x86_64
- 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:
@@ -0,0 +1,4 @@
<linker>
<assembly fullname="wx-runtime" preserve="all"/>
<assembly fullname="LitJson" preserve="all"/>
</linker>
@@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: b079ebcdeb0414c9e9e8990e3490fcb6
TextScriptImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,96 @@
fileFormatVersion: 2
guid: 30bbdd4df4b1a43bb83ed8e59cc42c54
PluginImporter:
externalObjects: {}
serializedVersion: 2
iconMap: {}
executionOrder: {}
defineConstraints: []
isPreloaded: 0
isOverridable: 0
isExplicitlyReferenced: 0
validateReferences: 1
platformData:
- first:
: Any
second:
enabled: 0
settings:
Exclude Editor: 0
Exclude Linux: 1
Exclude Linux64: 1
Exclude LinuxUniversal: 1
Exclude OSXUniversal: 1
Exclude WebGL: 1
Exclude Win: 1
Exclude Win64: 1
- first:
Any:
second:
enabled: 0
settings: {}
- first:
Editor: Editor
second:
enabled: 1
settings:
CPU: AnyCPU
DefaultValueInitialized: true
OS: AnyOS
- first:
Facebook: Win
second:
enabled: 0
settings:
CPU: AnyCPU
- first:
Facebook: Win64
second:
enabled: 0
settings:
CPU: AnyCPU
- first:
Standalone: Linux
second:
enabled: 0
settings:
CPU: x86
- first:
Standalone: Linux64
second:
enabled: 0
settings:
CPU: x86_64
- first:
Standalone: LinuxUniversal
second:
enabled: 0
settings:
CPU: None
- first:
Standalone: OSXUniversal
second:
enabled: 0
settings:
CPU: AnyCPU
- first:
Standalone: Win
second:
enabled: 0
settings:
CPU: AnyCPU
- first:
Standalone: Win64
second:
enabled: 0
settings:
CPU: AnyCPU
- first:
Windows Store Apps: WindowsStoreApps
second:
enabled: 0
settings:
CPU: AnyCPU
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,107 @@
fileFormatVersion: 2
guid: 6708da74d31314f7e96085e884d8b693
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 Linux: 1
Exclude Linux64: 1
Exclude LinuxUniversal: 1
Exclude OSXUniversal: 1
Exclude WebGL: 0
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: Win
second:
enabled: 0
settings:
CPU: AnyCPU
- first:
Facebook: Win64
second:
enabled: 0
settings:
CPU: AnyCPU
- first:
Standalone: Linux
second:
enabled: 0
settings:
CPU: x86
- first:
Standalone: Linux64
second:
enabled: 0
settings:
CPU: AnyCPU
- first:
Standalone: LinuxUniversal
second:
enabled: 0
settings:
CPU: None
- first:
Standalone: OSXUniversal
second:
enabled: 0
settings:
CPU: AnyCPU
- first:
Standalone: Win
second:
enabled: 0
settings:
CPU: AnyCPU
- first:
Standalone: Win64
second:
enabled: 0
settings:
CPU: AnyCPU
- first:
WebGL: WebGL
second:
enabled: 1
settings: {}
- first:
WeixinMiniGame: WeixinMiniGame
second:
enabled: 1
settings: {}
- first:
Windows Store Apps: WindowsStoreApps
second:
enabled: 0
settings:
CPU: AnyCPU
userData:
assetBundleName:
assetBundleVariant:
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: ffc57a59a921b41ad99b4dbcda98fbd3
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,919 @@
#if UNITY_WEBGL || WEIXINMINIGAME || UNITY_EDITOR
using System;
using UnityEngine;
namespace WeChatWASM
{
/// <summary>
/// 微信SDK对外暴露的API
/// </summary>
public class WXBase
{
#region env
/// <summary>
/// Gets 微信提供了一个用户文件目录给开发者,开发者对这个目录有完全自由的读写权限。通过 WX.env.USER_DATA_PATH 可以获取到这个目录的路径。
/// </summary>
public static WXEnv env
{
get
{
return WXSDKManagerHandler.Env;
}
}
#endregion
#region cloud
/// <summary>
/// Gets 云函数
/// </summary>
public static Cloud cloud
{
get
{
return WXSDKManagerHandler.cloud;
}
}
#endregion
#region SDK
/// <summary>
/// 初始化SDK
/// </summary>
/// <param name="callback">初始化完毕后回调,请回调后再执行游戏主逻辑</param>
public static void InitSDK(Action<int> callback)
{
WXSDKManagerHandler.Instance.InitSDK(callback);
}
#endregion
#region
/// <summary>
/// 游戏开始运行时上报
/// </summary>
public static void ReportGameStart()
{
WXSDKManagerHandler.Instance.ReportGameStart();
}
/// <summary>
/// 上报游戏自定义场景的错误信息
/// </summary>
/// <param name="sceneId"></param>
/// <param name="errorType">错误类型, 取值范围0-10000</param>
/// <param name="errStr">错误信息</param>
/// <param name="extJsonStr">上报的额外信息,json序列化字符串</param>
public static void ReportGameSceneError(int sceneId, int errorType = 0, string errStr = "", string extJsonStr = "")
{
WXSDKManagerHandler.Instance.ReportGameSceneError(sceneId, errorType, errStr, extJsonStr);
}
/// <summary>
/// 向日志管理器中写log
/// 日志管理器文档:https://developers.weixin.qq.com/minigame/dev/api/base/debug/LogManager.html
/// </summary>
/// <param name="str">log信息</param>
public static void WriteLog(string str)
{
WXSDKManagerHandler.Instance.WriteLog(str);
}
/// <summary>
/// 向日志管理器中写warn
/// 日志管理器文档:https://developers.weixin.qq.com/minigame/dev/api/base/debug/LogManager.html
/// </summary>
/// <param name="str">warn信息</param>
public static void WriteWarn(string str)
{
WXSDKManagerHandler.Instance.WriteWarn(str);
}
public static void HideLoadingPage()
{
WXSDKManagerHandler.Instance.HideLoadingPage();
}
/// <summary>
/// 控制预载并发数
/// </summary>
/// <param name="count">并发数,取值范围[1, 10]</param>
public static void PreloadConcurrent(int count)
{
WXSDKManagerHandler.Instance.PreloadConcurrent(count);
}
/// <summary>
/// 用于分支相关的UI组件(一般是按钮)相关事件的上报,事件目前有曝光、点击两种
/// </summary>
/// <param name="branchId">分支ID,在「小程序管理后台」获取</param>
/// <param name="branchDim">自定义维度</param>
/// <param name="eventType">事件类型,1:曝光; 2:点击</param>
public static void ReportUserBehaviorBranchAnalytics(string branchId, string branchDim, int eventType)
{
WXSDKManagerHandler.Instance.ReportUserBehaviorBranchAnalytics(branchId, branchDim, eventType);
}
#endregion
#region
// 更多关于存储的隔离策略和清理策略说明可以查看这里 https://developers.weixin.qq.com/minigame/dev/guide/base-ability/storage.html
/*
* @description 同步设置int型数据存储,
* @param key 键名
* @param value 数值
*/
public static void StorageSetIntSync(string key, int value)
{
WXSDKManagerHandler.Instance.StorageSetIntSync(key, value);
}
/*
* @description 同步获取之前设置过的int型数据,
* @param key 键名
* @param defaultValue 默认值
* @returns 异常的和空时候会返回默认值
*/
public static int StorageGetIntSync(string key, int defaultValue)
{
return WXSDKManagerHandler.Instance.StorageGetIntSync(key, defaultValue);
}
/*
* @description 同步设置string型数据存储,
* @param key 键名
* @param value 数值
*/
public static void StorageSetStringSync(string key, string value = "")
{
WXSDKManagerHandler.Instance.StorageSetStringSync(key, value);
}
/*
* @description 同步获取之前设置过的string型数据,
* @param key 键名
* @param defaultValue 默认值
* @returns 异常的和空时候会返回默认值
*/
public static string StorageGetStringSync(string key, string defaultValue)
{
return WXSDKManagerHandler.Instance.StorageGetStringSync(key, defaultValue);
}
/*
* @description 同步设置float型数据存储,
* @param key 键名
* @param value 数值
*/
public static void StorageSetFloatSync(string key, float value)
{
WXSDKManagerHandler.Instance.StorageSetFloatSync(key, value);
}
/*
* @description 同步获取之前设置过的float型数据,
* @param key 键名
* @param defaultValue 默认值
* @returns 异常的和空时候会返回默认值
*/
public static float StorageGetFloatSync(string key, float defaultValue)
{
return WXSDKManagerHandler.Instance.StorageGetFloatSync(key, defaultValue);
}
/*
* @description 同步删除所有数据
*/
public static void StorageDeleteAllSync()
{
WXSDKManagerHandler.Instance.StorageDeleteAllSync();
}
/*
* @description 同步删除对应一个key的数据
* @param key 键名
*/
public static void StorageDeleteKeySync(string key)
{
WXSDKManagerHandler.Instance.StorageDeleteKeySync(key);
}
/*
* @description 判断一个key是否有值
* @param key 键名
* @returns true:有,false:没有
*/
public static bool StorageHasKeySync(string key)
{
return WXSDKManagerHandler.Instance.StorageHasKeySync(key);
}
#endregion
#region
/// <summary>
/// 创建用户信息按钮,这里是在屏幕上额外创建一块透明区域,其为点击区域,用户点击后,就会请求用户授权获取用户信息。游戏中的该区域最好为按钮区域,这样就能看起来用户是在点击游戏中的按钮
/// </summary>
/// <param name="x">x 左上角横坐标(以屏幕左上角为0</param>
/// <param name="y">y 左上角纵坐标(以屏幕左上角为0</param>
/// <param name="width">区域宽度</param>
/// <param name="height">区域高度</param>
/// <param name="lang">显示用户信息的语言 可取(en,zh_CN,zh_TW)的一个</param>
/// <param name="withCredentials">是否带上登录态信息。当 withCredentials 为 true 时,要求此前有调用过 wx.login 且登录态尚未过期,此时返回的数据会包含 encryptedData, iv 等敏感信息;当 withCredentials 为 false 时,不要求有登录态,返回的数据不包含 encryptedData, iv 等敏感信息。</param>
/// <returns>返回对象用于后续控制该透明区域的点击,展示和隐藏等行为</returns>
public static WXUserInfoButton CreateUserInfoButton(int x, int y, int width, int height, string lang, bool withCredentials)
{
return WXSDKManagerHandler.Instance.CreateUserInfoButton(x, y, width, height, lang, withCredentials);
}
#endregion
#region
/// <summary>
/// 监听用户点击右上角菜单的「转发」按钮时触发的事件
/// </summary>
/// <param name="defaultParam">默认的设置内容</param>
/// <param name="action">用户点击右上角菜单的「转发」按钮时触发的事件的回调函数,请在回调后三秒内,触发 Action<WXShareAppMessageParam>返回设置的内容,否则会使用 defaultParam</param>
public static void OnShareAppMessage(WXShareAppMessageParam defaultParam, Action<Action<WXShareAppMessageParam>> action = null)
{
WXSDKManagerHandler.Instance.OnShareAppMessage(defaultParam, action);
}
#endregion
#region 广
/// <summary>
/// banner 广告组件。banner 广告组件是一个原生组件,层级比普通组件高。banner 广告组件默认是隐藏的,需要调用 BannerAd.show() 将其显示。banner 广告会根据开发者设置的宽度进行等比缩放,缩放后的尺寸将通过 BannerAd.onResize() 事件中提供。 使用可参考 https://developers.weixin.qq.com/minigame/dev/guide/open-ability/ad/banner-ad.html
/// </summary>
/// <param name="param">param各字段说明详见这里,https://developers.weixin.qq.com/minigame/dev/api/ad/wx.createBannerAd.html </param>
/// <returns>对banner广告做操作的对象,详见 https://developers.weixin.qq.com/minigame/dev/api/ad/BannerAd.html </returns>
/// <example>
/// // 底部banner广告示例
/// var sysInfo = WX.GetSystemInfoSync();
/// var banner = WX.CreateBannerAd(new WXCreateBannerAdParam()
/// {
/// adUnitId = "adunit-2e20328227ca771b",
/// adIntervals = 30,
/// style = new Style()
/// {
/// left = 0,
/// top = sysInfo.windowHeight - 100,
/// width = sysInfo.windowWidth,
/// height = 100
/// }
/// });
/// banner.OnError((WXADErrorResponse res)=>
/// {
/// Debug.Log("bannerad error response");
/// });
/// banner.OnLoad(()=> {
/// banner.Show();
/// });
/// banner.OnResize((WXADResizeResponse res) =>
/// {
/// //拉取的广告可能跟设置的不一样,需要动态调整位置
/// banner.style.top = sysInfo.windowHeight - res.height;
/// });
/// </example>
public static WXBannerAd CreateBannerAd(WXCreateBannerAdParam param)
{
return WXSDKManagerHandler.Instance.CreateBannerAd(param);
}
/// <summary>
/// 这个方法提供一个固定在底部,且固定高度,且水平居中的bannerAd,此方法不需要再手动监听OnResize事件调整位置了
/// </summary>
/// <param name="adUnitId">广告单元 id</param>
/// <param name="adIntervals">广告自动刷新的间隔时间,单位为秒,参数值必须大于等于30(该参数不传入时 Banner 广告不会自动刷新)</param>
/// <param name="height">要固定的高度</param>
/// <returns>对banner广告做操作的对象,详见 https://developers.weixin.qq.com/minigame/dev/api/ad/BannerAd.html </returns>
public static WXBannerAd CreateFixedBottomMiddleBannerAd(string adUnitId, int adIntervals, int height)
{
return WXSDKManagerHandler.Instance.CreateFixedBottomMiddleBannerAd(adUnitId, adIntervals, height);
}
/// <summary>
/// 激励视频广告 详细参见 https://developers.weixin.qq.com/minigame/dev/guide/open-ability/ad/rewarded-video-ad.html
/// </summary>
/// <param name="param"></param>
/// <returns>广告操作对象,https://developers.weixin.qq.com/minigame/dev/api/ad/RewardedVideoAd.html </returns>
public static WXRewardedVideoAd CreateRewardedVideoAd(WXCreateRewardedVideoAdParam param)
{
return WXSDKManagerHandler.Instance.CreateRewardedVideoAd(param);
}
/// <summary>
/// 创建插屏广告组件 详细参见 https://developers.weixin.qq.com/minigame/dev/api/ad/wx.createInterstitialAd.html
/// </summary>
/// <param name="param"></param>
/// <returns>广告操作对象,https://developers.weixin.qq.com/minigame/dev/api/ad/InterstitialAd.html </returns>
public static WXInterstitialAd CreateInterstitialAd(WXCreateInterstitialAdParam param)
{
return WXSDKManagerHandler.Instance.CreateInterstitialAd(param);
}
/// <summary>
/// 创建原生模板广告组件 详细参见 https://developers.weixin.qq.com/minigame/dev/api/ad/wx.createCustomAd.html
/// </summary>
/// <param name="param"></param>
/// <returns>广告操作对象,https://developers.weixin.qq.com/minigame/dev/api/ad/CustomAd.html </returns>
public static WXCustomAd CreateCustomAd(WXCreateCustomAdParam param)
{
return WXSDKManagerHandler.Instance.CreateCustomAd(param);
}
#endregion
#region
/// <summary>
/// [[GameRecorder](https://developers.weixin.qq.com/minigame/dev/api/game-recorder/GameRecorder.html) wx.getGameRecorder()](https://developers.weixin.qq.com/minigame/dev/api/game-recorder/wx.getGameRecorder.html)
///
/// 需要基础库: `2.26.1`
/// 需要客户端: 安卓>=`8.0.28`,目前只支持安卓
/// 获取全局唯一的游戏画面录制对象
/// </summary>
/// <returns></returns>
public static WXGameRecorder GetGameRecorder()
{
return WXSDKManagerHandler.Instance.GetGameRecorder();
}
#endregion
#region
/// <summary>
/// [[WXCamera](https://developers.weixin.qq.com/minigame/dev/api/media/camera/Camera.html) wx.createCamera(Object object)](https://developers.weixin.qq.com/minigame/dev/api/media/camera/wx.createCamera.html)
/// 需要基础库: `2.9.0`
/// 创建相机
/// </summary>
/// <returns></returns>
public static WXCamera CreateCamera(CreateCameraOption param)
{
return WXSDKManagerHandler.Instance.CreateCamera(param);
}
#endregion
#region
/// <summary>
/// [[RecorderManager](https://developers.weixin.qq.com/minigame/dev/api/media/recorder/RecorderManager.html) wx.getRecorderManager()](https://developers.weixin.qq.com/minigame/dev/api/media/recorder/wx.getRecorderManager.html)
/// 需要基础库: `1.6.0`
/// 获取**全局唯一**的录音管理器 RecorderManager
/// </summary>
/// <returns></returns>
public static WXRecorderManager GetRecorderManager()
{
return WXSDKManagerHandler.Instance.GetRecorderManager();
}
#endregion
#region
public static WXChat CreateMiniGameChat(WXChatOptions options = null)
{
return WXSDKManagerHandler.Instance.CreateMiniGameChat(options);
}
#endregion
#region
/// <summary>
/// [[UploadTask](https://developers.weixin.qq.com/minigame/dev/api/network/upload/UploadTask.html) wx.uploadFile(Object object)](https://developers.weixin.qq.com/minigame/dev/api/network/upload/wx.uploadFile.html)
/// 将本地资源上传到服务器。客户端发起一个 HTTPS POST 请求,其中 `content-type` 为 `multipart/form-data`。使用前请注意阅读[相关说明](https://developers.weixin.qq.com/minigame/dev/guide/base-ability/network.html)。
/// **示例代码**
/// ```js
/// wx.chooseImage({
/// success (res) {
/// const tempFilePaths = res.tempFilePaths
/// wx.uploadFile({
/// url: 'https://example.weixin.qq.com/upload', //仅为示例,非真实的接口地址
/// filePath: tempFilePaths[0],
/// name: 'file',
/// formData: {
/// 'user': 'test'
/// },
/// success (res){
/// const data = res.data
/// //do something
/// }
/// })
/// }
/// })
/// ```
/// </summary>
/// <returns></returns>
public static WXUploadTask UploadFile(UploadFileOption option)
{
return WXSDKManagerHandler.Instance.UploadFile(option);
}
#endregion
#region
/// <summary>
/// 获取全局唯一的文件管理器 详见 https://developers.weixin.qq.com/minigame/dev/guide/base-ability/file-system.html
/// </summary>
/// <returns>返回数据详见,https://developers.weixin.qq.com/minigame/dev/api/file/wx.getFileSystemManager.html </returns>
/// <example>
/// // 在本地用户文件目录下创建一个文件 share.jpg,文件名可以自己随便取,写入内容为图片二进制内容 bytes
/// var fs = WX.GetFileSystemManager();
/// fs.WriteFileSync(WX.env.USER_DATA_PATH+"/share.jpg", bytes);
/// </example>
public static WXFileSystemManager GetFileSystemManager()
{
return new WXFileSystemManager();
}
#endregion
#region
/// <summary>
/// 获取开放数据域,关系链相关可以参看 https://developers.weixin.qq.com/minigame/dev/guide/open-ability/open-data.html
/// </summary>
/// <returns>开放数据域对象</returns>
public static WXOpenDataContext GetOpenDataContext()
{
return new WXOpenDataContext();
}
/// <summary>
/// 展示开放数据域
/// </summary>
/// <param name="texture">用来占位的纹理,前端绘制的开放域数据会自动替换这一纹理,因为客户顿纹理映射倒立问题,这一纹理请设置rotationX为180才能正常展示。</param>
/// <param name="x">占位对应屏幕左上角横坐标</param>
/// <param name="y">占位对应屏幕左上角纵坐标,注意左上角为(0,0)</param>
/// <param name="width">占位对应的宽度</param>
/// <param name="height">占位对应的高度</param>
public static void ShowOpenData(Texture texture, int x, int y, int width, int height)
{
WXSDKManagerHandler.Instance.ShowOpenData(texture, x, y, width, height);
}
/// <summary>
/// 关闭开放数据域
/// </summary>
public static void HideOpenData()
{
WXSDKManagerHandler.Instance.HideOpenData();
}
#endregion
#region
/// <summary>
/// InnerAudioContext 实例,可通过 WX.CreateInnerAudioContext 接口获取实例。注意,音频播放过程中,可能被系统中断,可通过 WX.OnAudioInterruptionBegin、WX.OnAudioInterruptionEnd事件来处理这种情况。详见:https://developers.weixin.qq.com/minigame/dev/api/media/audio/InnerAudioContext.html
/// 使用参考文档:https://github.com/wechat-miniprogram/minigame-unity-webgl-transform/blob/main/Design/AudioOptimization.md
/// </summary>
///
/// <returns></returns><example>
// var music = WX.CreateInnerAudioContext(new InnerAudioContextParam() {
// src = "Assets/Audio/Chill_1.wav",
// needDownload = true //表示等下载完之后再播放,便于后续复用,无延迟
// });
// music.OnCanplay(() =>
// {
// Debug.Log("OnCanplay");
// music.Play();
// });
// </example>
public static WXInnerAudioContext CreateInnerAudioContext(InnerAudioContextParam param = null)
{
return WXSDKManagerHandler.Instance.CreateInnerAudioContext(param);
}
/// <summary>
/// 音频为网络请求,可能会有延迟,所以可以先调用这个接口预先下载音频缓存到本地,避免延迟
/// </summary>
/// <param name="pathList">音频的地址数组,如 { "Assets/Audio/0.wav", "Assets/Audio/1.wav" } </param>
/// <param name="action">全部音频下载完成后回调,返回码为0表示下载完成</param>
/// <example>
/// string[] a = { "Assets/Audio/0.wav", "Assets/Audio/1.wav" };
// WX.PreDownloadAudios(a, (code) =>
// {
// Debug.Log("Downloaded" + code);
// if (code == 0)
// {
// var music0 = WX.CreateInnerAudioContext(new InnerAudioContextParam()
// {
// src = "Assets/Audio/0.wav"
// });
// music0.Play();
// var music1 = WX.CreateInnerAudioContext(new InnerAudioContextParam()
// {
// src = "Assets/Audio/1.wav"
// });
// music1.Play();
// }
// });
// </example>
public static void PreDownloadAudios(string[] pathList, Action<int> action)
{
WXSDKManagerHandler.Instance.PreDownloadAudios(pathList, action);
}
#endregion
#region
/// <summary>
/// 创建视频,详见 https://developers.weixin.qq.com/minigame/dev/api/media/video/wx.createVideo.html
/// </summary>
/// <param name="param"></param>
/// <returns></returns>
public static WXVideo CreateVideo(WXCreateVideoParam param)
{
return WXSDKManagerHandler.Instance.CreateVideo(param);
}
#endregion
#region
/// <summary>
/// 获取当前UnityHeap总内存(峰值)
/// </summary>
/// <returns></returns>
public static uint GetTotalMemorySize()
{
return WXSDKManagerHandler.Instance.GetTotalMemorySize();
}
/// <summary>
/// 获取当前UnityHeap Stack大小
/// </summary>
/// <returns></returns>
public static uint GetTotalStackSize()
{
return WXSDKManagerHandler.Instance.GetTotalStackSize();
}
/// <summary>
/// 获取当前UnityHeap静态内存
/// </summary>
/// <returns></returns>
public static uint GetStaticMemorySize()
{
return WXSDKManagerHandler.Instance.GetStaticMemorySize();
}
/// <summary>
/// 获取当前UnityHeap动态内存
/// </summary>
/// <returns></returns>
public static uint GetDynamicMemorySize()
{
return WXSDKManagerHandler.Instance.GetDynamicMemorySize();
}
/// <summary>
/// 获取当前UnityHeap动态内存
/// </summary>
/// <returns></returns>
public static uint GetUsedMemorySize()
{
return WXSDKManagerHandler.Instance.GetUsedMemorySize();
}
/// <summary>
/// 获取当前UnityHeap动态内存
/// </summary>
/// <returns></returns>
public static uint GetUnAllocatedMemorySize()
{
return WXSDKManagerHandler.Instance.GetUnAllocatedMemorySize();
}
/// <summary>
/// 打印UnityHeap内存
/// </summary>
public static void LogUnityHeapMem()
{
WXSDKManagerHandler.Instance.LogUnityHeapMem();
}
#region WXAssetBundle
/// <summary>
/// 获取当前AssetBundle在JS内存中的数量
/// </summary>
/// <returns></returns>
public static uint GetBundleNumberInMemory()
{
return WXSDKManagerHandler.Instance.GetBundleNumberInMemory();
}
/// <summary>
/// 获取当前AssetBundle在磁盘中不可清理的数量
/// </summary>
/// <returns></returns>
public static uint GetBundleNumberOnDisk()
{
return WXSDKManagerHandler.Instance.GetBundleNumberOnDisk();
}
/// <summary>
/// 获取当前AssetBundle在JS内存中的体积
/// </summary>
/// <returns></returns>
public static uint GetBundleSizeInMemory()
{
return WXSDKManagerHandler.Instance.GetBundleSizeInMemory();
}
/// <summary>
/// 获取当前AssetBundle在磁盘中不可清理的体积
/// </summary>
/// <returns></returns>
public static uint GetBundleSizeOnDisk()
{
return WXSDKManagerHandler.Instance.GetBundleSizeOnDisk();
}
#endregion
/// <summary>
/// 打开性能面板
/// </summary>
public static void OpenProfileStats()
{
WXSDKManagerHandler.Instance.OpenProfileStats();
}
/// <summary>
/// ProfilingMemory内存Dump
/// </summary>
public static void ProfilingMemoryDump()
{
WXSDKManagerHandler.Instance.ProfilingMemoryDump();
}
#endregion
#region
/// <summary>
/// 写 debug 日志,同 https://developers.weixin.qq.com/minigame/dev/api/base/debug/LogManager.debug.html
/// </summary>
/// <param name="str"></param>
public static void LogManagerDebug(string str)
{
WXSDKManagerHandler.Instance.LogManagerDebug(str);
}
/// <summary>
/// 写 info 日志,同 https://developers.weixin.qq.com/minigame/dev/api/base/debug/LogManager.info.html
/// </summary>
/// <param name="str"></param>
public static void LogManagerInfo(string str)
{
WXSDKManagerHandler.Instance.LogManagerInfo(str);
}
/// <summary>
/// 写 log 日志,同 https://developers.weixin.qq.com/minigame/dev/api/base/debug/LogManager.log.html
/// </summary>
/// <param name="str"></param>
public static void LogManagerLog(string str)
{
WXSDKManagerHandler.Instance.LogManagerLog(str);
}
/// <summary>
/// 写 warn 日志,同 https://developers.weixin.qq.com/minigame/dev/api/base/debug/LogManager.warn.html
/// </summary>
/// <param name="str"></param>
public static void LogManagerWarn(string str)
{
WXSDKManagerHandler.Instance.LogManagerWarn(str);
}
#endregion
#region
/// <summary>
/// 是否小游戏云测试环境
/// </summary>
/// <returns></returns>
public static bool IsCloudTest()
{
return WXSDKManagerHandler.Instance.IsCloudTest();
}
#endregion
#region
/// <summary>
/// 游戏异常时,使用本接口清理资源缓存
/// </summary>
public static void CleanAllFileCache(Action<bool> action = null)
{
WXSDKManagerHandler.Instance.CleanAllFileCache(action);
}
/// <summary>
/// 当空间不足时,清理指定大小缓存,按文件最近访问时间排序
/// </summary>
/// <param name="fileSize">需要清理的文件大小,单位bytes</param>
public static void CleanFileCache(int fileSize, Action<ReleaseResult> action = null)
{
WXSDKManagerHandler.Instance.CleanFileCache(fileSize, action);
}
/// <summary>
/// 删除指定文件
/// </summary>
/// <param name="path">需要清理的文件路径,支持完整路径,也支持StreamingAssets/filepath格式</param>
public static void RemoveFile(string path, Action<bool> action = null)
{
WXSDKManagerHandler.Instance.RemoveFile(path, action);
}
/// <summary>
/// Gets bundle、纹理等自动缓存的目录
/// </summary>
/// <value>
/// Bundle、纹理等自动缓存的目录
/// </value>
public static string PluginCachePath
{
get
{
return WXSDKManagerHandler.PluginCachePath;
}
}
/// <summary>
/// 获取文件的本地缓存路径,若无缓存,可进行预下载
/// </summary>
/// <param name="url"></param>
/// <returns></returns>
public static string GetCachePath(string url)
{
return WXSDKManagerHandler.Instance.GetCachePath(url);
}
#endregion
/// <summary>
/// 获取启动loader的启动数据
/// </summary>
/// <param name="action"></param>
public static void OnLaunchProgress(Action<LaunchEvent> action = null)
{
WXSDKManagerHandler.Instance.OnLaunchProgress(action);
}
public static void UncaughtException()
{
WXSDKManagerHandler.Instance.UncaughtException();
}
#region
/// <summary>
/// 创建游戏圈按钮,详见 https://developers.weixin.qq.com/minigame/dev/api/open-api/game-club/wx.createGameClubButton.html
/// </summary>
/// <param name="param"></param>
/// <returns></returns>
public static WXGameClubButton CreateGameClubButton(WXCreateGameClubButtonParam param)
{
return WXSDKManagerHandler.Instance.CreateGameClubButton(param);
}
#endregion
#region
/// <summary>
/// [wx.onNeedPrivacyAuthorization(function callback)](https://developers.weixin.qq.com/minigame/dev/api/open-api/privacy/wx.onNeedPrivacyAuthorization.html)
/// 需要基础库: `2.33.0`
/// 该接口将**启用自定义弹窗**,同时对onNeedPrivacyAuthorization事件进行监听,当需要用户授权弹窗时会触发,可以通过调用resolve函数,对授权事件进行上报。
/// **示例代码**
/// ```C#
/// WX.OnNeedPrivacyAuthorization((result) =>
/// {
/// // 开发者弹出自定义的隐私弹窗,并调用告知平台已经弹窗
/// WX.PrivacyAuthorizeResolve(new PrivacyAuthorizeResolveOption()
/// {
/// eventString = "exposureAuthorization"
/// });
/// });
///
/// // 用户通过开发者自定义的界面点击了同意按钮
/// WX.OnTouchEnd((res) => {
/// WX.PrivacyAuthorizeResolve(new PrivacyAuthorizeResolveOption()
/// {
/// eventString = "agree"
/// });
/// });
/// ```
/// </summary>
public static void OnNeedPrivacyAuthorization(Action<string> res)
{
WXSDKManagerHandler.Instance.OnNeedPrivacyAuthorization(res);
}
/// <summary>
/// [wx.onNeedPrivacyAuthorization(function callback)](https://developers.weixin.qq.com/minigame/dev/api/open-api/privacy/wx.onNeedPrivacyAuthorization.html)
/// 由于C#侧无法直接返回JS绑定函数,所以新增一个API专门用于在WX.OnNeedPrivacyAuthorization的回调内调用
/// </summary>
public static void PrivacyAuthorizeResolve(PrivacyAuthorizeResolveOption res)
{
WXSDKManagerHandler.Instance.PrivacyAuthorizeResolve(res);
}
#endregion
#region UDP
public static int CreateUDPSocket(string ip, int remotePort, int bindPort = 0)
{
return WXSDKManagerHandler.Instance.CreateUDPSocket(ip, remotePort, bindPort);
}
public static void CloseUDPSocket(int socketId)
{
WXSDKManagerHandler.Instance.CloseUDPSocket(socketId);
}
public static void SendUDPSocket(int socketId, byte[] buffer, int offset, int length)
{
WXSDKManagerHandler.Instance.SendUDPSocket(socketId, buffer, offset, length);
}
#endregion
#region
public static void SetDataCDN(string path)
{
WXSDKManagerHandler.Instance.SetDataCDN(path);
}
public static void SetPreloadList(string[] paths)
{
WXSDKManagerHandler.Instance.SetPreloadList(paths);
}
#endregion
/// <summary>
/// 获取文件的本地缓存路径,若无缓存,可进行预下载
/// </summary>
/// <param name="fallbackUrl">系统字体不可用时,游戏自己提供的ttf文件地址</param>
/// <param name="callback">字体资源回调</param>
/// <returns></returns>
public static void GetWXFont(string fallbackUrl, Action<Font> callback)
{
WeChatWASM.WXFont.GetFontData(new GetFontParam
{
fallbackUrl = fallbackUrl,
success = (succ) =>
{
var inFontData = succ.binData;
var ascent = succ.ascent;
var descent = succ.descent;
var lineGap = succ.lineGap;
var unitsPerEm = succ.unitsPerEm;
// 未经过充分测试,目前看fontSize不决定最终字体大小,此处只是为了换算lineHeight。如果游戏使用有问题,可以考虑让游戏侧传入字体大小
var fSize = 16;
var abBytes = Unity.FontABTool.UnityFontABTool.PacKFontAB(inFontData, "WXFont", fSize * (Math.Abs(ascent) + Math.Abs(descent) + Math.Abs(lineGap)), fSize, fSize * ascent, fSize * descent);
try
{
var ab = AssetBundle.LoadFromMemory(abBytes);
if (ab != null)
{
Font[] fonts = ab.LoadAllAssets<Font>();
if (fonts.Length != 0)
{
WriteLog($"Load font from ab. abBytes:{abBytes.Length}");
callback.Invoke(fonts[0]);
}
else
{
WriteWarn($"LoadAllAssets failed, abBytes:{abBytes.Length}, fonts: {fonts.Length}");
callback.Invoke(null);
}
ab.Unload(false);
}
else
{
WriteWarn($"LoadFromMemory failed, Length: {abBytes.Length}");
callback.Invoke(null);
}
}
catch (Exception ex)
{
WriteWarn($"GetWXFont Exception, ex:{ex.ToString()}");
callback.Invoke(null);
}
},
fail = (fail) =>
{
WriteWarn($"GetFontData fail {fail.errMsg}");
callback.Invoke(null);
},
});
}
}
}
#endif
@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 53b47b93caed9426d81c354bb916a04b
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,351 @@
using System.Runtime.InteropServices;
using System.Text;
using Unity.Profiling;
using LitJson;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Profiling;
#if UNITY_WEBGL
using WeChatWASM;
#endif
#if UNITY_WEBGL || WEIXINMINIGAME || UNITY_EDITOR
public class WXProfileStatsScript : MonoBehaviour, WeChatWASM.WXSDKManagerHandler.WXProfileStatsScript
{
private string statsText;
#if UNITY_2021_2_OR_NEWER
// private ProfilerRecorder m_totalUsedMemoryRecorder;
// private ProfilerRecorder m_totalReservedMemoryRecorder;
// private ProfilerRecorder m_gcUsedMemoryRecorder;
// private ProfilerRecorder m_gcReservedMemoryRecorder;
// private ProfilerRecorder m_gfxUsedMemoryRecorder;
// private ProfilerRecorder m_gfxReservedMemoryRecorder;
// private ProfilerRecorder m_systemUsedMemoryRecorder;
// private ProfilerRecorder m_textureCountRecorder;
// private ProfilerRecorder m_textureMemoryRecorder;
// private ProfilerRecorder m_meshCountRecorder;
// private ProfilerRecorder m_meshMemoryRecorder;
// private ProfilerRecorder m_materialCountRecorder;
// private ProfilerRecorder m_materialMemoryRecorder;
// private ProfilerRecorder m_animationClipCountRecorder;
// private ProfilerRecorder m_animationClipMemoryRecorder;
// private ProfilerRecorder m_assetCountRecorder;
// private ProfilerRecorder m_gameObjectsInScenesRecorder;
// private ProfilerRecorder m_totalObjectsInScenesRecorder;
// private ProfilerRecorder m_totalUnityObjectCountRecorder;
// private ProfilerRecorder m_gcAllocationInFrameCountRecorder;
// private ProfilerRecorder m_gcAllocatedInFrameRecorder;
private ProfilerRecorder m_setPassCallsRecorder; //切换用于渲染游戏对象的着色器通道的次数
private ProfilerRecorder m_drawCallsRecorder; //绘制调用总数
private ProfilerRecorder m_verticesRecorder; //顶点数
private ProfilerRecorder m_triangleRecorder; //三角形数
private ProfilerRecorder m_renderTexturesCount;
private ProfilerRecorder m_RenderTexturesBytes;
private ProfilerRecorder m_BatchesCount;
private ProfilerRecorder m_ShadowCastersCount;
private ProfilerRecorder m_VisibleSkinnedMeshesCount;
private ProfilerRecorder m_RenderTexturesChangesCount;
private ProfilerRecorder m_UsedBuffersCount;
private ProfilerRecorder m_UsedBuffersBytes;
private ProfilerRecorder m_VertexBufferUploadInFrameCount;
private ProfilerRecorder m_VertexBufferUploadInFrameBytes;
private ProfilerRecorder m_IndexBufferUploadInFrameCount;
private ProfilerRecorder m_IndexBufferUploadInFrameBytes;
#endif
private int m_fpsCount;
private float m_fpsDeltaTime;
private int fps;
private GUIStyle m_bgStyle;
private bool m_isShow = true;
private System.Collections.Generic.Dictionary<string, ProfValue> profValues = new System.Collections.Generic.Dictionary<string, ProfValue>();
public void Awake()
{
m_bgStyle = new GUIStyle();
m_bgStyle.normal.background = Texture2D.whiteTexture;
}
public void OnEnable()
{
#if UNITY_2021_2_OR_NEWER
// m_totalUsedMemoryRecorder = ProfilerRecorder.StartNew(ProfilerCategory.Memory, "Total Used Memory");
// m_totalReservedMemoryRecorder = ProfilerRecorder.StartNew(ProfilerCategory.Memory, "Total Reserved Memory");
// m_gcUsedMemoryRecorder = ProfilerRecorder.StartNew(ProfilerCategory.Memory, "GC Used Memory");
// m_gcReservedMemoryRecorder = ProfilerRecorder.StartNew(ProfilerCategory.Memory, "GC Reserved Memory");
// m_gfxUsedMemoryRecorder = ProfilerRecorder.StartNew(ProfilerCategory.Memory, "Gfx Used Memory");
// m_gfxReservedMemoryRecorder = ProfilerRecorder.StartNew(ProfilerCategory.Memory, "Gfx Reserved Memory");
// m_systemUsedMemoryRecorder = ProfilerRecorder.StartNew(ProfilerCategory.Memory, "System Used Memory");
// m_textureCountRecorder = ProfilerRecorder.StartNew(ProfilerCategory.Memory, "Texture Count");
// m_textureMemoryRecorder = ProfilerRecorder.StartNew(ProfilerCategory.Memory, "Texture Memory");
// m_meshCountRecorder = ProfilerRecorder.StartNew(ProfilerCategory.Memory, "Mesh Count");
// m_meshMemoryRecorder = ProfilerRecorder.StartNew(ProfilerCategory.Memory, "Mesh Memory");
// m_materialCountRecorder = ProfilerRecorder.StartNew(ProfilerCategory.Memory, "Material Count");
// m_materialMemoryRecorder = ProfilerRecorder.StartNew(ProfilerCategory.Memory, "Material Memory");
// m_animationClipCountRecorder = ProfilerRecorder.StartNew(ProfilerCategory.Memory, "AnimationClip Count");
// m_animationClipMemoryRecorder = ProfilerRecorder.StartNew(ProfilerCategory.Memory, "AnimationClip Memory");
// m_assetCountRecorder = ProfilerRecorder.StartNew(ProfilerCategory.Memory, "Asset Count");
// m_gameObjectsInScenesRecorder = ProfilerRecorder.StartNew(ProfilerCategory.Memory, "GameObject Count");
// m_totalObjectsInScenesRecorder = ProfilerRecorder.StartNew(ProfilerCategory.Memory, "Scene Object Count");
// m_totalUnityObjectCountRecorder = ProfilerRecorder.StartNew(ProfilerCategory.Memory, "Object Count");
// m_gcAllocationInFrameCountRecorder = ProfilerRecorder.StartNew(ProfilerCategory.Memory, "GC Allocation In Frame Count");
// m_gcAllocatedInFrameRecorder = ProfilerRecorder.StartNew(ProfilerCategory.Memory, "GC Allocated In Frame");
m_setPassCallsRecorder = ProfilerRecorder.StartNew(ProfilerCategory.Render, "SetPass Calls Count");
m_drawCallsRecorder = ProfilerRecorder.StartNew(ProfilerCategory.Render, "Draw Calls Count");
m_verticesRecorder = ProfilerRecorder.StartNew(ProfilerCategory.Render, "Vertices Count");
if (WeChatWASM.WXSDKManagerHandler.Instance.IsCloudTest())
{
m_triangleRecorder = ProfilerRecorder.StartNew(ProfilerCategory.Render, "Triangles Count");
m_renderTexturesCount = ProfilerRecorder.StartNew(ProfilerCategory.Render, "Render Textures Count");
m_RenderTexturesBytes = ProfilerRecorder.StartNew(ProfilerCategory.Render,"Render Textures Bytes");
m_BatchesCount = ProfilerRecorder.StartNew(ProfilerCategory.Render, "Batches Count");
m_ShadowCastersCount = ProfilerRecorder.StartNew(ProfilerCategory.Render, "Shadow Casters Count");
m_VisibleSkinnedMeshesCount = ProfilerRecorder.StartNew(ProfilerCategory.Render, "Visible Skinned Meshes Count");
m_RenderTexturesChangesCount = ProfilerRecorder.StartNew(ProfilerCategory.Render, "Render Textures Changes Count");
m_UsedBuffersCount = ProfilerRecorder.StartNew(ProfilerCategory.Render, "Used Buffers Count");
m_UsedBuffersBytes = ProfilerRecorder.StartNew(ProfilerCategory.Render, "Used Buffers Bytes");
m_VertexBufferUploadInFrameCount = ProfilerRecorder.StartNew(ProfilerCategory.Render, "Vertex Buffer Upload In Frame Count");
m_VertexBufferUploadInFrameBytes = ProfilerRecorder.StartNew(ProfilerCategory.Render, "Vertex Buffer Upload In Frame Bytes");
m_IndexBufferUploadInFrameCount = ProfilerRecorder.StartNew(ProfilerCategory.Render, "Index Buffer Upload In Frame Count");
m_IndexBufferUploadInFrameBytes = ProfilerRecorder.StartNew(ProfilerCategory.Render, "Index Buffer Upload In Frame Bytes");
}
#endif
}
public void OnDisable()
{
#if UNITY_2021_2_OR_NEWER
// m_totalUsedMemoryRecorder.Dispose();
// m_totalReservedMemoryRecorder.Dispose();
// m_gcUsedMemoryRecorder.Dispose();
// m_gcReservedMemoryRecorder.Dispose();
// m_gfxUsedMemoryRecorder.Dispose();
// m_gfxReservedMemoryRecorder.Dispose();
// m_systemUsedMemoryRecorder.Dispose();
// m_textureCountRecorder.Dispose();
// m_textureMemoryRecorder.Dispose();
// m_meshCountRecorder.Dispose();
// m_meshMemoryRecorder.Dispose();
// m_materialCountRecorder.Dispose();
// m_materialMemoryRecorder.Dispose();
// m_animationClipCountRecorder.Dispose();
// m_animationClipMemoryRecorder.Dispose();
// m_assetCountRecorder.Dispose();
// m_gameObjectsInScenesRecorder.Dispose();
// m_totalObjectsInScenesRecorder.Dispose();
// m_totalUnityObjectCountRecorder.Dispose();
// m_gcAllocationInFrameCountRecorder.Dispose();
// m_gcAllocatedInFrameRecorder.Dispose();
m_setPassCallsRecorder.Dispose();
m_drawCallsRecorder.Dispose();
m_verticesRecorder.Dispose();
if (WeChatWASM.WXSDKManagerHandler.Instance.IsCloudTest())
{
m_triangleRecorder.Dispose();
m_renderTexturesCount.Dispose();
m_RenderTexturesBytes.Dispose();
m_BatchesCount.Dispose();
m_ShadowCastersCount.Dispose();
m_VisibleSkinnedMeshesCount.Dispose();
m_RenderTexturesChangesCount.Dispose();
m_UsedBuffersCount.Dispose();
m_UsedBuffersBytes.Dispose();
m_VertexBufferUploadInFrameCount.Dispose();
m_VertexBufferUploadInFrameBytes.Dispose();
m_IndexBufferUploadInFrameCount.Dispose();
m_IndexBufferUploadInFrameBytes.Dispose();
}
#endif
}
public class ProfValue
{
public float current;
public float max = 0;
public float min = 9999;
// public int avrage;
}
public ProfValue UpdateValue(string key, float value, StringBuilder sb, string format = "0")
{
ProfValue profValue = null;
if (!profValues.TryGetValue(key, out profValue))
{
profValue = new ProfValue();
profValues.Add(key, profValue);
}
profValue.current = value;
profValue.max = value > profValue.max ? value : profValue.max;
profValue.min = value < profValue.min ? value : profValue.min;
sb.AppendLine($"{key}:[{profValue.current.ToString(format)}, {profValue.min.ToString(format)}, {profValue.max.ToString(format)}]");
return profValue;
}
public void Update()
{
UpdateFps();
const uint toMB = 1024 * 1024;
var sb = new StringBuilder(500);
sb.AppendLine($"-------------FPS---------------");
// var key = "targetFrameRate";
UpdateValue("TargetFramerate", Application.targetFrameRate, sb);
UpdateValue("FPS", fps, sb);
UpdateValue("FrameTime(ms)", WeChatWASM.WXSDKManagerHandler.Instance.GetEXFrameTime(), sb, "0.00");
sb.AppendLine($"-------------Profiler------------");
UpdateValue("MonoHeapReserved", Profiler.GetMonoHeapSizeLong() / toMB, sb);
UpdateValue("MonoHeapUsed", Profiler.GetMonoUsedSizeLong() / toMB, sb);
// UpdateValue("Graphics", Profiler.GetAllocatedMemoryForGraphicsDriver() / toMB, sb);
// UpdateValue("TempAllocator", Profiler.GetTempAllocatorSize() / toMB, sb);
UpdateValue("NativeReserved", Profiler.GetTotalReservedMemoryLong() / toMB, sb);
UpdateValue("NativeUnused", Profiler.GetTotalUnusedReservedMemoryLong() / toMB, sb);
UpdateValue("NativeAllocated", Profiler.GetTotalAllocatedMemoryLong() / toMB, sb);
#if UNITY_2021_2_OR_NEWER
sb.AppendLine("-------------Render------------");
UpdateValue("SetPass Calls", m_setPassCallsRecorder.LastValue, sb);
UpdateValue("Draw Calls", m_drawCallsRecorder.LastValue, sb);
UpdateValue("Vertices", m_verticesRecorder.LastValue, sb);
#endif
sb.AppendLine("-------------WebAssembly----------");
UpdateValue("TotalHeapMemory", WeChatWASM.WXSDKManagerHandler.Instance.GetTotalMemorySize() / toMB, sb);
UpdateValue("DynamicMemory", WeChatWASM.WXSDKManagerHandler.Instance.GetDynamicMemorySize() / toMB, sb);
UpdateValue("UsedHeap(ProfilingMemory only)", WeChatWASM.WXSDKManagerHandler.Instance.GetUsedMemorySize() / toMB, sb);
UpdateValue("UnAllocatedMemory", WeChatWASM.WXSDKManagerHandler.Instance.GetUnAllocatedMemorySize() / toMB, sb);
sb.AppendLine("-------------AssetBundle----------");
UpdateValue("NumberInMemory", WeChatWASM.WXSDKManagerHandler.Instance.GetBundleNumberInMemory(), sb);
UpdateValue("NumberOnDisk", WeChatWASM.WXSDKManagerHandler.Instance.GetBundleNumberOnDisk(), sb);
UpdateValue("SizeInMemory", WeChatWASM.WXSDKManagerHandler.Instance.GetBundleSizeInMemory() / toMB, sb);
UpdateValue("SizeOnDisk", WeChatWASM.WXSDKManagerHandler.Instance.GetBundleSizeOnDisk() / toMB, sb);
#if UNITY_2021_2_OR_NEWER
// sb.AppendLine("-------------MemoryRecorder-----");
// UpdateValue("Total Used Memory", m_totalUsedMemoryRecorder.LastValue / toMB, sb);
// UpdateValue("Total Reserved Memory", m_totalReservedMemoryRecorder.LastValue / toMB, sb);
// UpdateValue("GC Used Memory", m_gcUsedMemoryRecorder.LastValue / toMB, sb);
// UpdateValue("GC Reserved Memory", m_gcReservedMemoryRecorder.LastValue / toMB, sb);
// UpdateValue("Gfx Used Memory", m_gfxUsedMemoryRecorder.LastValue / toMB, sb);
// UpdateValue("Gfx Reserved Memory", m_gfxReservedMemoryRecorder.LastValue / toMB, sb);
// UpdateValue("System Used Memory", m_systemUsedMemoryRecorder.LastValue / toMB, sb);
// UpdateValue("Texture Count", m_textureCountRecorder.LastValue, sb);
// UpdateValue("Texture Memory", m_textureMemoryRecorder.LastValue / toMB, sb);
// UpdateValue("Mesh Count", m_meshCountRecorder.LastValue, sb);
// UpdateValue("Mesh Memory", m_meshMemoryRecorder.LastValue / toMB, sb);
// UpdateValue("Material Count", m_materialCountRecorder.LastValue, sb);
// UpdateValue("Material Memory", m_materialMemoryRecorder.LastValue / toMB, sb);
// UpdateValue("AnimationClip Count", m_animationClipCountRecorder.LastValue, sb);
// UpdateValue("AnimationClip Memory", m_animationClipMemoryRecorder.LastValue / toMB, sb);
// UpdateValue("Asset Count", m_assetCountRecorder.LastValue, sb);
// UpdateValue("GameObject Count", m_gameObjectsInScenesRecorder.LastValue, sb);
// UpdateValue("Scene Object Count", m_totalObjectsInScenesRecorder.LastValue, sb);
// UpdateValue("Object Count", m_totalUnityObjectCountRecorder.LastValue, sb);
// UpdateValue("GC Allocation In Frame Count", m_gcAllocationInFrameCountRecorder.LastValue, sb);
// UpdateValue("GC Allocated In Frame", m_gcAllocatedInFrameRecorder.LastValue / toMB, sb);
#endif
statsText = sb.ToString();
}
public void UpdateFps()
{
m_fpsCount++;
m_fpsDeltaTime += Time.deltaTime;
if (m_fpsCount % 60 == 0)
{
m_fpsCount = 1;
fps = (int)Mathf.Ceil(60.0f / m_fpsDeltaTime);
m_fpsDeltaTime = 0;
}
}
public void OnGUI()
{
// 云测环境不展示profile stats的界面
if(!WeChatWASM.WXSDKManagerHandler.Instance.IsCloudTest()) {
GUI.backgroundColor = new Color(0, 0, 0, 0.5f);
#if UNITY_EDITOR
GUI.skin.button.fontSize = 10;
GUI.skin.label.fontSize = 10;
#else
GUI.skin.button.fontSize = 30;
GUI.skin.label.fontSize = 30;
#endif
if (GUILayout.Button("Performence Stats", GUILayout.ExpandWidth(false)))
{
m_isShow = !m_isShow;
}
if (GUILayout.Button("ProfilingMemory Dump", GUILayout.ExpandWidth(false)))
{
WeChatWASM.WXSDKManagerHandler.Instance.ProfilingMemoryDump();
}
GUILayout.BeginVertical(m_bgStyle);
if (m_isShow)
{
GUILayout.Label(statsText);
}
GUILayout.EndVertical();
}
}
[RuntimeInitializeOnLoadMethod(RuntimeInitializeLoadType.BeforeSceneLoad)]
private static void OnGameLaunch()
{
WeChatWASM.WXSDKManagerHandler.SetProfileStatsScript(typeof(WXProfileStatsScript));
}
public string GetProfileStatsDatas()
{
const uint toMB = 1024 * 1024;
Dictionary<string, long> _profileDatasDic = new Dictionary<string, long>();
_profileDatasDic.Add("MonoHeapReserved", Profiler.GetMonoHeapSizeLong() / toMB);
_profileDatasDic.Add("MonoHeapUsed", Profiler.GetMonoUsedSizeLong() / toMB);
_profileDatasDic.Add("NativeReserved", Profiler.GetTotalReservedMemoryLong() / toMB);
_profileDatasDic.Add("NativeUnused", Profiler.GetTotalUnusedReservedMemoryLong() / toMB);
_profileDatasDic.Add("NativeAllocated", Profiler.GetTotalAllocatedMemoryLong() / toMB);
#if UNITY_2021_2_OR_NEWER
_profileDatasDic.Add("SetPassCalls", m_setPassCallsRecorder.LastValue);
_profileDatasDic.Add("DrawCalls", m_drawCallsRecorder.LastValue);
_profileDatasDic.Add("Vertices", m_verticesRecorder.LastValue);
if (WeChatWASM.WXSDKManagerHandler.Instance.IsCloudTest())
{
_profileDatasDic.Add("Triangles", m_triangleRecorder.LastValue);
_profileDatasDic.Add("renderTexturesCount", m_renderTexturesCount.LastValue);
_profileDatasDic.Add("RenderTexturesBytes", m_RenderTexturesBytes.LastValue);
_profileDatasDic.Add("BatchesCount", m_BatchesCount.LastValue);
_profileDatasDic.Add("ShadowCastersCount", m_ShadowCastersCount.LastValue);
_profileDatasDic.Add("VisibleSkinnedMeshesCount", m_VisibleSkinnedMeshesCount.LastValue);
_profileDatasDic.Add("RenderTexturesChangesCount", m_RenderTexturesChangesCount.LastValue);
_profileDatasDic.Add("UsedBuffersCount", m_UsedBuffersCount.LastValue);
_profileDatasDic.Add("UsedBuffersBytes", m_UsedBuffersBytes.LastValue);
_profileDatasDic.Add("VertexBufferUploadInFrameCount", m_VertexBufferUploadInFrameCount.LastValue);
_profileDatasDic.Add("VertexBufferUploadInFrameBytes", m_VertexBufferUploadInFrameBytes.LastValue);
_profileDatasDic.Add("IndexBufferUploadInFrameCount", m_IndexBufferUploadInFrameCount.LastValue);
_profileDatasDic.Add("IndexBufferUploadInFrameBytes", m_IndexBufferUploadInFrameBytes.LastValue);
}
#endif
return JsonMapper.ToJson(_profileDatasDic);;
}
}
#endif
@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 3dab97d40676842bc81d76ab4ff5cfd7
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,268 @@
#if UNITY_WEBGL || WEIXINMINIGAME || UNITY_EDITOR
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.EventSystems;
using UnityEngine.Events;
using UnityEngine.UI;
using WeChatWASM;
using Touch = UnityEngine.Touch;
internal class TouchData
{
public Touch touch;
public long timeStamp;
}
/**
* 由于Unity WebGL发布的多点触控存在问题, 导致在微信中多点触控存在粘连的情况
* 所以需要使用WX的触控接口重新覆盖Unity的BaseInput关于触控方面的接口
* 通过设置StandaloneInputModule.inputOverride的方式来实现
*/
[RequireComponent(typeof(StandaloneInputModule))]
public class WXTouchInputOverride : BaseInput
{
private bool _isInitWechatSDK;
private readonly List<TouchData> _touches = new List<TouchData>();
private StandaloneInputModule _standaloneInputModule = null;
protected override void Awake()
{
base.Awake();
_standaloneInputModule = GetComponent<StandaloneInputModule>();
}
protected override void OnEnable()
{
base.OnEnable();
if (string.IsNullOrEmpty(WeChatWASM.WX.GetSystemInfoSync().platform)) return;
InitWechatTouchEvents();
if (_standaloneInputModule)
{
_standaloneInputModule.inputOverride = this;
}
}
protected override void OnDisable()
{
base.OnDisable();
UnregisterWechatTouchEvents();
if (_standaloneInputModule)
{
_standaloneInputModule.inputOverride = null;
}
}
private void InitWechatTouchEvents()
{
if (!_isInitWechatSDK)
{
WX.InitSDK((code) =>
{
_isInitWechatSDK = true;
RegisterWechatTouchEvents();
});
}
else
{
RegisterWechatTouchEvents();
}
}
private void RegisterWechatTouchEvents()
{
WX.OnTouchStart(OnWxTouchStart);
WX.OnTouchMove(OnWxTouchMove);
WX.OnTouchEnd(OnWxTouchEnd);
WX.OnTouchCancel(OnWxTouchCancel);
}
private void UnregisterWechatTouchEvents()
{
WX.OffTouchStart(OnWxTouchStart);
WX.OffTouchMove(OnWxTouchMove);
WX.OffTouchEnd(OnWxTouchEnd);
WX.OffTouchCancel(OnWxTouchCancel);
}
private void OnWxTouchStart(OnTouchStartListenerResult touchEvent)
{
foreach (var wxTouch in touchEvent.changedTouches)
{
var data = FindOrCreateTouchData(wxTouch.identifier);
data.touch.phase = TouchPhase.Began;
data.touch.position = new Vector2(wxTouch.clientX, wxTouch.clientY);
data.touch.rawPosition = data.touch.position;
data.timeStamp = touchEvent.timeStamp;
// Debug.Log($"OnWxTouchStart:{wxTouch.identifier}, {data.touch.phase}");
}
}
private void OnWxTouchMove(OnTouchStartListenerResult touchEvent)
{
foreach (var wxTouch in touchEvent.changedTouches)
{
var data = FindOrCreateTouchData(wxTouch.identifier);
UpdateTouchData(data, new Vector2(wxTouch.clientX, wxTouch.clientY), touchEvent.timeStamp, TouchPhase.Moved);
}
}
private void OnWxTouchEnd(OnTouchStartListenerResult touchEvent)
{
foreach (var wxTouch in touchEvent.changedTouches)
{
TouchData data = FindTouchData(wxTouch.identifier);
if (data == null)
{
Debug.LogError($"OnWxTouchEnd, error identifier:{wxTouch.identifier}");
return;
}
if (data.touch.phase == TouchPhase.Canceled || data.touch.phase == TouchPhase.Ended)
{
Debug.LogWarning($"OnWxTouchEnd, error phase:{wxTouch.identifier}, phase:{data.touch.phase}");
}
// Debug.Log($"OnWxTouchEnd:{wxTouch.identifier}");
UpdateTouchData(data, new Vector2(wxTouch.clientX, wxTouch.clientY), touchEvent.timeStamp, TouchPhase.Ended);
}
GameObject selectedObject = EventSystem.current.currentSelectedGameObject;
if (selectedObject != null)
{
Button button = selectedObject.GetComponent<Button>();
if (button != null)
{
int clickListenerCount = button.onClick.GetPersistentEventCount();
if (clickListenerCount > 0) {
button.onClick.SetPersistentListenerState(0, UnityEventCallState.EditorAndRuntime);
button.onClick.Invoke();
button.onClick.SetPersistentListenerState(0, UnityEventCallState.Off);
}
}
}
}
private void OnWxTouchCancel(OnTouchStartListenerResult touchEvent)
{
foreach (var wxTouch in touchEvent.changedTouches)
{
TouchData data = FindTouchData(wxTouch.identifier);
if (data == null)
{
Debug.LogError($"OnWxTouchCancel, error identifier:{wxTouch.identifier}");
return;
}
if (data.touch.phase == TouchPhase.Canceled || data.touch.phase == TouchPhase.Ended)
{
Debug.LogWarning($"OnWxTouchCancel, error phase:{wxTouch.identifier}, phase:{data.touch.phase}");
}
// Debug.Log($"OnWxTouchCancel:{wxTouch.identifier}");
UpdateTouchData(data, new Vector2(wxTouch.clientX, wxTouch.clientY), touchEvent.timeStamp, TouchPhase.Canceled);
}
}
private void LateUpdate()
{
foreach (var t in _touches)
{
if (t.touch.phase == TouchPhase.Began)
{
t.touch.phase = TouchPhase.Stationary;
}
}
RemoveEndedTouches();
}
private void RemoveEndedTouches()
{
if (_touches.Count > 0)
{
_touches.RemoveAll(touchData =>
{
var touch = touchData.touch;
return touch.phase == TouchPhase.Ended || touch.phase == TouchPhase.Canceled;
});
}
}
private TouchData FindTouchData(int identifier)
{
foreach (var touchData in _touches)
{
var touch = touchData.touch;
if (touch.fingerId == identifier)
{
return touchData;
}
}
return null;
}
private TouchData FindOrCreateTouchData(int identifier)
{
var touchData = FindTouchData(identifier);
if (touchData != null)
{
return touchData;
}
var data = new TouchData();
data.touch.pressure = 1.0f;
data.touch.maximumPossiblePressure = 1.0f;
data.touch.type = TouchType.Direct;
data.touch.tapCount = 1;
data.touch.fingerId = identifier;
data.touch.radius = 0;
data.touch.radiusVariance = 0;
data.touch.altitudeAngle = 0;
data.touch.azimuthAngle = 0;
data.touch.deltaTime = 0;
_touches.Add(data);
return data;
}
private static void UpdateTouchData(TouchData data, Vector2 pos, long timeStamp, TouchPhase phase)
{
data.touch.phase = phase;
data.touch.deltaPosition = pos - data.touch.position;
data.touch.position = pos;
data.touch.deltaTime = (timeStamp - data.timeStamp) / 1000000.0f;
}
#if !UNITY_EDITOR
public override bool touchSupported
{
get
{
return true;
}
}
public override bool mousePresent
{
get
{
return false;
}
}
public override int touchCount
{
get { return _touches.Count; }
}
public override Touch GetTouch(int index)
{
// Debug.LogError($"GetTouch touchCount:{touchCount}, index:{index}, touch:{_touches[index].touch.fingerId}, {_touches[index].touch.phase}");
return _touches[index].touch;
}
#endif
}
#endif
@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 701e11c62dd2c4c808cc684685c3362b
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,16 @@
{
"name": "Wx",
"rootNamespace": "",
"references": [
"GUID:39e0a8d734341a748a11d45f50641371"
],
"includePlatforms": [],
"excludePlatforms": [],
"allowUnsafeCode": false,
"overrideReferences": false,
"precompiledReferences": [],
"autoReferenced": true,
"defineConstraints": [],
"versionDefines": [],
"noEngineReferences": false
}
@@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 5efd170ecd8084500bed5692932fe14e
AssemblyDefinitionImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 0f52ec1153ff8c44a98247c30af9f89a
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,140 @@
/* eslint-disable no-multi-assign */
/* eslint-disable @typescript-eslint/naming-convention */
const { version, SDKVersion, platform, system } = wx.getSystemInfoSync();
const accountInfo = wx.getAccountInfoSync();
const envVersion = accountInfo?.miniProgram?.envVersion;
function compareVersion(v1, v2) {
if (!v1 || !v2) {
return false;
}
return (v1
.split('.')
.map(v => v.padStart(2, '0'))
.join('')
>= v2
.split('.')
.map(v => v.padStart(2, '0'))
.join(''));
}
export const isPc = platform === 'windows' || platform === 'mac';
export const isIOS = platform === 'ios';
export const isAndroid = platform === 'android';
export const isDevtools = platform === 'devtools';
export const isMobile = !isPc && !isDevtools;
export const isDevelop = envVersion === 'develop';
// 是否禁止**开通了高性能模式**的小游戏在不支持的iOS设备上回退成普通模式,回退可能导致无法正常体验游戏
// @ts-ignore
const disableHighPerformanceFallback = $DISABLE_HIGHPERFORMANCE_FALLBACK && isIOS;
// 是否iOS高性能模式
export const isH5Renderer = GameGlobal.isIOSHighPerformanceMode;
// 操作系统版本号
const systemVersionArr = system ? system.split(' ') : [];
const systemVersion = systemVersionArr.length ? systemVersionArr[systemVersionArr.length - 1] : '';
// pc微信版本号不一致,需要>=3.3
const isPcWeChatVersionValid = compareVersion(version, '3.3');
// 支持unity小游戏,需要基础库>=2.14.0,但低版本基础库iOS存在诸多问题,将版本最低版本提高到2.17.0
const isLibVersionValid = compareVersion(SDKVersion, '2.17.0');
// 如果是iOS高性能模式,基础库需要>=2.23.1
const isH5LibVersionValid = compareVersion(SDKVersion, '2.23.1');
// 压缩纹理需要iOS系统版本>=14.0,检测到不支持压缩纹理时会提示升级系统
const isIOSH5SystemVersionValid = compareVersion(systemVersion, '14.0');
// iOS系统版本>=15支持webgl2
const isIOSWebgl2SystemVersionValid = compareVersion(systemVersion, '15.0');
// 是否用了webgl2
const isWebgl2 = () => GameGlobal.managerConfig.contextConfig.contextType === 2;
// 是否支持BufferURL
export const isSupportBufferURL = !isPc
&& (isH5Renderer
? compareVersion(SDKVersion, '2.29.1') && compareVersion(version, '8.0.30')
: typeof wx.createBufferURL === 'function');
// 安卓innerAudio支持playbackRate
export const isSupportPlayBackRate = !isAndroid || compareVersion(version, '8.0.23');
// IOS innerAudio支持复用时再次触发onCanplay
export const isSupportCacheAudio = !isIOS || compareVersion(version, '8.0.31');
// // 安卓旧客户端版本innerAudio偶现会导致闪退,大于等于8.0.38才使用innerAudio减少内存
export const isSupportInnerAudio = compareVersion(version, '8.0.38');
// 检查是否支持brotli压缩,pc基础库>=2.29.2,真机基础库>=2.21.1
// @ts-ignore
const isPcBrotliInvalid = isPc && !compareVersion(SDKVersion, $LOAD_DATA_FROM_SUBPACKAGE ? '2.29.2' : '2.32.3');
const isMobileBrotliInvalid = isMobile && !compareVersion(SDKVersion, '2.21.1');
// @ts-ignore
const isBrotliInvalid = $COMPRESS_DATA_PACKAGE && (isPcBrotliInvalid || isMobileBrotliInvalid);
// 是否能以iOS高性能模式运行
// 请勿修改GameGlobal.canUseH5Renderer赋值!!!
GameGlobal.canUseH5Renderer = isH5Renderer && isH5LibVersionValid;
// iOS高性能模式定期GC
GameGlobal.canUseiOSAutoGC = isH5Renderer && compareVersion(SDKVersion, '2.32.1');
// pc微信版本不满足要求
const isPcInvalid = isPc && !isPcWeChatVersionValid;
// 移动设备基础库版本或客户端版本不支持运行unity小游戏
const isMobileInvalid = isMobile && !isLibVersionValid;
// 基础库/客户端不支持iOS高性能模式
const isIOSH5Invalid = (isH5Renderer && !isH5LibVersionValid) || (!isH5Renderer && disableHighPerformanceFallback);
// 客户端/基础库是否支持VideoDecoder,开发者工具不支持
export const isSupportVideoDecoder = compareVersion(version, '8.0.38') && ((isIOS && compareVersion(SDKVersion, '3.1.1')) || (isAndroid && compareVersion(SDKVersion, '3.0.0'))) && !isDevtools;
// 视情况添加,没用到对应能力就不需要判断
// 是否支持webgl2
const isWebgl2SystemVersionInvalid = () => isIOS && isWebgl2() && !isIOSWebgl2SystemVersionValid;
// IOS高性能模式2.25.3以上基础库需要手动启动webAudio
export const webAudioNeedResume = compareVersion(SDKVersion, '2.25.3') && isH5Renderer;
// 满足iOS高性能条件,但未开通高性能模式
const needToastEnableHpMode = isDevelop && isIOS && isH5LibVersionValid && isIOSH5SystemVersionValid && !isH5Renderer;
/**
* 判断环境是否可使用coverview
* coverview实际需要基础库版本>=2.16.1,但因为移动端要>=2.17.0才能运行,所以移动端基本都支持coverview
*
* @export
* @returns
*/
export function canUseCoverview() {
return isMobile || isDevtools;
}
if (needToastEnableHpMode) {
console.error('此AppID未开通高性能模式\n请前往mp后台-能力地图-开发提效包-高性能模式开通\n可大幅提升游戏运行性能');
// setTimeout(() => {
// wx.showModal({
// title: '[开发版提示]建议',
// content: '此AppID未开通高性能模式\n请前往mp后台-能力地图-开发提效包-高性能模式开通\n可大幅提升游戏运行性能',
// showCancel: false,
// })
// }, 10000);
}
export default () => new Promise((resolve) => {
if (!isDevtools) {
if (isPcInvalid
|| isMobileInvalid
|| isIOSH5Invalid
|| isWebgl2SystemVersionInvalid()
|| isBrotliInvalid) {
let updateWechat = true;
let content = '当前微信版本过低\n请更新微信后进行游戏';
if (isIOS) {
if (!isIOSH5SystemVersionValid || isWebgl2SystemVersionInvalid()) {
content = '当前操作系统版本过低\n请更新iOS系统后进行游戏';
updateWechat = false;
}
}
wx.showModal({
title: '提示',
content,
showCancel: false,
confirmText: updateWechat ? '更新微信' : '确定',
success(res) {
if (res.confirm) {
const showUpdateWechat = updateWechat && typeof wx.createBufferURL === 'function';
if (showUpdateWechat) {
wx.updateWeChatApp();
}
else {
wx.exitMiniProgram({
success: () => { },
});
}
}
},
});
return resolve(false);
}
}
return resolve(true);
});
@@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 9f1e4ac2f6ed7a3478514f2bae33e0b8
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 74d9b23196bd5cd4ba4aff87f672f84a
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 99ca7590587edd34185ff4ec04f8e131
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,219 @@
// @ts-nocheck
/* eslint-disable no-prototype-builtins */
/* eslint-disable no-unused-vars */
/* eslint-disable no-undef */
import './weapp-adapter';
import 'texture-config.js';
import unityNamespace from './unity-namespace';
import './$GAME_NAME.wasm.framework.unityweb';
import './unity-sdk/index.js';
import checkVersion from './check-version';
import { launchEventType, scaleMode } from './plugin-config';
import { preloadWxCommonFont } from './unity-sdk/font/index';
function checkUpdate() {
const updateManager = wx.getUpdateManager();
updateManager.onCheckForUpdate(() => {
// 请求完新版本信息的回调
// console.log(res.hasUpdate)
});
updateManager.onUpdateReady(() => {
wx.showModal({
title: '更新提示',
content: '新版本已经准备好,是否重启应用?',
success(res) {
if (res.confirm) {
// 新的版本已经下载好,调用 applyUpdate 应用新版本并重启
updateManager.applyUpdate();
}
},
});
});
updateManager.onUpdateFailed(() => {
// 新版本下载失败
});
}
if ($NEED_CHECK_UPDATE) {
checkUpdate();
}
const managerConfig = {
DATA_FILE_MD5: '$DATA_MD5',
CODE_FILE_MD5: '$CODE_MD5',
GAME_NAME: '$GAME_NAME',
APPID: '$APP_ID',
DATA_FILE_SIZE: "$DATA_FILE_SIZE",
OPT_DATA_FILE_SIZE: "$OPT_DATA_FILE_SIZE",
DATA_CDN: '$DEPLOY_URL',
// 资源包是否作为小游戏分包加载
loadDataPackageFromSubpackage: $LOAD_DATA_FROM_SUBPACKAGE,
// 资源包放小游戏分包加载时,是否br压缩
compressDataPackage: $COMPRESS_DATA_PACKAGE,
// 需要在网络空闲时预加载的资源,支持如下形式的路径
preloadDataList: [
// 'DATA_CDN/StreamingAssets/WebGL/textures_8d265a9dfd6cb7669cdb8b726f0afb1e',
// '/WebGL/sounds_97cd953f8494c3375312e75a29c34fc2'
'$PRELOAD_LIST',
],
contextConfig: {
contextType: $WEBGL_VERSION, // 1=>webgl1 2=>webgl2 3=>auto
},
};
GameGlobal.managerConfig = managerConfig;
// 版本检查
checkVersion().then((enable) => {
if (enable) {
// eslint-disable-next-line @typescript-eslint/naming-convention
let UnityManager;
try {
// @ts-ignore
UnityManager = requirePlugin('UnityPlugin', {
enableRequireHostModule: true,
customEnv: {
wx,
unityNamespace,
document,
canvas,
},
}).default;
}
catch (error) {
if (error.message.indexOf('not defined') !== -1) {
console.error('!!!插件需要申请才可使用\n请勿使用测试AppID,并登录 https://mp.weixin.qq.com/ 并前往:能力地图-开发提效包-快适配 开通\n阅读文档获取详情:https://github.com/wechat-miniprogram/minigame-unity-webgl-transform/blob/main/Design/Transform.md');
}
}
// JS堆栈能显示更完整
Error.stackTraceLimit = Infinity;
Object.assign(managerConfig, {
// callmain结束后立即隐藏封面视频
hideAfterCallmain: $HIDE_AFTER_CALLMAIN,
loadingPageConfig: {
// 以下是默认值
totalLaunchTime: 15000,
/**
* !!注意:修改设计宽高和缩放模式后,需要修改文字和进度条样式。默认设计尺寸为667*375
*/
designWidth: 0,
designHeight: 0,
scaleMode: scaleMode.default,
// 以下配置的样式,尺寸相对设计宽高
textConfig: {
firstStartText: '首次加载请耐心等待',
downloadingText: ['正在加载资源'],
compilingText: '编译中',
initText: '初始化中',
completeText: '开始游戏',
textDuration: 1500,
// 文字样式
style: {
bottom: 64,
height: 24,
width: 240,
lineHeight: 24,
color: '#ffffff',
fontSize: 12,
},
},
// 进度条样式
barConfig: {
style: {
width: 240,
height: 24,
padding: 2,
bottom: 64,
backgroundColor: '#07C160',
},
},
// 一般不修改,控制icon样式
iconConfig: {
visible: true,
style: {
width: 64,
height: 23,
bottom: 20,
},
},
// 加载页的素材配置
materialConfig: {
// 背景图或背景视频,两者都填时,先展示背景图,视频可播放后,播放视频
backgroundImage: '$BACKGROUND_IMAGE',
backgroundVideo: '$LOADING_VIDEO_URL',
iconImage: 'images/unity_logo.png', // icon图片,一般不更换
},
},
});
GameGlobal.managerConfig = managerConfig;
const gameManager = new UnityManager(managerConfig);
gameManager.onLaunchProgress((e) => {
// interface LaunchEvent {
// type: LaunchEventType;
// data: {
// costTimeMs: number; // 阶段耗时
// runTimeMs: number; // 总耗时
// loadDataPackageFromSubpackage: boolean; // 首包资源是否通过小游戏分包加载
// isVisible: boolean; // 当前是否处于前台,onShow/onHide
// useCodeSplit: boolean; // 是否使用代码分包
// isHighPerformance: boolean; // 是否iOS高性能模式
// needDownloadDataPackage: boolean; // 本次启动是否需要下载资源包
// };
// }
if (e.type === launchEventType.launchPlugin) {
}
if (e.type === launchEventType.loadWasm) {
}
if (e.type === launchEventType.compileWasm) {
}
if (e.type === launchEventType.loadAssets) {
}
if (e.type === launchEventType.readAssets) {
}
if (e.type === launchEventType.prepareGame) {
}
});
gameManager.onModulePrepared(() => {
// eslint-disable-next-line no-restricted-syntax
for (const key in unityNamespace) {
// 动态修改DATA_CDN后,同步修改全局对象
if (!GameGlobal.hasOwnProperty(key) || key === 'DATA_CDN') {
GameGlobal[key] = unityNamespace[key];
}
else {
}
}
managerConfig.DATA_CDN = GameGlobal.DATA_CDN;
gameManager.assetPath = `${(managerConfig.DATA_CDN || '').replace(/\/$/, '')}/Assets`;
preloadWxCommonFont();
});
// 上报初始化信息
const systeminfo = wx.getSystemInfoSync();
const bootinfo = {
renderer: systeminfo.renderer || '',
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,
};
wx.getRealtimeLogManager().info('game starting', bootinfo);
wx.getLogManager({ level: 0 }).info('game starting', bootinfo);
console.info('game starting', bootinfo);
// 默认上报小游戏实时日志与用户反馈日志(所有error日志+小程序框架异常)
wx.onError((result) => {
gameManager.printErr(result.message);
});
gameManager.onLogError = function (err) {
GameGlobal.realtimeLogManager.error(err);
GameGlobal.logmanager.warn(err);
};
// iOS高性能模式定期GC
if (GameGlobal.canUseiOSAutoGC && unityNamespace.iOSAutoGCInterval !== 0) {
setInterval(() => {
wx.triggerGC();
}, unityNamespace.iOSAutoGCInterval);
}
gameManager.startGame();
GameGlobal.manager = gameManager;
}
});
@@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 74bb09d1fe7cfd64dbb73300232fdcf7
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,53 @@
{
"deviceOrientation": "$ORIENTATION",
"openDataContext": "open-data",
"iOSHighPerformance": true,
"subpackages": [
{
"name": "wasmcode",
"root": "wasmcode/"
},
{
"name": "data-package",
"root": "data-package/"
}
],
"parallelPreloadSubpackages": [
{
"name": "wasmcode"
},
{
"name": "data-package"
}
],
"plugins": {
"UnityPlugin": {
"version": "1.2.31",
"provider": "wxe5a48f1ed5f544b7",
"contexts": [
{
"type": "isolatedContext"
}
]
},
"Layout": {
"version": "1.0.5",
"provider": "wx7a727ff7d940bb3f",
"contexts": [
{
"type": "openDataContext"
}
]
},
"MiniGameChat": {
"version": "latest",
"provider": "wx2ea687f4258401a9",
"contexts": [
{
"type": "isolatedContext"
}
]
}
},
"workers": "workers"
}
@@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 7ea580c271cce2d4c8504756657550d9
TextScriptImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 0c012a7d1fa38f94e9cbf8375ae74eb6
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
Binary file not shown.

After

Width:  |  Height:  |  Size: 8.7 KiB

@@ -0,0 +1,158 @@
fileFormatVersion: 2
guid: 943c68d5858ac4b4f8ea7653c62e3cb1
TextureImporter:
internalIDToNameTable: []
externalObjects: {}
serializedVersion: 12
mipmaps:
mipMapMode: 0
enableMipMap: 1
sRGBTexture: 1
linearTexture: 0
fadeOut: 0
borderMipMap: 0
mipMapsPreserveCoverage: 0
alphaTestReferenceValue: 0.5
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: 0.25
normalMapFilter: 0
flipGreenChannel: 0
isReadable: 0
streamingMipmaps: 0
streamingMipmapsPriority: 0
vTOnly: 0
ignoreMipmapLimit: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
filterMode: 1
aniso: 1
mipBias: 0
wrapU: 0
wrapV: 0
wrapW: 0
nPOTScale: 1
lightmap: 0
compressionQuality: 50
spriteMode: 0
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spritePixelsToUnits: 100
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spriteGenerateFallbackPhysicsShape: 1
alphaUsage: 1
alphaIsTransparency: 0
spriteTessellationDetail: -1
textureType: 0
textureShape: 1
singleChannelComponent: 0
flipbookRows: 1
flipbookColumns: 1
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
ignorePngGamma: 0
applyGammaDecoding: 0
swizzle: 50462976
cookieLightType: 0
platformSettings:
- serializedVersion: 3
buildTarget: DefaultTexturePlatform
maxTextureSize: 2048
maxPlaceholderSize: 32
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: Standalone
maxTextureSize: 2048
maxPlaceholderSize: 32
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: Server
maxTextureSize: 2048
maxPlaceholderSize: 32
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: WebGL
maxTextureSize: 2048
maxPlaceholderSize: 32
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: WeixinMiniGame
maxTextureSize: 2048
maxPlaceholderSize: 32
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
physicsShape: []
bones: []
spriteID:
internalID: 0
vertices: []
indices:
edges: []
weights: []
secondaryTextures: []
nameFileIdTable: {}
mipmapLimitGroupName:
pSDRemoveMatte: 0
userData:
assetBundleName:
assetBundleVariant:
Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

@@ -0,0 +1,158 @@
fileFormatVersion: 2
guid: aceb03d49dfdccf408f5545ab10213b3
TextureImporter:
internalIDToNameTable: []
externalObjects: {}
serializedVersion: 12
mipmaps:
mipMapMode: 0
enableMipMap: 1
sRGBTexture: 1
linearTexture: 0
fadeOut: 0
borderMipMap: 0
mipMapsPreserveCoverage: 0
alphaTestReferenceValue: 0.5
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: 0.25
normalMapFilter: 0
flipGreenChannel: 0
isReadable: 0
streamingMipmaps: 0
streamingMipmapsPriority: 0
vTOnly: 0
ignoreMipmapLimit: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
filterMode: 1
aniso: 1
mipBias: 0
wrapU: 0
wrapV: 0
wrapW: 0
nPOTScale: 1
lightmap: 0
compressionQuality: 50
spriteMode: 0
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spritePixelsToUnits: 100
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spriteGenerateFallbackPhysicsShape: 1
alphaUsage: 1
alphaIsTransparency: 0
spriteTessellationDetail: -1
textureType: 0
textureShape: 1
singleChannelComponent: 0
flipbookRows: 1
flipbookColumns: 1
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
ignorePngGamma: 0
applyGammaDecoding: 0
swizzle: 50462976
cookieLightType: 0
platformSettings:
- serializedVersion: 3
buildTarget: DefaultTexturePlatform
maxTextureSize: 2048
maxPlaceholderSize: 32
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: Standalone
maxTextureSize: 2048
maxPlaceholderSize: 32
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: Server
maxTextureSize: 2048
maxPlaceholderSize: 32
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: WebGL
maxTextureSize: 2048
maxPlaceholderSize: 32
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: WeixinMiniGame
maxTextureSize: 2048
maxPlaceholderSize: 32
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
physicsShape: []
bones: []
spriteID:
internalID: 0
vertices: []
indices:
edges: []
weights: []
secondaryTextures: []
nameFileIdTable: {}
mipmapLimitGroupName:
pSDRemoveMatte: 0
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 1c2d677641596ff4b9b084863beeeb96
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 17ed733eade086c40ad4ad50023ce754
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,124 @@
/* eslint-disable no-param-reassign */
import { getCurrTime, promisify } from './utils';
const getFriendCloudStorage = promisify(wx.getFriendCloudStorage);
const getGroupCloudStorage = promisify(wx.getGroupCloudStorage);
const setUserCloudStorage = promisify(wx.setUserCloudStorage);
const getUserInfo = promisify(wx.getUserInfo);
/**
* 获取用户信息
* API文档可见https://developers.weixin.qq.com/minigame/dev/api/open-api/data/OpenDataContext-wx.getUserInfo.html
*/
export function getSelfData() {
return getUserInfo({
openIdList: ['selfOpenId'],
}).then((res) => res.data[0] || {});
}
let getSelfPromise;
/**
* UserGameData 数据反序列化
* @param { UserGameData } item
* https://developers.weixin.qq.com/minigame/dev/api/open-api/data/UserGameData.html
*/
function getWxGameData(item) {
let source;
try {
source = JSON.parse(item.KVDataList[0].value);
}
catch (e) {
source = {
wxgame: {
score: 0,
update_time: getCurrTime(),
},
};
}
return source.wxgame;
}
/**
* 处理 getFriendCloudStorage getGroupCloudStorage 返回的在玩好友数据
*/
function rankDataFilter(res, selfUserInfo = false) {
const data = (res.data || []).filter((item) => item.KVDataList && item.KVDataList.length);
return data
.map((item) => {
const { score, update_time: updateTime } = getWxGameData(item);
item.score = score;
item.update_time = updateTime;
/**
* 请注意这里判断是否为自己并不算特别严谨的做法
* 比较严谨的做法是从游戏域将openid传进来示例为了简化简单通过 avatarUrl 来判断
*/
if (selfUserInfo && selfUserInfo.avatarUrl === item.avatarUrl) {
item.isSelf = true;
}
return item;
})
// 升序排序
.sort((a, b) => b.score - a.score);
}
/**
* 获取好友排行榜列表
* API文档可见https://developers.weixin.qq.com/minigame/dev/api/open-api/data/wx.getFriendCloudStorage.html
*/
export function getFriendRankData(key, needMarkSelf = true) {
console.log('[WX OpenData] getFriendRankData with key: ', key);
return getFriendCloudStorage({
keyList: [key],
}).then((res) => {
console.log('[WX OpenData] getFriendRankData success: ', res);
if (needMarkSelf) {
getSelfPromise = getSelfPromise || getSelfData();
return getSelfPromise.then(userInfo => rankDataFilter(res, userInfo));
}
return rankDataFilter(res);
});
}
/**
* 获取群同玩成员的游戏数据小游戏通过群分享卡片打开的情况下才可以调用该接口需要用户授权且只在开放数据域下可用
* API文档可见: https://developers.weixin.qq.com/minigame/dev/api/open-api/data/wx.getGroupCloudStorage.html
*/
export function getGroupFriendsRankData(shareTicket, key, needMarkSelf = true) {
console.log('[WX OpenData] getGroupFriendsRankData with shareTicket and key: ', shareTicket, key);
return getGroupCloudStorage({
shareTicket,
keyList: [key],
}).then((res) => {
console.log('[WX OpenData] getGroupFriendsRankData success: ', res);
if (needMarkSelf) {
getSelfPromise = getSelfPromise || getSelfData();
return getSelfPromise.then(userInfo => rankDataFilter(res, userInfo));
}
return rankDataFilter(res);
});
}
/**
* 写入用户排行榜数据value 的值一般只需要为 Object 经过 JSON.stringify 的字符串即可
* 但排行榜支持展示在游戏中心因此这里统一用游戏中心需要的数据结构执行上报需要展示在游戏中心的数据可以经过以下操作
* mp.weixin.qq.com 的小游戏管理后台设置 - 游戏 - 排行榜设置下配置对应的 key 以及相关排行榜属性
* @param { String } key 排行榜对应的 key
* @param { Number } score 排行榜对应的分数
* @param { Object } extra 除了分数还需要写入的其他字段不需要不填即可
* @example
* setUserRecord('user_rank', 100, { type: 'coin' })
*/
export function setUserRecord(key, score = 0, extra = {}) {
console.log('[WX OpenData] setUserRecord: ', score);
return setUserCloudStorage({
KVDataList: [
{
key,
value: JSON.stringify({
wxgame: {
score,
// 时间单位:秒
update_time: getCurrTime(),
},
// wxgame下开发者不可自定义其他字段, wxgame同级开发者可自由定义,比如定义一个detail 字段,用于存储取得该分数的中间状态。
...extra,
}),
},
],
}).then((res) => {
console.log('[WX OpenData] setUserRecord success: ', res);
});
}
@@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: a7ff5471c8130d54aa14ebcfd39591de
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,11 @@
export function getCurrTime() {
return Math.floor(Date.now() / 1000);
}
export function promisify(func) {
return (args = {}) => new Promise((resolve, reject) => {
func(Object.assign(args, {
success: resolve,
fail: reject,
}));
});
}
@@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: f46f8d9dbc196c14487ad86f0cc0a046
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,149 @@
/* eslint-disable indent */
import { getFriendRankData, getGroupFriendsRankData, setUserRecord } from './data/index';
import getFriendRankXML from './render/tpls/friendRank';
import getFriendRankStyle from './render/styles/friendRank';
import getTipsXML from './render/tpls/tips';
import getTipsStyle from './render/styles/tips';
import { showLoading } from './loading';
const Layout = requirePlugin('Layout').default;
const RANK_KEY = 'user_rank';
const sharedCanvas = wx.getSharedCanvas();
const sharedContext = sharedCanvas.getContext('2d');
// test
setUserRecord(RANK_KEY, Math.ceil(Math.random() * 1000));
const MessageType = {
WX_RENDER: 'WXRender',
WX_DESTROY: 'WXDestroy',
SHOW_FRIENDS_RANK: 'showFriendsRank',
SHOW_GROUP_FRIENDS_RANK: 'showGroupFriendsRank',
SET_USER_RECORD: 'setUserRecord',
};
/**
* 绑定邀请好友事件
* 温馨提示这里仅仅是示意请注意修改 shareMessageToFriend 参数
*/
const initShareEvents = () => {
// 绑定邀请
const shareBtnList = Layout.getElementsByClassName('shareToBtn');
shareBtnList
&& shareBtnList.forEach((item) => {
item.on('click', () => {
if (item.dataset.isSelf === 'false') {
wx.shareMessageToFriend({
openId: item.dataset.id,
title: '最强战力排行榜!谁是第一?',
imageUrl: 'https://mmgame.qpic.cn/image/5f9144af9f0e32d50fb878e5256d669fa1ae6fdec77550849bfee137be995d18/0',
});
}
});
});
};
/**
* 初始化开放域主要是使得 Layout 能够正确处理跨引擎的事件处理
* 如果游戏里面有移动开放数据域对应的 RawImage也需要抛事件过来执行Layout.updateViewPort
*/
const initOpenDataCanvas = async (data) => {
Layout.updateViewPort({
x: data.x / data.devicePixelRatio,
y: data.y / data.devicePixelRatio,
width: data.width / data.devicePixelRatio,
height: data.height / data.devicePixelRatio,
});
};
// 给定 xml 和 style,渲染至 sharedCanvas
function LayoutWithTplAndStyle(xml, style) {
Layout.clear();
Layout.init(xml, style);
Layout.layout(sharedContext);
console.log(Layout);
}
// 仅仅渲染一些提示,比如数据加载中、当前无授权等
function renderTips(tips = '') {
LayoutWithTplAndStyle(getTipsXML({
tips,
}), getTipsStyle({
width: sharedCanvas.width,
height: sharedCanvas.height,
}));
}
// 将好友排行榜数据渲染在 sharedCanvas
async function renderFriendsRank() {
showLoading();
try {
const data = await getFriendRankData(RANK_KEY);
if (!data.length) {
renderTips('暂无好友数据');
return;
}
LayoutWithTplAndStyle(getFriendRankXML({
data,
}), getFriendRankStyle({
width: sharedCanvas.width,
height: sharedCanvas.height,
}));
initShareEvents();
}
catch (e) {
console.error('renderFriendsRank error', e);
renderTips('请进入设置页允许获取微信朋友信息');
}
}
// 渲染群排行榜
async function renderGroupFriendsRank(shareTicket) {
showLoading();
try {
const data = await getGroupFriendsRankData(shareTicket, RANK_KEY);
if (!data.length) {
renderTips('暂无群同玩好友数据');
return;
}
LayoutWithTplAndStyle(getFriendRankXML({
data,
}), getFriendRankStyle({
width: sharedCanvas.width,
height: sharedCanvas.height,
}));
}
catch (e) {
renderTips('群同玩好友数据加载失败');
}
}
function main() {
wx.onMessage((data) => {
console.log('[WX OpenData] onMessage', data);
if (typeof data === 'string') {
try {
// eslint-disable-next-line no-param-reassign
data = JSON.parse(data);
}
catch (e) {
console.error('[WX OpenData] onMessage data is not a object');
return;
}
}
switch (data.type) {
// 来自 WX Unity SDK 的信息
case MessageType.WX_RENDER:
initOpenDataCanvas(data);
break;
// 来自 WX Unity SDK 的信息
case MessageType.WX_DESTROY:
Layout.clearAll();
break;
// 下面为业务自定义消息
case MessageType.SHOW_FRIENDS_RANK:
renderFriendsRank();
break;
case MessageType.SHOW_GROUP_FRIENDS_RANK:
renderGroupFriendsRank(data.shareTicket);
break;
case MessageType.SET_USER_RECORD:
setUserRecord(RANK_KEY, data.score);
break;
default:
console.error(`[WX OpenData] onMessage type 「${data.type}」 is not supported`);
break;
}
});
}
main();
@@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 740508847cf9a2b448a63bac4ed82157
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,33 @@
// 通过插件的方式引用 Layout
const Layout = requirePlugin('Layout').default;
let sharedCanvas = wx.getSharedCanvas();
let sharedContext = sharedCanvas.getContext("2d");
const style = {
container: {
width: '100%',
height: '100%',
justifyContent: "center",
alignItems: "center",
},
loading: {
width: 150,
height: 150,
borderRadius: 75,
},
};
const tpl = `
<view id="container">
<image src="open-data/render/image/loading.png" id="loading"></image>
</view>
`;
export function showLoading() {
Layout.clear();
Layout.init(tpl, style);
Layout.layout(sharedContext);
const image = Layout.getElementById('loading');
let degrees = 0;
Layout.ticker.add(() => {
degrees = (degrees + 2) % 360;
image.style.transform = `rotate(${degrees}deg)`;
});
}
@@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: de261e4dbfa04b345ab3aa9fc800e78e
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 7b97f396e40a59043ade0cad3c48451e
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 6b6d32f3df44c394494311bb5874cffc
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
Binary file not shown.

After

Width:  |  Height:  |  Size: 4.9 KiB

@@ -0,0 +1,158 @@
fileFormatVersion: 2
guid: c40574150099f6841bdb2212673b930a
TextureImporter:
internalIDToNameTable: []
externalObjects: {}
serializedVersion: 12
mipmaps:
mipMapMode: 0
enableMipMap: 1
sRGBTexture: 1
linearTexture: 0
fadeOut: 0
borderMipMap: 0
mipMapsPreserveCoverage: 0
alphaTestReferenceValue: 0.5
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: 0.25
normalMapFilter: 0
flipGreenChannel: 0
isReadable: 0
streamingMipmaps: 0
streamingMipmapsPriority: 0
vTOnly: 0
ignoreMipmapLimit: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
filterMode: 1
aniso: 1
mipBias: 0
wrapU: 0
wrapV: 0
wrapW: 0
nPOTScale: 1
lightmap: 0
compressionQuality: 50
spriteMode: 0
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spritePixelsToUnits: 100
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spriteGenerateFallbackPhysicsShape: 1
alphaUsage: 1
alphaIsTransparency: 0
spriteTessellationDetail: -1
textureType: 0
textureShape: 1
singleChannelComponent: 0
flipbookRows: 1
flipbookColumns: 1
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
ignorePngGamma: 0
applyGammaDecoding: 0
swizzle: 50462976
cookieLightType: 0
platformSettings:
- serializedVersion: 3
buildTarget: DefaultTexturePlatform
maxTextureSize: 2048
maxPlaceholderSize: 32
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: Standalone
maxTextureSize: 2048
maxPlaceholderSize: 32
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: Server
maxTextureSize: 2048
maxPlaceholderSize: 32
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: WebGL
maxTextureSize: 2048
maxPlaceholderSize: 32
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: WeixinMiniGame
maxTextureSize: 2048
maxPlaceholderSize: 32
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
physicsShape: []
bones: []
spriteID:
internalID: 0
vertices: []
indices:
edges: []
weights: []
secondaryTextures: []
nameFileIdTable: {}
mipmapLimitGroupName:
pSDRemoveMatte: 0
userData:
assetBundleName:
assetBundleVariant:
Binary file not shown.

After

Width:  |  Height:  |  Size: 870 B

@@ -0,0 +1,158 @@
fileFormatVersion: 2
guid: dedd4c88859d7834c92c4f93551fc019
TextureImporter:
internalIDToNameTable: []
externalObjects: {}
serializedVersion: 12
mipmaps:
mipMapMode: 0
enableMipMap: 1
sRGBTexture: 1
linearTexture: 0
fadeOut: 0
borderMipMap: 0
mipMapsPreserveCoverage: 0
alphaTestReferenceValue: 0.5
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: 0.25
normalMapFilter: 0
flipGreenChannel: 0
isReadable: 0
streamingMipmaps: 0
streamingMipmapsPriority: 0
vTOnly: 0
ignoreMipmapLimit: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
filterMode: 1
aniso: 1
mipBias: 0
wrapU: 0
wrapV: 0
wrapW: 0
nPOTScale: 1
lightmap: 0
compressionQuality: 50
spriteMode: 0
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spritePixelsToUnits: 100
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spriteGenerateFallbackPhysicsShape: 1
alphaUsage: 1
alphaIsTransparency: 0
spriteTessellationDetail: -1
textureType: 0
textureShape: 1
singleChannelComponent: 0
flipbookRows: 1
flipbookColumns: 1
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
ignorePngGamma: 0
applyGammaDecoding: 0
swizzle: 50462976
cookieLightType: 0
platformSettings:
- serializedVersion: 3
buildTarget: DefaultTexturePlatform
maxTextureSize: 2048
maxPlaceholderSize: 32
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: Standalone
maxTextureSize: 2048
maxPlaceholderSize: 32
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: Server
maxTextureSize: 2048
maxPlaceholderSize: 32
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: WebGL
maxTextureSize: 2048
maxPlaceholderSize: 32
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: WeixinMiniGame
maxTextureSize: 2048
maxPlaceholderSize: 32
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
physicsShape: []
bones: []
spriteID:
internalID: 0
vertices: []
indices:
edges: []
weights: []
secondaryTextures: []
nameFileIdTable: {}
mipmapLimitGroupName:
pSDRemoveMatte: 0
userData:
assetBundleName:
assetBundleVariant:
Binary file not shown.

After

Width:  |  Height:  |  Size: 816 B

@@ -0,0 +1,158 @@
fileFormatVersion: 2
guid: 919c1af97335df3498ea163366534748
TextureImporter:
internalIDToNameTable: []
externalObjects: {}
serializedVersion: 12
mipmaps:
mipMapMode: 0
enableMipMap: 1
sRGBTexture: 1
linearTexture: 0
fadeOut: 0
borderMipMap: 0
mipMapsPreserveCoverage: 0
alphaTestReferenceValue: 0.5
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: 0.25
normalMapFilter: 0
flipGreenChannel: 0
isReadable: 0
streamingMipmaps: 0
streamingMipmapsPriority: 0
vTOnly: 0
ignoreMipmapLimit: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
filterMode: 1
aniso: 1
mipBias: 0
wrapU: 0
wrapV: 0
wrapW: 0
nPOTScale: 1
lightmap: 0
compressionQuality: 50
spriteMode: 0
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spritePixelsToUnits: 100
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spriteGenerateFallbackPhysicsShape: 1
alphaUsage: 1
alphaIsTransparency: 0
spriteTessellationDetail: -1
textureType: 0
textureShape: 1
singleChannelComponent: 0
flipbookRows: 1
flipbookColumns: 1
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
ignorePngGamma: 0
applyGammaDecoding: 0
swizzle: 50462976
cookieLightType: 0
platformSettings:
- serializedVersion: 3
buildTarget: DefaultTexturePlatform
maxTextureSize: 2048
maxPlaceholderSize: 32
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: Standalone
maxTextureSize: 2048
maxPlaceholderSize: 32
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: Server
maxTextureSize: 2048
maxPlaceholderSize: 32
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: WebGL
maxTextureSize: 2048
maxPlaceholderSize: 32
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: WeixinMiniGame
maxTextureSize: 2048
maxPlaceholderSize: 32
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
physicsShape: []
bones: []
spriteID:
internalID: 0
vertices: []
indices:
edges: []
weights: []
secondaryTextures: []
nameFileIdTable: {}
mipmapLimitGroupName:
pSDRemoveMatte: 0
userData:
assetBundleName:
assetBundleVariant:
Binary file not shown.

After

Width:  |  Height:  |  Size: 8.7 KiB

@@ -0,0 +1,158 @@
fileFormatVersion: 2
guid: 45ba4e6111eecc04aabb1069a990b721
TextureImporter:
internalIDToNameTable: []
externalObjects: {}
serializedVersion: 12
mipmaps:
mipMapMode: 0
enableMipMap: 1
sRGBTexture: 1
linearTexture: 0
fadeOut: 0
borderMipMap: 0
mipMapsPreserveCoverage: 0
alphaTestReferenceValue: 0.5
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: 0.25
normalMapFilter: 0
flipGreenChannel: 0
isReadable: 0
streamingMipmaps: 0
streamingMipmapsPriority: 0
vTOnly: 0
ignoreMipmapLimit: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
filterMode: 1
aniso: 1
mipBias: 0
wrapU: 0
wrapV: 0
wrapW: 0
nPOTScale: 1
lightmap: 0
compressionQuality: 50
spriteMode: 0
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spritePixelsToUnits: 100
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spriteGenerateFallbackPhysicsShape: 1
alphaUsage: 1
alphaIsTransparency: 0
spriteTessellationDetail: -1
textureType: 0
textureShape: 1
singleChannelComponent: 0
flipbookRows: 1
flipbookColumns: 1
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
ignorePngGamma: 0
applyGammaDecoding: 0
swizzle: 50462976
cookieLightType: 0
platformSettings:
- serializedVersion: 3
buildTarget: DefaultTexturePlatform
maxTextureSize: 2048
maxPlaceholderSize: 32
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: Standalone
maxTextureSize: 2048
maxPlaceholderSize: 32
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: Server
maxTextureSize: 2048
maxPlaceholderSize: 32
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: WebGL
maxTextureSize: 2048
maxPlaceholderSize: 32
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: WeixinMiniGame
maxTextureSize: 2048
maxPlaceholderSize: 32
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
physicsShape: []
bones: []
spriteID:
internalID: 0
vertices: []
indices:
edges: []
weights: []
secondaryTextures: []
nameFileIdTable: {}
mipmapLimitGroupName:
pSDRemoveMatte: 0
userData:
assetBundleName:
assetBundleVariant:
Binary file not shown.

After

Width:  |  Height:  |  Size: 6.1 KiB

@@ -0,0 +1,158 @@
fileFormatVersion: 2
guid: 5fb2d4564abb2404fa0f5ec9be3df653
TextureImporter:
internalIDToNameTable: []
externalObjects: {}
serializedVersion: 12
mipmaps:
mipMapMode: 0
enableMipMap: 1
sRGBTexture: 1
linearTexture: 0
fadeOut: 0
borderMipMap: 0
mipMapsPreserveCoverage: 0
alphaTestReferenceValue: 0.5
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: 0.25
normalMapFilter: 0
flipGreenChannel: 0
isReadable: 0
streamingMipmaps: 0
streamingMipmapsPriority: 0
vTOnly: 0
ignoreMipmapLimit: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
filterMode: 1
aniso: 1
mipBias: 0
wrapU: 0
wrapV: 0
wrapW: 0
nPOTScale: 1
lightmap: 0
compressionQuality: 50
spriteMode: 0
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spritePixelsToUnits: 100
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spriteGenerateFallbackPhysicsShape: 1
alphaUsage: 1
alphaIsTransparency: 0
spriteTessellationDetail: -1
textureType: 0
textureShape: 1
singleChannelComponent: 0
flipbookRows: 1
flipbookColumns: 1
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
ignorePngGamma: 0
applyGammaDecoding: 0
swizzle: 50462976
cookieLightType: 0
platformSettings:
- serializedVersion: 3
buildTarget: DefaultTexturePlatform
maxTextureSize: 2048
maxPlaceholderSize: 32
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: Standalone
maxTextureSize: 2048
maxPlaceholderSize: 32
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: Server
maxTextureSize: 2048
maxPlaceholderSize: 32
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: WebGL
maxTextureSize: 2048
maxPlaceholderSize: 32
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: WeixinMiniGame
maxTextureSize: 2048
maxPlaceholderSize: 32
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
physicsShape: []
bones: []
spriteID:
internalID: 0
vertices: []
indices:
edges: []
weights: []
secondaryTextures: []
nameFileIdTable: {}
mipmapLimitGroupName:
pSDRemoveMatte: 0
userData:
assetBundleName:
assetBundleVariant:
Binary file not shown.

After

Width:  |  Height:  |  Size: 339 B

@@ -0,0 +1,158 @@
fileFormatVersion: 2
guid: 90e370013e953ad4f99eaf820a514a36
TextureImporter:
internalIDToNameTable: []
externalObjects: {}
serializedVersion: 12
mipmaps:
mipMapMode: 0
enableMipMap: 1
sRGBTexture: 1
linearTexture: 0
fadeOut: 0
borderMipMap: 0
mipMapsPreserveCoverage: 0
alphaTestReferenceValue: 0.5
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: 0.25
normalMapFilter: 0
flipGreenChannel: 0
isReadable: 0
streamingMipmaps: 0
streamingMipmapsPriority: 0
vTOnly: 0
ignoreMipmapLimit: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
filterMode: 1
aniso: 1
mipBias: 0
wrapU: 0
wrapV: 0
wrapW: 0
nPOTScale: 1
lightmap: 0
compressionQuality: 50
spriteMode: 0
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spritePixelsToUnits: 100
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spriteGenerateFallbackPhysicsShape: 1
alphaUsage: 1
alphaIsTransparency: 0
spriteTessellationDetail: -1
textureType: 0
textureShape: 1
singleChannelComponent: 0
flipbookRows: 1
flipbookColumns: 1
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
ignorePngGamma: 0
applyGammaDecoding: 0
swizzle: 50462976
cookieLightType: 0
platformSettings:
- serializedVersion: 3
buildTarget: DefaultTexturePlatform
maxTextureSize: 2048
maxPlaceholderSize: 32
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: Standalone
maxTextureSize: 2048
maxPlaceholderSize: 32
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: Server
maxTextureSize: 2048
maxPlaceholderSize: 32
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: WebGL
maxTextureSize: 2048
maxPlaceholderSize: 32
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: WeixinMiniGame
maxTextureSize: 2048
maxPlaceholderSize: 32
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
physicsShape: []
bones: []
spriteID:
internalID: 0
vertices: []
indices:
edges: []
weights: []
secondaryTextures: []
nameFileIdTable: {}
mipmapLimitGroupName:
pSDRemoveMatte: 0
userData:
assetBundleName:
assetBundleVariant:
Binary file not shown.

After

Width:  |  Height:  |  Size: 7.0 KiB

@@ -0,0 +1,158 @@
fileFormatVersion: 2
guid: 43180943d16d7794bb2efb364bda0bfc
TextureImporter:
internalIDToNameTable: []
externalObjects: {}
serializedVersion: 12
mipmaps:
mipMapMode: 0
enableMipMap: 1
sRGBTexture: 1
linearTexture: 0
fadeOut: 0
borderMipMap: 0
mipMapsPreserveCoverage: 0
alphaTestReferenceValue: 0.5
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: 0.25
normalMapFilter: 0
flipGreenChannel: 0
isReadable: 0
streamingMipmaps: 0
streamingMipmapsPriority: 0
vTOnly: 0
ignoreMipmapLimit: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
filterMode: 1
aniso: 1
mipBias: 0
wrapU: 0
wrapV: 0
wrapW: 0
nPOTScale: 1
lightmap: 0
compressionQuality: 50
spriteMode: 0
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spritePixelsToUnits: 100
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spriteGenerateFallbackPhysicsShape: 1
alphaUsage: 1
alphaIsTransparency: 0
spriteTessellationDetail: -1
textureType: 0
textureShape: 1
singleChannelComponent: 0
flipbookRows: 1
flipbookColumns: 1
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
ignorePngGamma: 0
applyGammaDecoding: 0
swizzle: 50462976
cookieLightType: 0
platformSettings:
- serializedVersion: 3
buildTarget: DefaultTexturePlatform
maxTextureSize: 2048
maxPlaceholderSize: 32
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: Standalone
maxTextureSize: 2048
maxPlaceholderSize: 32
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: Server
maxTextureSize: 2048
maxPlaceholderSize: 32
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: WebGL
maxTextureSize: 2048
maxPlaceholderSize: 32
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: WeixinMiniGame
maxTextureSize: 2048
maxPlaceholderSize: 32
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
physicsShape: []
bones: []
spriteID:
internalID: 0
vertices: []
indices:
edges: []
weights: []
secondaryTextures: []
nameFileIdTable: {}
mipmapLimitGroupName:
pSDRemoveMatte: 0
userData:
assetBundleName:
assetBundleVariant:
Binary file not shown.

After

Width:  |  Height:  |  Size: 60 KiB

@@ -0,0 +1,158 @@
fileFormatVersion: 2
guid: 65e6e5c41de236e4bad15b5f75601073
TextureImporter:
internalIDToNameTable: []
externalObjects: {}
serializedVersion: 12
mipmaps:
mipMapMode: 0
enableMipMap: 1
sRGBTexture: 1
linearTexture: 0
fadeOut: 0
borderMipMap: 0
mipMapsPreserveCoverage: 0
alphaTestReferenceValue: 0.5
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: 0.25
normalMapFilter: 0
flipGreenChannel: 0
isReadable: 0
streamingMipmaps: 0
streamingMipmapsPriority: 0
vTOnly: 0
ignoreMipmapLimit: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
filterMode: 1
aniso: 1
mipBias: 0
wrapU: 0
wrapV: 0
wrapW: 0
nPOTScale: 1
lightmap: 0
compressionQuality: 50
spriteMode: 0
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spritePixelsToUnits: 100
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spriteGenerateFallbackPhysicsShape: 1
alphaUsage: 1
alphaIsTransparency: 0
spriteTessellationDetail: -1
textureType: 0
textureShape: 1
singleChannelComponent: 0
flipbookRows: 1
flipbookColumns: 1
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
ignorePngGamma: 0
applyGammaDecoding: 0
swizzle: 50462976
cookieLightType: 0
platformSettings:
- serializedVersion: 3
buildTarget: DefaultTexturePlatform
maxTextureSize: 2048
maxPlaceholderSize: 32
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: Standalone
maxTextureSize: 2048
maxPlaceholderSize: 32
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: Server
maxTextureSize: 2048
maxPlaceholderSize: 32
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: WebGL
maxTextureSize: 2048
maxPlaceholderSize: 32
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: WeixinMiniGame
maxTextureSize: 2048
maxPlaceholderSize: 32
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
physicsShape: []
bones: []
spriteID:
internalID: 0
vertices: []
indices:
edges: []
weights: []
secondaryTextures: []
nameFileIdTable: {}
mipmapLimitGroupName:
pSDRemoveMatte: 0
userData:
assetBundleName:
assetBundleVariant:
Binary file not shown.

After

Width:  |  Height:  |  Size: 8.8 KiB

@@ -0,0 +1,158 @@
fileFormatVersion: 2
guid: ff593504e7e793c4c9991671177f68bb
TextureImporter:
internalIDToNameTable: []
externalObjects: {}
serializedVersion: 12
mipmaps:
mipMapMode: 0
enableMipMap: 1
sRGBTexture: 1
linearTexture: 0
fadeOut: 0
borderMipMap: 0
mipMapsPreserveCoverage: 0
alphaTestReferenceValue: 0.5
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: 0.25
normalMapFilter: 0
flipGreenChannel: 0
isReadable: 0
streamingMipmaps: 0
streamingMipmapsPriority: 0
vTOnly: 0
ignoreMipmapLimit: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
filterMode: 1
aniso: 1
mipBias: 0
wrapU: 0
wrapV: 0
wrapW: 0
nPOTScale: 1
lightmap: 0
compressionQuality: 50
spriteMode: 0
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spritePixelsToUnits: 100
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spriteGenerateFallbackPhysicsShape: 1
alphaUsage: 1
alphaIsTransparency: 0
spriteTessellationDetail: -1
textureType: 0
textureShape: 1
singleChannelComponent: 0
flipbookRows: 1
flipbookColumns: 1
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
ignorePngGamma: 0
applyGammaDecoding: 0
swizzle: 50462976
cookieLightType: 0
platformSettings:
- serializedVersion: 3
buildTarget: DefaultTexturePlatform
maxTextureSize: 2048
maxPlaceholderSize: 32
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: Standalone
maxTextureSize: 2048
maxPlaceholderSize: 32
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: Server
maxTextureSize: 2048
maxPlaceholderSize: 32
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: WebGL
maxTextureSize: 2048
maxPlaceholderSize: 32
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: WeixinMiniGame
maxTextureSize: 2048
maxPlaceholderSize: 32
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
physicsShape: []
bones: []
spriteID:
internalID: 0
vertices: []
indices:
edges: []
weights: []
secondaryTextures: []
nameFileIdTable: {}
mipmapLimitGroupName:
pSDRemoveMatte: 0
userData:
assetBundleName:
assetBundleVariant:
Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

@@ -0,0 +1,158 @@
fileFormatVersion: 2
guid: 0b973b594c5256443b474ebd353fa469
TextureImporter:
internalIDToNameTable: []
externalObjects: {}
serializedVersion: 12
mipmaps:
mipMapMode: 0
enableMipMap: 1
sRGBTexture: 1
linearTexture: 0
fadeOut: 0
borderMipMap: 0
mipMapsPreserveCoverage: 0
alphaTestReferenceValue: 0.5
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: 0.25
normalMapFilter: 0
flipGreenChannel: 0
isReadable: 0
streamingMipmaps: 0
streamingMipmapsPriority: 0
vTOnly: 0
ignoreMipmapLimit: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
filterMode: 1
aniso: 1
mipBias: 0
wrapU: 0
wrapV: 0
wrapW: 0
nPOTScale: 1
lightmap: 0
compressionQuality: 50
spriteMode: 0
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spritePixelsToUnits: 100
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spriteGenerateFallbackPhysicsShape: 1
alphaUsage: 1
alphaIsTransparency: 0
spriteTessellationDetail: -1
textureType: 0
textureShape: 1
singleChannelComponent: 0
flipbookRows: 1
flipbookColumns: 1
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
ignorePngGamma: 0
applyGammaDecoding: 0
swizzle: 50462976
cookieLightType: 0
platformSettings:
- serializedVersion: 3
buildTarget: DefaultTexturePlatform
maxTextureSize: 2048
maxPlaceholderSize: 32
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: Standalone
maxTextureSize: 2048
maxPlaceholderSize: 32
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: Server
maxTextureSize: 2048
maxPlaceholderSize: 32
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: WebGL
maxTextureSize: 2048
maxPlaceholderSize: 32
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: WeixinMiniGame
maxTextureSize: 2048
maxPlaceholderSize: 32
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
physicsShape: []
bones: []
spriteID:
internalID: 0
vertices: []
indices:
edges: []
weights: []
secondaryTextures: []
nameFileIdTable: {}
mipmapLimitGroupName:
pSDRemoveMatte: 0
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 078c6b9f7830ebf43b22e2fcfcf5e58f
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,141 @@
export default function getStyle(data) {
return {
container: {
width: data.width,
height: data.height,
borderRadius: 12,
paddingLeft: data.width * 0.03,
paddingRight: data.width * 0.03,
},
rankList: {
width: Math.ceil(data.width * 0.94),
height: data.height,
},
list: {
width: Math.ceil(data.width * 0.94),
height: data.height,
},
listItem: {
position: 'relative',
width: Math.ceil(data.width * 0.94),
height: data.height / 2 / 3,
flexDirection: 'row',
alignItems: 'center',
marginTop: 2,
},
rankBg: {
position: 'absolute',
top: 0,
left: 0,
width: Math.ceil(data.width * 0.94),
height: data.height / 2 / 3,
},
rankAvatarBg: {
position: 'absolute',
top: (data.height / 2 / 3) * 0.1,
left: data.width * 0.08,
width: (data.height / 2 / 3) * 0.8,
height: (data.height / 2 / 3) * 0.8,
},
rankAvatar: {
borderRadius: data.width * 0.06,
marginLeft: data.width * 0.08 + (data.height / 2 / 3) * 0.1,
width: (data.height / 2 / 3) * 0.6,
height: (data.height / 2 / 3) * 0.6,
},
rankNameView: {
position: 'relative',
marginLeft: data.width * 0.06,
width: data.width * 0.35,
height: data.height / 2 / 3,
},
rankNameBg: {
position: 'absolute',
top: (data.height / 2 / 3) * 0.14,
left: 0,
width: data.width * 0.35,
height: (data.height / 2 / 3) * 0.4,
},
rankName: {
position: 'absolute',
top: (data.height / 2 / 3) * 0.14,
left: 0,
width: data.width * 0.35,
height: (data.height / 2 / 3) * 0.4,
textAlign: 'center',
lineHeight: (data.height / 2 / 3) * 0.4,
fontSize: data.width * 0.043,
textOverflow: 'ellipsis',
color: '#fff',
},
rankScoreTip: {
position: 'absolute',
bottom: (data.height / 2 / 3) * 0.1,
left: 0,
width: data.width * 0.15,
height: (data.height / 2 / 3) * 0.3,
lineHeight: (data.height / 2 / 3) * 0.3,
fontSize: data.width * 0.042,
color: '#fff',
},
rankScoreVal: {
position: 'absolute',
bottom: (data.height / 2 / 3) * 0.1,
left: data.width * 0.15,
width: data.width * 0.18,
height: (data.height / 2 / 3) * 0.3,
lineHeight: (data.height / 2 / 3) * 0.3,
fontSize: data.width * 0.042,
color: '#fff',
},
shareNameView: {
position: 'relative',
marginLeft: data.width * 0.06,
width: data.width * 0.35,
height: (data.height / 2 / 3) * 0.4,
},
shareNameBg: {
position: 'absolute',
top: 0,
left: 0,
width: data.width * 0.35,
height: (data.height / 2 / 3) * 0.4,
},
shareName: {
position: 'absolute',
top: 0,
left: 0,
width: data.width * 0.35,
height: (data.height / 2 / 3) * 0.4,
textAlign: 'center',
lineHeight: (data.height / 2 / 3) * 0.4,
fontSize: data.width * 0.043,
textOverflow: 'ellipsis',
color: '#fff',
},
shareToBtn: {
position: 'relative',
marginLeft: data.width * 0.08,
width: data.width * 0.21,
height: data.height * 0.16,
},
shareBtnBg: {
position: 'absolute',
right: 0,
top: data.height * 0.16 * 0.25,
width: data.width * 0.21,
height: data.height * 0.16 * 0.5,
},
shareText: {
position: 'absolute',
right: 0,
top: data.height * 0.16 * 0.25,
width: data.width * 0.21,
height: data.height * 0.16 * 0.5,
lineHeight: data.height * 0.16 * 0.5,
textAlign: 'center',
fontSize: data.width * 0.043,
color: '#fff',
},
};
}
@@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 2b4bc4ec5b53dd44992d46ca7b062ebe
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,18 @@
export default function getStyle(data) {
return {
container: {
flexDirection: 'row',
width: data.width,
height: data.height,
justifyContent: 'center',
alignItems: 'center',
},
tips: {
color: '#000000',
width: data.width,
height: 50,
fontSize: 50,
textAlign: 'center',
},
};
}
@@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 047bc94c21d7f7a47a7d0aaac9cdbd91
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: ff0b7129cdb35dd4c87671285df5431e
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,52 @@
/**
* 下面的内容分成两部分第一部分是一个模板模板的好处是能够有一定的语法
* 坏处是模板引擎一般都依赖 new Function 或者 eval 能力小游戏下面是没有的
* 所以模板的编译需要在外部完成可以将注释内的模板贴到下面的页面内点击 "run"就能够得到编译后的模板函数
* https://wechat-miniprogram.github.io/minigame-canvas-engine/playground.html
* 如果觉得模板引擎使用过于麻烦也可以手动拼接字符串本文件对应函数的目标仅仅是为了创建出 xml 节点数
*/
/*
<view class="container" id="main">
<view class="rankList">
<scrollview class="list" scrollY="true">
{{~it.data :item:index}}
<view class="listItem">
<image src="open-data/render/image/rankBg.png" class="rankBg"></image>
<image class="rankAvatarBg" src="open-data/render/image/rankAvatar.png"></image>
<image class="rankAvatar" src="{{= item.avatarUrl }}"></image>
<view class="rankNameView">
<image class="rankNameBg" src="open-data/render/image/nameBg.png"></image>
<text class="rankName" value="{{=item.nickname}}"></text>
<text class="rankScoreTip" value="战力值:"></text>
<text class="rankScoreVal" value="{{=item.score || 0}}"></text>
</view>
<view class="shareToBtn" data-isSelf="{{= item.isSelf ? true : false}}" data-id="{{= item.openid || ''}}">
<image src="open-data/render/image/{{= item.isSelf ? 'button3':'button2'}}.png" class="shareBtnBg"></image>
<text class="shareText" value="{{= item.isSelf ? '你自己' : '分享'}}"></text>
</view>
</view>
{{~}}
</scrollview>
</view>
</view>
*/
/**
* xml经过doT.js编译出的模板函数
* 因为小游戏不支持new Function模板函数只能外部编译
* 可直接拷贝本函数到小游戏中使用
*/
export default function anonymous(it) {
let out = '<view class="container" id="main"> <view class="rankList"> <scrollview class="list" scrollY="true"> ';
const arr1 = it.data;
if (arr1) {
let item;
let index = -1;
const l1 = arr1.length - 1;
while (index < l1) {
item = arr1[(index += 1)];
out += ` <view class="listItem"> <image src="open-data/render/image/rankBg.png" class="rankBg"></image> <image class="rankAvatarBg" src="open-data/render/image/rankAvatar.png"></image> <image class="rankAvatar" src="${item.avatarUrl}"></image> <view class="rankNameView"> <image class="rankNameBg" src="open-data/render/image/nameBg.png"></image> <text class="rankName" value="${item.nickname}"></text> <text class="rankScoreTip" value="战力值:"></text> <text class="rankScoreVal" value="${item.score || 0}"></text> </view> <view class="shareToBtn" data-isSelf="${!!item.isSelf}" data-id="${item.openid || ''}"> <image src="open-data/render/image/${item.isSelf ? 'button3' : 'button2'}.png" class="shareBtnBg"></image> <text class="shareText" value="${item.isSelf ? '你自己' : '分享'}"></text> </view> </view> `;
}
}
out += ' </scrollview> </view></view>';
return out;
}
@@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 7265bed57589cc54185abff38ad560ec
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,23 @@
/**
* 下面的内容分成两部分第一部分是一个模板模板的好处是能够有一定的语法
* 坏处是模板引擎一般都依赖 new Function 或者 eval 能力小游戏下面是没有的
* 所以模板的编译需要在外部完成可以将注释内的模板贴到下面的页面内点击 "run"就能够得到编译后的模板函数
* https://wechat-miniprogram.github.io/minigame-canvas-engine/playground.html
* 如果觉得模板引擎使用过于麻烦也可以手动拼接字符串本文件对应函数的目标仅仅是为了创建出 xml 节点数
*/
/**
<view id="container">
<text class="tips" value="{{= it.tips || '' }}"></text>
</view>
*/
/**
* xml经过doT.js编译出的模板函数
* 因为小游戏不支持new Function模板函数只能外部编译
* 可直接拷贝本函数到小游戏中使用
*/
export default function anonymous(it) {
const out = `<view id="container"> <text class="tips" value="${it.tips || ''}"></text></view>`;
return out;
}
@@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: d7f3c79b7491fb943bc9ea279fc66cee
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,19 @@
export const launchEventType = {
launchPlugin: 0,
loadWasm: 1,
compileWasm: 2,
loadAssets: 3,
readAssets: 5,
prepareGame: 6, // 初始化引擎
};
// https://docs.egret.com/engine/docs/screenAdaptation/zoomMode
export const scaleMode = {
default: '',
noBorder: 'NO_BORDER',
exactFit: 'EXACT_FIT',
fixedHeight: 'FIXED_HEIGHT',
fixedWidth: 'FIXED_WIDTH',
showAll: 'SHOW_ALL',
fixedNarrow: 'FIXED_NARROW',
fixedWide: 'FIXED_WIDE',
};
@@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 559e9785a6f656242af006216a85a5ea
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,71 @@
{
"description": "项目配置文件",
"setting": {
"urlCheck": false,
"es6": true,
"enhance": true,
"postcss": true,
"preloadBackgroundData": false,
"minified": true,
"newFeature": true,
"coverView": true,
"nodeModules": false,
"autoAudits": false,
"showShadowRootInWxmlPanel": true,
"scopeDataCheck": false,
"uglifyFileName": false,
"checkInvalidKey": true,
"checkSiteMap": true,
"uploadWithSourceMap": true,
"compileHotReLoad": false,
"useMultiFrameRuntime": true,
"useApiHook": false,
"disableUseStrict": false,
"babelSetting": {
"ignore": ["$GAME_NAME.wasm.framework.unityweb.js"],
"disablePlugins": [],
"outputPath": ""
},
"useIsolateContext": true,
"useCompilerModule": true,
"userConfirmedUseCompilerModuleSwitch": false,
"packNpmManually": false,
"packNpmRelationList": []
},
"compileType": "game",
"libVersion": "3.0.0",
"appid": "$APP_ID",
"projectname": "$PROJECT_NAME",
"simulatorType": "wechat",
"simulatorPluginLibVersion": {},
"packOptions": {
"ignore": [
{
"type": "folder",
"value": ".plugincache"
},
{
"type": "suffix",
"value": ".symbols.unityweb"
}
]
},
"condition": {
"search": {
"current": -1,
"list": []
},
"conversation": {
"current": -1,
"list": []
},
"game": {
"currentL": -1,
"list": []
},
"miniprogram": {
"current": -1,
"list": []
}
}
}
@@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: e5c80109743a4cc4aab6b6a1c04c0ac0
TextScriptImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

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