gpt4 book ai didi

unity3d - 如何运行本地 Unity WebGL(文件 ://url) build?

转载 作者:行者123 更新时间:2023-12-03 13:44:28 32 4
gpt4 key购买 nike

尝试打开本地 Unity WebGL 构建时,多个浏览器(Chrome、Firefox、Internet Explorer)会出现以下错误:

It seems your browser does not support running Unity WebGL content from file:// urls. Please upload it to an http server, or try a different browser.


Microsoft Edge 能够运行它,但我想知道是否可以更改任何设置以使其在 Chrome/Firefox/其他浏览器上运行。

最佳答案

只需打开您的终端并进入您的目录(HTML 文件所在的目录),然后使用以下命令之一启动服务器。

python -m CGIHTTPServer 8360
python -m http.server --cgi 8360
python3 -m http.server --cgi 8360
这将为您打开端口。
然后将浏览器定向到 http://localhost:8360/YOURFILENAME.html
默认的通常是 index.html ;)

关于unity3d - 如何运行本地 Unity WebGL(文件 ://url) build?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/62517962/

32 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com