Skip to content

Instantly share code, notes, and snippets.

@Stals
Created December 26, 2019 11:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Stals/ad0c2a4a62d3e7ea4acf4a53b0c0d0f7 to your computer and use it in GitHub Desktop.
Save Stals/ad0c2a4a62d3e7ea4acf4a53b0c0d0f7 to your computer and use it in GitHub Desktop.
<!DOCTYPE html>
<html lang="en-us">
<head>
<style>
canvas {
width: 100%;
height: 100%;
position: absolute;
}
</style>
<meta charset="utf-8">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>%UNITY_WEB_NAME%</title>
<script src="%UNITY_WEBGL_LOADER_URL%"></script>
<script>
//turn off unity's annoying alert() dialog.
UnityLoader.Error.handler = function(){}
var gameInstance = UnityLoader.instantiate("gameContainer", "%UNITY_WEBGL_BUILD_URL%");
</script>
</head>
<body>
<div id="gameContainer" style="width: 100%; height: 100%; position: absolute; margin: auto"></div>
</body>
</html>
@Stals
Copy link
Author

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