// Learn cc.Class:
//  - https://docs.cocos.com/creator/manual/en/scripting/class.html
// Learn Attribute:
//  - https://docs.cocos.com/creator/manual/en/scripting/reference/attributes.html
// Learn life-cycle callbacks:
//  - https://docs.cocos.com/creator/manual/en/scripting/life-cycle-callbacks.html

cc.Class({
    extends: cc.Component,

    properties: {
        // foo: {
        //     // ATTRIBUTES:
        //     default: null,        // The default value will be used only when the component attaching
        //                           // to a node for the first time
        //     type: cc.SpriteFrame, // optional, default is typeof default
        //     serializable: true,   // optional, default is true
        // },
        // bar: {
        //     get () {
        //         return this._bar;
        //     },
        //     set (value) {
        //         this._bar = value;
        //     }
        // },
    },

    // LIFE-CYCLE CALLBACKS:

    // onLoad () {},

    start() {

    },

    // update (dt) {},
    //切换用户界面 当前界面。 目标界面
    change_interface(Arr_interface, index) {
        console.log("切换");
        for (let i = 0; i < Arr_interface.length; i++) {
            console.log(i, '/', Arr_interface.length);
            if (i == index) {
                // if (Arr_interface[i].active) {
                //     this.interfacaArr[i].active = false;
                //     this.interfacaArr[0].active = true;
                //     return;
                // }
                Arr_interface[i].active = true;
            } else {
                Arr_interface[i].active = false;
            }

        }
        // cur_interface.active = false;
        // let node = cc.instantiate(tar_interface);
        // parentnode.addChild(node);


    }
    //
});