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();
        this.node.removeFromParent();
        this.node.destroy();
        LuckyBagManager.ins.check();
        // propPool.put(this.node);
    }

}