import { eventTarget, SHOW_ACTION_SCREEN, SHOW_CARD_POPUP } from "../Events";
import BuaController from "../GamePlay/BuaController";

const { ccclass, property } = cc._decorator;

@ccclass
export default class ActionScreen extends cc.Component {

    private _buaController: BuaController = null;

    onLoad() {
        this.node.position = cc.v3();
        this.node.active = false;
        eventTarget.on(SHOW_ACTION_SCREEN, this.showScreen, this);
        this._buaController = this.getComponentInChildren(BuaController);
    }

    private showScreen() {
        this.node.active = true;
        this._buaController.onSetTool();
    }

}
