Skip to content

Instantly share code, notes, and snippets.

@Stals
Created December 26, 2019 11:14
Show Gist options
  • Save Stals/ad0c2a4a62d3e7ea4acf4a53b0c0d0f7 to your computer and use it in GitHub Desktop.
Save Stals/ad0c2a4a62d3e7ea4acf4a53b0c0d0f7 to your computer and use it in GitHub Desktop.

Revisions

  1. Stals created this gist Dec 26, 2019.
    24 changes: 24 additions & 0 deletions index.html
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,24 @@
    <!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>