unity webgl 시 minimal 로 빌드하면 모바일에서 경고 메세지가 나오지 않음
테두리까지 화면을 쓸려면 아래 내용을 추가할것
body {
touch-action: none;
}
<!DOCTYPE html>
<html lang="en-us">
<head>
<meta charset="utf-8">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<link type="text/css" rel="stylesheet" href="main.css">
<title>Unity WebGL Player | html5</title>
<style>
body {
touch-action: none;
}
</style>
</head>
<body style="text-align: center">
<div id="unity-container" style="position: absolute; width: 100%; height: 100%">
<canvas id="unity-canvas" width={{{ WIDTH }}} height={{{ HEIGHT }}} style="width: 100%; height: 100%"></canvas>
</div>
<script src="Build/bin.loader.js"></script>
<script>
if (/iPhone|iPad|iPod|Android/i.test(navigator.userAgent)) {
// Mobile device style: fill the whole browser client area with the game canvas:
var meta = document.createElement('meta');
meta.name = 'viewport';
meta.content = 'width=device-width, height=device-height, initial-scale=1.0, user-scalable=no,minimum-scale=1.0, maximum-scale=1.0, shrink-to-fit=yes';
document.getElementsByTagName('head')[0].appendChild(meta);
}
createUnityInstance(document.querySelector("#unity-canvas"), {
dataUrl: "Build/bin.data",
frameworkUrl: "Build/bin.framework.js",
codeUrl: "Build/bin.wasm",
streamingAssetsUrl: "StreamingAssets",
companyName: "DefaultCompany",
productName: "html5",
productVersion: "0.1",
// matchWebGLToCanvasSize: false, // Uncomment this to separately control WebGL canvas render size and DOM element size.
// devicePixelRatio: 1, // Uncomment this to override low DPI rendering on high DPI displays.
});
</script>
</body>
</html>