// 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 GetTargetScoreTip extends cc.Component {

    // LIFE-CYCLE CALLBACKS:

    // onLoad () {}

    start() {

    }

    // update (dt) {}

    onEnable() {
        this.node.scaleX = this.node.scaleY = 0;
        cc.tween(this.node).to(0.5, { scale: 1 }, { easing: "backOut" })
            .delay(0.5)
            .to(0.1, { scale: 1.2 })
            .to(0.2, { scale: 0 })
            .call(() => {
                PoolMgr.Inst.recyclePoolPrefab(NODEPOOLPREFABTYPE.GetTargetScoreTip, this.node);
            })
            .start();
    }
}
