1.html
script中增加Reset方法
function Reset() {
var canvas = document.getElementById("#canvas");
canvas.height= document.body.clientHeight;
canvas.width = document.body.clientWidth;
}
function Reset(){
var canvas = document.getElementById("#canvas");
canvas.height= document.documentElement.clientHeight;
canvas.width = document.documentElement.clientWidth;
}
body标签增加onload和onresize调用Reset方法
body onload=“Reset()” onresize=“Reset()”
2.style.css
html,body{width:100%;height:100%;margin:0;padding:0;overflow:hidden;}
.webgl-content{width: 100%; height: 100%;}
.unityContainer{width: 100%; height: 100%;}