// 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 BuyProAdd 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('upFadePro', 0) this.ani.on(cc.Animation.EventType.FINISHED, this.onFinish, this) this.lab.string = str } onFinish() { //FC:- //this.node.destroy() this.ani.off(cc.Animation.EventType.FINISHED, this.onFinish, this) //FC:+ 对象池 PoolMgr.Inst.recyclePoolPrefab(NODEPOOLPREFABTYPE.BuyProAdd, this.node); } // update (dt) {} }