cc.Class({
    extends: cc.Component,

    properties: {
        setAnswerId: {
            default: "",
            displayName: "类型ID"
        },

        labTitle: {
            default: null,
            type: cc.Label,
            displayName: "标题"
        },
    },

    onLoad() {
        this.labTitle.string = g.data_mgr.getSheepfold(this.setAnswerId).word;

        this.Event();

    },
    Event() {
        this.m_uuid = g.utils.generateUUID(); //生成一个唯一Id

        g.event_mgr.reg("reSetGame", () => {
            this.node.getChildByName("Layout").removeAllChildren()
        }, this.m_uuid);
    },

    start() {

    },

    setAABB() {
        var node = this.node

        let svLeftBottomPoint = node.parent.convertToWorldSpaceAR(
            cc.v2(
                node.x - node.width / 2,
                node.y - node.height / 2,
            )
        );
        console.log("世界坐标目标点" + svLeftBottomPoint);


        // 求出 ScrollView 可视区域在世界坐标系中的矩形（碰撞盒）
        let svBBoxRect = cc.rect(
            svLeftBottomPoint.x,
            svLeftBottomPoint.y,
            node.width,
            node.height
        );
        // console.log(Id + ":" + svLeftBottomPoint.x + "," + svLeftBottomPoint.y);
        return svBBoxRect
    },
});
