Replies: 1 comment
-
|
属于浏览器的API诸如 location、xhr、localStorage之类的就不可以、Node.js的api比如fs、net这些也不可以(如果是要写编辑器功能可以选用puerts的Node.js版dll,这样Node.js的api在编辑器端就可以用)。 上述这些接口在unity下可以通过调用csharp api实现替代,但是npm里的包如果用到了,你就要做一个polyfill来实现了。 cannot find的错误是指你的loader无法找到对应的js,在DefaultLoader里加打印可以看到。 |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
faq里说用到了nodejs或者浏览器js的特定api的包没法用,但没有举例哪些包能用,也没说怎么方便地判断能否使用。主要我不确定特定api到底都有哪些,而且有些包挺复杂的不好检查。
刚刚接触puerts,正确地搭建了项目环境。测试发现在ts项目里引用了一个小众的包并且在ts环境下能够使用,但是放到unity那边就报错: puerts/modular.mjs:58: Error: can not find XXX ,我就在想会不会是包不支持的问题
Beta Was this translation helpful? Give feedback.
All reactions