wechat-miniprogram / minigame-unity-webgl-transform

Wechat Mini Game Unity engine adapter documents.
https://wechat-miniprogram.github.io/minigame-unity-webgl-transform/
MIT License
3.01k stars 458 forks source link

生成的webgl.wasm.framework.unityweb.js里有重复的WXFS.isWXAssetBundle调用 #829

Closed zxt5105515 closed 1 month ago

zxt5105515 commented 3 months ago

描述Bug

下面是webgl.wasm.framework.unityweb.js文件中的syncaccess方法,类似的还有sys_open方法

    function ___sys_access(path, amode) {
        try {
            path = SYSCALLS.getStr(path);
            if (typeof WXFS !== "undefined" && WXFS.isWXAssetBundle(path)) {
                if (WXFS.path2fd.has(path)) return 0;
                return WXFS.doWXAccess(path, amode)
            }
            if (WXFS.isWXAssetBundle(path)) {
                if (WXFS.path2fd.has(path)) return 0;
                return WXFS.doWXAccess(path, amode)
            }
            if (WXFS.isWXAssetBundle(path)) {
                if (WXFS.path2fd.has(path)) return 0;
                return WXFS.doWXAccess(path, amode)
            }
            return SYSCALLS.doAccess(path, amode)
        } catch (e) {
            if (typeof FS === "undefined" || !(e instanceof FS.ErrnoError)) abort(e);
            return -e.errno
        }
    }

运行环境

Windows11/Unity2021.3.21f1/minigame.202407090855/Assets导入/WebGL
Oooocean commented 1 month ago

已修复,请更新转换插件