技能继续重构
This commit is contained in:
@@ -9,26 +9,18 @@ const { ccclass, property } = _decorator;
|
||||
export class topComp extends Component {
|
||||
protected onLoad(): void {
|
||||
oops.message.on(GameEvent.GOLD_UPDATE,this.onGoldUpdate,this);
|
||||
this.update_all()
|
||||
}
|
||||
start() {
|
||||
|
||||
}
|
||||
onGoldUpdate(event:string,data:any){
|
||||
this.update_gold(smc.data.gold)
|
||||
tween(this.node.getChildByName("bar").getChildByName("gold").getChildByName("num").getComponent(Label).node)
|
||||
.to(0.1,{scale:v3(1.2,1.2,1)})
|
||||
.to(0.1,{scale:v3(1,1,1)})
|
||||
.start()
|
||||
}
|
||||
update_gold(gold:number){
|
||||
this.node.getChildByName("bar").getChildByName("gold").getChildByName("num").getComponent(Label).string=NumberFormatter.formatNumber(gold);
|
||||
}
|
||||
|
||||
update_all(){
|
||||
this.update_gold(smc.vmdata.gold)
|
||||
}
|
||||
|
||||
|
||||
update(deltaTime: number) {
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user