Closed zhuangce closed 2 years ago
https://github.com/zombieyang/puerts_unity_webgl_demo/blob/master/package/Runtime/WebGL.cs#L10 那个类就在这,不太可能没有,是不是build target不对?或者不小心把manifest.json里对package的引用删掉了?
https://github.com/zombieyang/puerts_unity_webgl_demo/blob/master/package/Runtime/WebGL.cs#L10 那个类就在这,不太可能没有,是不是build target不对?或者不小心把manifest.json里对package的引用删掉了?
感谢回复, 我通过重新导入一次webgl package 解决了报错,之前应该是我在包管理器中下载了但是unity并没有识别到。
优化了一下错误信息,后面类似的问题应该就能看到正确的错误信息而不是那个 reading 'inited'了
error log | 日志或报错信息
在修改unity playersettting 后 也可能报这个错 exception thrown: TypeError: Cannot read properties of undefined (reading 'inited'),TypeError: Cannot read properties of undefined (reading 'inited'). 我定位到的webgl.frameworks.js代码 :
function _GetApiLevel() { var global = typeof global != "undefined" ? global : window; if (!global.PuertsWebGL.inited) { throw new Error("please use Puerts.WebGL.GetBrowserEnv() to create JsEnv"); }
context | 编译/运行环境
unity2021.2 /Chrome(v100+)浏览器
how to reproduce | 复现步骤
more | 其他
根据错误描述去代码里添加puerts.webgl.getborwerenv() ,却没有这样的类