<!DOCTYPE html>
<html lang="zh-CN">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>loading error</title>
  <style>
    /* 弹窗容器样式 */
    .modal {
      display: none;
      position: fixed;
      top: 0;
      left: 0;
      width: 100%;
      height: 100%;
      background-color: rgba(0, 0, 0, 0.5);
      justify-content: center;
      align-items: center;
    }

    /* 弹窗内容样式 */
    .modal-content {
      background-color: #fff;
      padding: 50px;
      border-radius: 8px;
      width: 240px;
      text-align: center;
      box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
      position: relative;
    }

    /* 关闭按钮样式 */
    .close {
      position: absolute;
      top: 10px;
      right: 20px;
      font-size: 20px;
      cursor: pointer;
    }

    /* 重试按钮样式 */
    .retry-btn {
      background-color: #f0ad4e;
      color: #fff;
      border: none;
      padding: 8px 16px;
      border-radius: 4px;
      cursor: pointer;
      margin-top: 30px;
    }
  </style>
</head>

<body>
  <!-- 弹窗 -->
  <div class="modal" id="myModal">
    <div class="modal-content">
      <span class="close" onclick="closeClick()">&times;</span>
      <p>加载失败，请重试</p>
      <button class="retry-btn" onclick="retry()">重试</button>
    </div>
  </div>

  <script>
    // 获取弹窗元素
    var modal = document.getElementById("myModal");
    modal.style.display = "flex";
    
    function closeClick() {
       u3d_func('loading_err_close', {});
    }

    // 重试函数，实际场景中这里写重试的逻辑
    function retry() {
      u3d_func('loading_err_retry', {});
    }

    // Unity调用JavaScript函数
    function unityToJsLoadErr(str)
    {
        modal.style.display = "none";
    }
  </script>
</body>

</html>