求高手拆招,unity使用WebGL方式导出,再导入微信小游戏后,编译报错如下:
问题一:来自微信插件plugin.js:74
exception thrown: ReferenceError: AbortController is not defined,ReferenceError: AbortController is not defined
at _JS_WebRequest_Create (http://127.0.0.1:42687/game/webgl.wasm.framework.unityweb.js:3:61167)
at TransportJavaScript::DoRequest(TransportDoRequestArgsProto<HeaderHelper, DownloadHandler, UploadHandler, CertificateHandler, ResponseHelper> const&) (<anonymous>:wasm-function[33276]:0xa4f204)
at UnityWebRequestProto<UnityWebRequestTransport, AtomicRefCounter, RedirectHelper, ResponseHelper, DownloadHandler, UploadHandler, CertificateHandler, HeaderHelper, AsyncOperation>::Task_DoRequest(void*) (<anonymous>:wasm-function[32057]:0xa0b0d3)
at UnityWebRequestProto<UnityWebRequestTransport, AtomicRefCounter, RedirectHelper, ResponseHelper, DownloadHandler, UploadHandler, CertificateHandler, HeaderHelper, AsyncOperation>::Job_ExecuteUnityWebRequest(UnityWebRequestProto<UnityWebRequestTransport, AtomicRefCounter, RedirectHelper, ResponseHelper, DownloadHandler, UploadHandler, CertificateHandler, HeaderHelper, AsyncOperation>*) (<anonymous>:wasm-function[32060]:0xa0b548)
at UnityWebRequestProto<UnityWebRequestTransport, AtomicRefCounter, RedirectHelper, ResponseHelper, DownloadHandler, UploadHandler, CertificateHandler, HeaderHelper, AsyncOperation>::Begin() (<anonymous>:wasm-function[16183]:0x5a4848)
at UnityWebRequest::Begin() (<anonymous>:wasm-function[32071]:0xa0b7f9)
at UnityEngine::Analytics::WebRequestRestClient::PerformPost() (<anonymous>:wasm-function[9787]:0x3297a0)
。。。。。
at n (http://127.0.0.1:42687/game/__dev__/WAGameSubContext.js:1:24431)(env: Windows,mg,1.06.2206090; lib: 2.25.0)
plugin.js:74 WebGL: INVALID_OPERATION: drawElements: no valid shader program in use
问题二:来自VM536 WAGameSubContext.js:1
Unhandled promise rejection TypeError: Browser.mainLoop.scheduler is not a function
at Object.resume (webgl.wasm.framework.unityweb.js:3)
at Object.calledMainCb (plugin.js:74)
at callMain (webgl.wasm.framework.unityweb.js:3)
at doRun (webgl.wasm.framework.unityweb.js:3)
at run (webgl.wasm.framework.unityweb.js:3)
at runCaller (webgl.wasm.framework.unityweb.js:3)
at removeRunDependency (webgl.wasm.framework.unityweb.js:3)
at receiveInstance (webgl.wasm.framework.unityweb.js:3)
at receiveInstantiationResult (webgl.wasm.framework.unityweb.js:3)
at VM536 WAGameSubContext.js:1
at n (VM536 WAGameSubContext.js:1)(env: Windows,mg,1.06.2206090; lib: 2.25.0)
第一个问题,替换打包出的文件中Build文件夹下项目名.framework.js文件内的js代码
var wr = { requestInstances: {}, nextRequestId: 1, loglevel: 2 };
改成:
var wr = { requestInstances: {}, nextRequestId: 1, loglevel: 2, responses:{}, timer:{}, requests:{}, abortControllers:{} };
请问第二个问题解决了吗?
请问第二个问题解决了吗?
您好 解决了吗 我这边也遇到相同的问题