| 1234567891011121314151617181920212223242526272829303132333435363738 |
- // Learn TypeScript:
- // - https://docs.cocos.com/creator/manual/en/scripting/typescript.html
- // Learn Attribute:
- // - https://docs.cocos.com/creator/manual/en/scripting/reference/attributes.html
- // Learn life-cycle callbacks:
- // - https://docs.cocos.com/creator/manual/en/scripting/life-cycle-callbacks.html
- import PoolMgr, { NODEPOOLPREFABTYPE } from "../manager/PoolMgr";
- const { ccclass, property } = cc._decorator;
- @ccclass
- export default class DailyCashProAdd extends cc.Component {
- @property(cc.Label)
- lab: cc.Label = null;
- @property(cc.Animation)
- ani: cc.Animation = null;
- // onLoad () {}
- start() {
- }
- init(str: string) {
- this.ani.play("upFadeC", 0);
- this.ani.on(cc.Animation.EventType.FINISHED, this.onFinish, this)
- this.lab.string = str;
- }
- onFinish() {
- this.ani.off(cc.Animation.EventType.FINISHED, this.onFinish, this)
- PoolMgr.Inst.recyclePoolPrefab(NODEPOOLPREFABTYPE.DailyCashProAdd, this.node);
- }
- // update (dt) {}
- }
|