Files
cocos/web-template/index.html
刘宇飞 d393302388 Complete Cocos Creator port with level bundles, themes, and tooling.
Adds level prefabs, theme assets, audio, extensions, and deployment scripts for the Unity WebGL migration.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-16 15:30:58 +08:00

32 lines
991 B
HTML
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="utf-8" />
<title>主站 Cocos Web</title>
<style>
html, body {
margin: 0; padding: 0; min-height: 100%;
background: #1a1a2e;
display: flex; flex-direction: column; align-items: center;
}
/* 与 Unity Web 模板一致:桌面固定 960×600 */
#GameDiv { width: 960px; height: 600px; flex-shrink: 0; }
#bar { color: #fff; font-family: sans-serif; padding: 8px; width: 960px; }
</style>
</head>
<body>
<div id="bar">加载中…</div>
<div id="GameDiv"></div>
<!-- 与 Unity Template 一致:先挂 JS 回调,再启动 Cocos -->
<script src="cocos-bridge.js"></script>
<script>
// 主站可覆写钩子接收关卡 ID
window.__tfrhOnExternalLevelInfo = function (json) {
const data = JSON.parse(json);
console.log('关卡就绪 LevelID=', data.LevelID, data);
};
</script>
<!-- 构建后将 Cocos 生成的 index.js 引入此页 -->
</body>
</html>