cb/assets/Script/Uid.ts
YZ\249929363 ccf1c5e7f8 提交
2025-07-22 11:12:39 +08:00

34 lines
689 B
TypeScript

import NumberToImage from "./NumberToImage";
const { ccclass, property, requireComponent } = cc._decorator;
@ccclass
export default class Uid extends cc.Component {
static _instance: any;
@property(cc.Label)
uid_Number: cc.Label = null;
onLoad() {
// 为节点添加点击事件监听器
if (Uid._instance == null) {
Uid._instance = this;
cc.game.addPersistRootNode(this.node);
}
else {
return;
}
if (cc.fx.GameConfig.GM_INFO.userId > 0) {
this.uid_Number.string = cc.fx.GameConfig.GM_INFO.userId;
}
}
start() {
// ... 已有代码 ...
}
}