// 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 "../../mgr/PoolMgr"; const { ccclass, property } = cc._decorator; @ccclass export default class TipItemUI extends cc.Component { @property(cc.Node) node_bg: cc.Label = null; @property(cc.Label) label_tip: cc.Label = null; // LIFE-CYCLE CALLBACKS: // onLoad () {} start() { } // update (dt) {} init(tip: string) { this.node.y = 320; this.node.opacity = 255; this.label_tip.string = tip; cc.tween(this.node) .to(0.5, { y: 420 }) .delay(0.5) .to(0.5, { opacity: 0 }) .call(() => { PoolMgr.Inst.recyclePoolPrefab(NODEPOOLPREFABTYPE.TipItemUI, this.node); }) .start(); } }