import { _decorator } from "cc";
import { PropBase } from "./PropBase";
import { Snake } from "db://assets/Scripts/Scenes/MainGame/Snake";
import { LuckyBagManager } from "db://assets/Scripts/Scenes/MainGame/Manager/LuckyBagManager";

const { ccclass, property } = _decorator;

@ccclass("LuckyBag")
export class LuckyBag extends PropBase {

    beEaten = (target: Snake) => {
        target.luckNum += 1;
    };

    recycle() {
        super.recycle();
        LuckyBagManager.ins.check();
        this.node.removeFromParent();
        this.node.destroy();
        // propPool.put(this.node);
    }

}