30 lines
852 B
TypeScript
30 lines
852 B
TypeScript
import { _decorator, Component, Label, Node, tween, v3 } from 'cc';
|
|
import { GameEvent } from '../common/config/GameEvent';
|
|
import { smc } from '../common/SingletonModuleComp';
|
|
import { BoxSet, NumberFormatter } from '../common/config/BoxSet';
|
|
import { oops } from 'db://oops-framework/core/Oops';
|
|
const { ccclass, property } = _decorator;
|
|
|
|
@ccclass('topComp')
|
|
export class topComp extends Component {
|
|
protected onLoad(): void {
|
|
oops.message.on(GameEvent.GOLD_UPDATE,this.onGoldUpdate,this);
|
|
}
|
|
start() {
|
|
|
|
}
|
|
onGoldUpdate(event:string,data:any){
|
|
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(deltaTime: number) {
|
|
|
|
}
|
|
}
|
|
|
|
|