unity3d:webgl打包,pc端移动端全屏化


<html lang="en-us">
  <head>
    <meta charset="utf-8">
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <title>Unity WebGL Player | ZhiQiaotitle>
    <script src="Build/UnityLoader.js">script>
    <script>
      var gameInstance = UnityLoader.instantiate("gameContainer", "Build/JuZhi7Mobile.json");
      function Reset()
    {
        var canvas = document.getElementById("#canvas");//获取#canvas
        canvas.height=  document.documentElement.clientHeight;//获取body可见区域高度
        canvas.width =  document.documentElement.clientWidth;//获取body可见区域高度

    }
    script>
  head>
  <body onresize="Reset()" ,scroll= no, style="overflow:hidden">
    <div id="gameContainer" style="width: 100vw; height: 100vh;margin:auto">div>
  body>
html>

修改部分
unity3d:webgl打包,pc端移动端全屏化_第1张图片

你可能感兴趣的:(Unity3D实用技术笔记)