參考資料
hi,WebGL
Unity 發佈WebGL注意事項
Unit WebGL 官方教程
Unity WebGL官方教程翻譯
發佈後打不開
Unity WebGL遊戲
官方WebGL Tiny
Build
使用Unity build WebGL後的文件結構如下:
IIS 部署
啓用Internet Infomation Services
添加程序到IIS
1.把build目錄添加到IIS
2.通過瀏覽器打開(http://localhost/webgl/ )
當然也可以用ip打開,筆者本地ip爲:192.168.10.215,所以地址爲:http://192.168.10.215:80/webgl/
添加MIME類型,解決報錯
擴展名:.unityweb,類型:application/octet-stream
添加的MIME類型配置會在對應的根目錄下生成web.config配置文件
重新打開頁面就正常了
瀏覽器設置
Chrome 快捷方式右鍵屬性在目標內添加--enable-webgl --ignore-gpu-blacklist --allow-file-access-from-files
即可(注意第一個的空格)
示例:“C:\Program Files (x86)\Google\Chrome\Application\chrome.exe” --enable-webgl --ignore-gpu-blacklist --allow-file-access-from-files