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

@ccclass('ModulerBase')
export class ModulerBase extends Component {
    init(){

    }
    //刷新
    refresh(){

    }

    //获取管理者中的其他模块
    getModuler<T extends ModulerBase>(type: Constructor<T>): T{
        return GameMgr.Instance.getModuler(type);
    }

    //销毁自己
    removeSelf(){
        this.node.destroy();
        this.clearSelf();
    }

    protected clearSelf(){
        
    }

}