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>
This commit is contained in:
@@ -3,6 +3,13 @@
|
||||
* Web 环境下调用 window 上的全局回调
|
||||
*/
|
||||
|
||||
/** 对齐 Unity GameManager.ExternalLevelInfo(关卡加载完成时回传) */
|
||||
export interface ExternalLevelInfo {
|
||||
LevelID: number;
|
||||
PlayerName: string;
|
||||
VehicleName: string;
|
||||
}
|
||||
|
||||
declare global {
|
||||
interface Window {
|
||||
processData?: (json: string) => void;
|
||||
@@ -10,6 +17,8 @@ declare global {
|
||||
externalResult?: (json: string) => void;
|
||||
externalLevelInfo?: (json: string) => void;
|
||||
coinsData?: (json: string) => void;
|
||||
/** 主站对接:cocos-bridge.js 可选钩子 */
|
||||
__tfrhOnExternalLevelInfo?: (json: string) => void;
|
||||
[key: string]: unknown;
|
||||
}
|
||||
}
|
||||
@@ -25,4 +34,10 @@ export class JsBridge {
|
||||
}
|
||||
console.log(`[JsBridge] ${callbackName}`, jsonData);
|
||||
}
|
||||
|
||||
/** Unity ExternalCallLevelInfo → Application.ExternalCall("externalLevelInfo", json) */
|
||||
static notifyExternalLevelInfo(info: ExternalLevelInfo) {
|
||||
const json = JSON.stringify(info);
|
||||
this.call('externalLevelInfo', json);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user