首先用unity发布webGL
在player settings中设置:
如果选择default的话会报错误:HTTP Response Header “Content-Type” configured incorrectly on the server for file /static/buildweb/Build/buildweb.wasm.gz , should be “application/wasm”. Startup time performance will suffer.
然后在生成的文件放入django项目中去:
1.静态文件放入static目录,2.index放入templates
配置响应我的url.py和views.py
最后需要更改index.html中文件引入路径:
启动项目,就可以愉快的玩耍了。