<!doctype html>
<html lang="en-us">
  <head>
    <meta charset="utf-8" />
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta name="viewport" content="width=device-width, height=device-height, initial-scale=1.0, user-scalable=no, shrink-to-fit=yes" />
    <title>Unity Web Player | {{{ PRODUCT_NAME }}}</title>
    #if SHOW_DIAGNOSTICS
    <link rel="stylesheet" href="<<<TemplateData/diagnostics.css>>>" />
    <script src="<<<TemplateData/diagnostics.js>>>"></script>
    #endif
    <style>
      html,
      body {
        width: 100%;
        height: 100%;
        margin: 0;
        padding: 0;
        border: 0;
        overflow: hidden;
      }
      #unity-canvas {
        position: fixed;
        inset: 0;
        width: 100%;
        height: 100%;
        display: block;
      }
      #diagnostics-icon {
        position: fixed;
        bottom: 10px;
        right: 0;
      }
    </style>
  </head>
  <body>
    <canvas
      id="unity-canvas"
      width="{{{ WIDTH }}}"
      height="{{{ HEIGHT }}}"
      tabindex="-1"
      style="background: {{{ BACKGROUND_FILENAME ? 'url(\'Build/' + BACKGROUND_FILENAME.replace(/'/g, '%27') + '\') center / cover' : BACKGROUND_COLOR }}}"
    ></canvas>
    #if SHOW_DIAGNOSTICS
    <div id="unity-footer">
      <img id="diagnostics-icon" src="TemplateData/webmemd-icon.png" />
    </div>
    #endif
    <script src="Build/{{{ LOADER_FILENAME }}}"></script>
    <script>
            createUnityInstance(document.querySelector("#unity-canvas"), {
              arguments: [],
      #if PROGRESSIVE_ASSET_LOADING
              primaryDataUrls: {{{ JSON.stringify(PRIMARY_DATA_FILES) }}},
              secondaryDataUrls: {{{ JSON.stringify(SECONDARY_DATA_FILES) }}},
      #else
              dataUrl: "Build/{{{ DATA_FILENAME }}}",
      #endif
              frameworkUrl: "Build/{{{ FRAMEWORK_FILENAME }}}",
      #if USE_WASM
              codeUrl: "Build/{{{ CODE_FILENAME }}}",
      #endif
      #if SYMBOLS_FILENAME
              symbolsUrl: "Build/{{{ SYMBOLS_FILENAME }}}",
      #endif
              streamingAssetsUrl: "StreamingAssets",
              companyName: {{{ JSON.stringify(COMPANY_NAME) }}},
              productName: {{{ JSON.stringify(PRODUCT_NAME) }}},
              productVersion: {{{ JSON.stringify(PRODUCT_VERSION) }}},
              // 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.
            }).then((unityInstance) => {
      #if SHOW_DIAGNOSTICS
              document.getElementById("diagnostics-icon").onclick = () => {
                  unityDiagnostics.openDiagnosticsDiv(unityInstance.GetMetricsInfo);
              };
      #endif
            }).catch((message) => {
              alert(message);
            });
    </script>
  </body>
</html>
