重构了云函数
This commit is contained in:
@@ -9,8 +9,6 @@ const { ccclass, property } = _decorator;
|
||||
export class topComp extends Component {
|
||||
protected onLoad(): void {
|
||||
oops.message.on(GameEvent.GOLD_UPDATE,this.onGoldUpdate,this);
|
||||
oops.message.on(GameEvent.DIAMOND_UPDATE,this.onDiamondUpdate,this);
|
||||
oops.message.on(GameEvent.MEAT_UPDATE,this.onMeatUpdate,this);
|
||||
this.update_all()
|
||||
}
|
||||
start() {
|
||||
@@ -23,26 +21,12 @@ export class topComp extends Component {
|
||||
.to(0.1,{scale:v3(1,1,1)})
|
||||
.start()
|
||||
}
|
||||
onDiamondUpdate(event:string,data:any){
|
||||
|
||||
}
|
||||
onMeatUpdate(event:string,data:any){
|
||||
|
||||
}
|
||||
|
||||
update_gold(gold:number){
|
||||
this.node.getChildByName("bar").getChildByName("gold").getChildByName("num").getComponent(Label).string=NumberFormatter.formatNumber(gold);
|
||||
}
|
||||
update_diamond(diamond:number){
|
||||
|
||||
}
|
||||
update_meat(meat:number){
|
||||
|
||||
}
|
||||
|
||||
update_all(){
|
||||
this.update_gold(smc.data.gold)
|
||||
this.update_diamond(smc.data.diamond)
|
||||
this.update_meat(smc.data.meat)
|
||||
this.update_gold(smc.vmdata.gold)
|
||||
}
|
||||
|
||||
update(deltaTime: number) {
|
||||
|
||||
Reference in New Issue
Block a user