mirror of
https://github.com/Leo501/CocosCreatorTutorial.git
synced 2026-05-13 09:38:56 +08:00
34 lines
545 B
TypeScript
34 lines
545 B
TypeScript
import GoldRecAnim from "./GoldRecAnim";
|
|
|
|
|
|
const { ccclass, property } = cc._decorator;
|
|
|
|
@ccclass
|
|
export default class GoldViewMgr extends cc.Component {
|
|
|
|
@property(GoldRecAnim)
|
|
recAni: GoldRecAnim = null;
|
|
|
|
@property(cc.Label)
|
|
gold: cc.Label = null;
|
|
|
|
|
|
|
|
onLoad() {
|
|
|
|
}
|
|
|
|
start() {
|
|
|
|
}
|
|
|
|
onClick(event: cc.Event) {
|
|
let count = 5;
|
|
this.recAni.playGoldAni(cc.v2(300, 100), () => {
|
|
this.gold.string = (Number(this.gold.string) + count).toString();
|
|
})
|
|
}
|
|
|
|
// update (dt) {}
|
|
}
|