Files
cocos/assets/scripts/ui/UIMain.ts
刘宇飞 cba5105908 Initial Cocos Creator port of main-site Unity WebGL game.
Includes core gameplay, 600 exported levels, visual assets, web bridge, and bootstrap scene.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-22 14:57:46 +08:00

21 lines
523 B
TypeScript
Raw 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.
import { _decorator, Component } from 'cc';
import { GameManager } from '../manager/GameManager';
const { ccclass } = _decorator;
/** 对应 Unity UIMainJS 可 SendMessage("UIMain", "SetText", ...) */
@ccclass('UIMain')
export class UIMain extends Component {
private textVisible = false;
private textContent = '';
setText(str: string) {
this.textContent = str;
console.log('[UIMain]', str);
}
setTextActive(active: string) {
this.textVisible = active === 'true';
}
}