Skip to content

Instantly share code, notes, and snippets.

Created December 26, 2019 11:14
What would you like to do?
<!DOCTYPE html>
<html lang="en-us">
canvas {
width: 100%;
height: 100%;
position: absolute;
<meta charset="utf-8">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<script src="%UNITY_WEBGL_LOADER_URL%"></script>
//turn off unity's annoying alert() dialog.
UnityLoader.Error.handler = function(){}
var gameInstance = UnityLoader.instantiate("gameContainer", "%UNITY_WEBGL_BUILD_URL%");
<div id="gameContainer" style="width: 100%; height: 100%; position: absolute; margin: auto"></div>
Copy link

Stals commented May 29, 2022

This is a modified Unity's index.html that I used for my web gamedev tools made using Unity & WebAssembly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment