Unity3D WebPlayer 铺满浏览器窗口

说明:不是fullScreen, 而是在浏览器中100%宽度100%高度

终极解决办法
修改发布后的html页面:

  1. 修改js

    var config = {
    width:960,
    height:600,
    

    修改成:

    var config = {
    width:window.innerWidth,
    height:window.innerHeight
    
  2. 修改css
    在body块内添加:

    margin:0px;
    padding:0px;
    width:100%;
    height:100%
    
  3. 找到div.content块,改为:

    div.content{
    margin:auto;
    width:100%;
    height:100%;
    }
    
  4. 找到div#unityPlayer块,改为:

    div#unityPlayer{
    cursor:default;
    height:100%;
    width:100%;
    }
    
  5. 加入以下样式:

    embed{
    width:100% !important;
    }
    
  6. 最后删掉顶部和底部的多余两行文字的相关html即可

经验证,这个方法在ie下可用

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值