unity5.6.5,使用触摸操作对物体进行旋转时
//在浏览器中GetAxis("Mouse X")和GetAxis("Mouse Y")始终为0
Input.GetAxis("Mouse X")
//可以正常使用,和GetAxis的返回值不一样
Input.GetTouch(0).deltaPosition
似乎使用手机浏览器查看的unity webgl只能使用touch的输入,类似Input.GetMouseButton(0),Input.MousePosition都不能用。
网页自适应https://blog.csdn.net/qq_38456478/article/details/78869971
在生成的html里面修改代码
<script type="text/javascript">
function Reset() {
var canvas = document.getElementById("#canvas");
canvas.height= document.documentElement.clientHeight;
canvas.width = document.documentElement.clientWidth;
console.log(canvas.width );
}
</script>
</head>
<body οnlοad="Reset()" οnresize="Reset()">
<div class="webgl-content"style="width: 100%; height: 100%" >
<div id="gameContainer" style="width: 100%; height: 100%"></div>
</div>
</body>
</html>
来实现网页版随浏览器自适应