<!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 | E2festaURP_Sample</title>
<style>
body {
padding: 0;
margin: 0;
}
#unity-container {
position: absolute;
}
#unity-canvas {
background: #231f20;
}
</style>
</head>
<body style="text-align: center">
<div
id="unity-container"
style="width: 100%; height: 100%"
>
<canvas id="unity-canvas"></canvas>
</div>
<script>
var canvas = document.querySelector("#unity-canvas");
canvas.style.width = "100%";
canvas.style.height = "100%";
</script>
<script src="Build/E2FestaURP_Sample.loader.js"></script>
<script>
createUnityInstance(document.querySelector("#unity-canvas"), {
dataUrl: "Build/E2FestaURP_Sample.data.unityweb",
frameworkUrl: "Build/E2FestaURP_Sample.framework.js.unityweb",
codeUrl: "Build/E2FestaURP_Sample.wasm.unityweb",
streamingAssetsUrl: "StreamingAssets",
companyName: "DefaultCompany",
productName: "E2festaURP_Sample",
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>
코드 예시
'툴 > 유니티' 카테고리의 다른 글
Unity Raycast 유니티 레이캐스트 - 마우스클릭된 포지션 받기 (0) | 2021.09.02 |
---|---|
Unity Dotween 유니티 닷트윈 사용법 (1) | 2021.09.02 |
Webgl 웹브라우저 화면 맞춤 & 모바일 실행제한 문구 없애기 (1) | 2021.08.26 |
[AR] 마커 이미지 인식률 측정방법 arcoreimg (0) | 2021.08.20 |
유니티 2020 버전 Webgl 무한로딩 문제 (1) | 2021.08.16 |