// Learn TypeScript:
//  - https://docs.cocos.com/creator/manual/en/scripting/typescript.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

import GUIManager from "./GUIManager";

const {ccclass, property} = cc._decorator;

@ccclass
export default class GUIMediator extends cc.Component {
    uiKey:number;
    data:any;

    OnShow(data?:any):void{
        this.data=data;
    }

    OnHide():void{

    }

    /**
     * 关闭自己
     */
    HideSelf():void{
        GUIManager.single.Hide(this.uiKey);
    }

    get LayerIndex(){
        return 3;
    }
}
