- 将unity项目发布到webplayer,发布时选择default模板。
- 找到发布后的html文件,修改里面的内容,修改如下
- 找到config代码 :
var config={width :900, height:600};
修改为 varconfig = {width: window.innerWidth, height:: window.innerHeight} - 在样式中找到 body{....}部分,设置margin/padding/width/height,如下:
margin:0px;
padding:0px;
width:100%;
height:100%; - 在样式中找到 div.content{..} 部分,设置width/height,如下:
width:100%;
height:100%; - 在样式中找到 div#unityPlayer{...} 部分, 设置width/height,如下:
width:100%;
height:100%; - 增加一个新的样式
embed
{
width:100% !important;
} - 删除头部<p class="header"><span>Unity Web Player | </span>DZ3DSmallNew</p>
- 删除底部 <p class="footer">« created with <a href="http://unity3d.com/unity/" title="Go to unity3d.com">Unity</a> »</p>
- 找到config代码 :
原文:点击打开链接