cocos creator里判断是否支持webassembly

 iswebasm () {

        var useWasm = false;

        if(typeof WebAssembly == ‘undefined’) {

            console.error(‘未找到WebAssembly NameSpace’);

            return useWasm;

        }

        var webAsmObj = window[“WebAssembly”];

        if (typeof webAsmObj === “object”) {

            if (typeof webAsmObj[“Memory”] === “function”)

            {

                if ((typeof webAsmObj[“instantiateStreaming”] === “function”) || (typeof webAsmObj[“instantiate”] === “function”))

                useWasm = true;

            }

        }

        return useWasm;  

    }

发表评论

您的电子邮箱地址不会被公开。 必填项已用 * 标注