import { _decorator, Component, misc, Node } from 'cc';
import { config } from './config';
const { ccclass, property } = _decorator;

@ccclass('select_res_type')
export class select_res_type extends Component {
    @property(Node) btn_dj:Node = null;
    @property(Node) btn_bj:Node = null;
    @property(Node) btn_zj:Node = null;
    private m_type = config.select_res_btn_type.ITEM_LIST;
    private m_call = null;
    public initView(call){
        this.m_call = call;
        this.btn_bj.on(Node.EventType.TOUCH_END,()=>{
            this.m_type =  config.select_res_btn_type.BG_LIST;
            this.enter();
        })
        this.btn_dj.on(Node.EventType.TOUCH_END,()=>{
            this.m_type =  config.select_res_btn_type.ITEM_LIST;
            this.enter();
        })
        this.btn_zj.on(Node.EventType.TOUCH_END,()=>{
            this.m_type =  config.select_res_btn_type.COMPONENT_LIST;
            this.enter();
        })
    }

    enter(){
        if(this.m_call!=null){
            this.m_call(this.m_type)
        }
    }

}


