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>
This commit is contained in:
20
assets/scripts/ui/UIMain.ts
Normal file
20
assets/scripts/ui/UIMain.ts
Normal file
@@ -0,0 +1,20 @@
|
||||
import { _decorator, Component } from 'cc';
|
||||
import { GameManager } from '../manager/GameManager';
|
||||
|
||||
const { ccclass } = _decorator;
|
||||
|
||||
/** 对应 Unity UIMain,JS 可 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';
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user