import Panel from "../../Module/Panel";
import { _decorator, Button, Label, Node } from "cc";
import Svga from "../../Component/Svga/Svga";

const {ccclass, property} = _decorator;

@ccclass('BoxPanel')
export default class BoxPanel extends Panel {

    static bundle: string = "";
    static skin = "BoxPanel";
    static group = "BoxPanel";

    @property(Node)
    boxAni: Node = null!;

    async start() {
        // this.node.on(Node.EventType.TOUCH_END, this.onOk, this);
        this.boxAni.on(Svga.EventType.END_FRAME, this.onOk, this);
    }

    onOk = () => {
        this.hidePanel();
        this.data.openBox();
    }

}
