53 lines
2.1 KiB
HTML
53 lines
2.1 KiB
HTML
<!DOCTYPE html>
|
|
<html lang="en-us">
|
|
<head>
|
|
<meta charset="utf-8">
|
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
|
<title>Unity WebGL Player | Unity_Web</title>
|
|
</head>
|
|
<body style="text-align: center; padding: 0; border: 0; margin: 0;">
|
|
<style>
|
|
html, body {
|
|
margin: 0;
|
|
padding: 0;
|
|
overflow: hidden; /* 스크롤 제거 */
|
|
width: 100vw;
|
|
height: 100vh;
|
|
overscroll-behavior: contain; /* 뷰포트 이동 방지 */
|
|
touch-action: manipulation; /* 터치 동작 최적화 */
|
|
position: fixed; /* 화면 크기 변경 방지 */
|
|
}
|
|
</style>
|
|
<canvas id="unity-canvas" width=960 height=600 tabindex="-1" style="width: 100vw; height: 100vh; background: #FFFFFF"></canvas>
|
|
<script src="Build/Build.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, shrink-to-fit=yes';
|
|
document.getElementsByTagName('head')[0].appendChild(meta);
|
|
|
|
var canvas = document.querySelector("#unity-canvas");
|
|
canvas.style.width = "100%";
|
|
canvas.style.height = "100%";
|
|
canvas.style.position = "fixed";
|
|
|
|
document.body.style.textAlign = "left";
|
|
}
|
|
|
|
createUnityInstance(document.querySelector("#unity-canvas"), {
|
|
dataUrl: "Build/Build.data.br",
|
|
frameworkUrl: "Build/Build.framework.js.br",
|
|
codeUrl: "Build/Build.wasm.br",
|
|
streamingAssetsUrl: "StreamingAssets",
|
|
companyName: "DefaultCompany",
|
|
productName: "Unity_Web",
|
|
productVersion: "1.0",
|
|
// 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>
|