DailyCashProAdd.ts 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. // Learn TypeScript:
  2. // - https://docs.cocos.com/creator/manual/en/scripting/typescript.html
  3. // Learn Attribute:
  4. // - https://docs.cocos.com/creator/manual/en/scripting/reference/attributes.html
  5. // Learn life-cycle callbacks:
  6. // - https://docs.cocos.com/creator/manual/en/scripting/life-cycle-callbacks.html
  7. import PoolMgr, { NODEPOOLPREFABTYPE } from "../manager/PoolMgr";
  8. const { ccclass, property } = cc._decorator;
  9. @ccclass
  10. export default class DailyCashProAdd extends cc.Component {
  11. @property(cc.Label)
  12. lab: cc.Label = null;
  13. @property(cc.Animation)
  14. ani: cc.Animation = null;
  15. // onLoad () {}
  16. start() {
  17. }
  18. init(str: string) {
  19. this.ani.play("upFadeC", 0);
  20. this.ani.on(cc.Animation.EventType.FINISHED, this.onFinish, this)
  21. this.lab.string = str;
  22. }
  23. onFinish() {
  24. this.ani.off(cc.Animation.EventType.FINISHED, this.onFinish, this)
  25. PoolMgr.Inst.recyclePoolPrefab(NODEPOOLPREFABTYPE.DailyCashProAdd, this.node);
  26. }
  27. // update (dt) {}
  28. }