import { _decorator, Component, Node } from 'cc';
import { PropBase } from './PropBase';
import { Snake } from '../Snake';
import { PropManager } from '../Manager/PropManager';
const { ccclass, property } = _decorator;

@ccclass('Defense')
export class Defense extends PropBase {
    start() {

    }


    beEaten(target: Snake) {
        target.useDefense();
    }

    update(deltaTime: number) {

    }
    recycle(): void {
        super.recycle()
        this.node.removeFromParent();
        this.node.destroy();
        PropManager.ins.check();
    }
}

