示例#1
0
文件: GameRoot.cs 项目: kylen233/ARpg
    private void Init()
    {
        //服务模块初始化
        ResSvc resSvc = GetComponent <ResSvc>();

        resSvc.Init();
        AudioSvc audioSvc = GetComponent <AudioSvc>();

        audioSvc.Init();
        //业务系统初始化
        LoginSys loginSys = GetComponent <LoginSys>();

        loginSys.Init();
        //进入登录场景并加载UI
        loginSys.EnterLogin();
    }
示例#2
0
    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();
    }