コード例 #1
0
ファイル: GameRoot.cs プロジェクト: luweiDavid/DarkGod
    private void Init()
    {
        #region  所有UI界面的获取, 本项目暂时没有做资源加载的框架
        mUIRootTr       = transform.Find("UIRoot");
        mLoadingWnd     = transform.Find("UIRoot/LoadingWnd").GetComponent <LoadingWnd>();
        mLoginWnd       = transform.Find("UIRoot/LoginWnd").GetComponent <LoginWnd>();
        mDynamicTipsWnd = transform.Find("UIRoot/DynamicTips").GetComponent <DynamicTipsWnd>();
        mCreateWnd      = transform.Find("UIRoot/CreateWnd").GetComponent <CreateWnd>();
        mMainWnd        = transform.Find("UIRoot/MainWnd").GetComponent <MainWnd>();
        mActorInfoWnd   = transform.Find("UIRoot/ActorInfoWnd").GetComponent <ActorInfoWnd>();
        mGuideWnd       = transform.Find("UIRoot/GuideWnd").GetComponent <GuideWnd>();
        mStrongWnd      = transform.Find("UIRoot/StrongWnd").GetComponent <StrongWnd>();
        mChatWnd        = transform.Find("UIRoot/ChatWnd").GetComponent <ChatWnd>();
        mCommonBuyWnd   = transform.Find("UIRoot/CommonBuyWnd").GetComponent <CommonBuyWnd>();
        mFuBenWnd       = transform.Find("UIRoot/FuBenWnd").GetComponent <FuBenWnd>();
        mPlayerCtrlWnd  = transform.Find("UIRoot/PlayerCtrlWnd").GetComponent <PlayerCtrlWnd>();

        #endregion

        #region   务层初始化
        mCfgSvc = GetComponent <CfgSvc>();
        mCfgSvc.Init();
        mResSvc = GetComponent <ResSvc>();
        mResSvc.Init();
        mAudioSvc = GetComponent <AudioSvc>();
        mAudioSvc.Init();
        mNetSvc = GetComponent <NetSvc>();
        mNetSvc.Init();
        mTimerSvc = GetComponent <TimerSvc>();
        mTimerSvc.Init();
        #endregion

        #region  业务层初始化
        mLoginSys = GetComponent <LoginSys>();
        mLoginSys.Init();
        mMainCitySys = GetComponent <MainCitySys>();
        mMainCitySys.Init();
        mFuBenSys = GetComponent <FuBenSys>();
        mFuBenSys.Init();
        mBattleSys = GetComponent <BattleSys>();
        mBattleSys.Init();
        #endregion

        InitUIRoot();
        mLoginSys.EnterLogin();
    }