Exemplo n.º 1
0
 public override void init()
 {
     base.init();
     mSocketManager.init();
     mGameConfig.init();
     mGameUtility.init();
     mMaterialManager.init();
     mHeadTextureManager.init();
     mMahjongSystem.init();
 }
Exemplo n.º 2
0
    protected bool mPauseFrame = false;                                                          // 暂停整个程序
    public void Start()
    {
        Screen.SetResolution(1920, 1080, true);
        instance             = this;
        mGameFrameObject     = this.transform.gameObject;
        mApplicationConfig   = new ApplicationConfig();
        mGameConfig          = new GameConfig();
        mGameUtility         = new GameUtility();
        mBinaryUtility       = new BinaryUtility();
        mFileUtility         = new FileUtility();
        mMathUtility         = new MathUtility();
        mStringUtility       = new StringUtility();
        mUnityUtility        = new UnityUtility();
        mCommandSystem       = new CommandSystem();
        mLayoutManager       = new GameLayoutManager();
        mAudioManager        = new AudioManager();
        mGameSceneManager    = new GameSceneManager();
        mCharacterManager    = new CharacterManager();
        mSocketManager       = new SocketManager();
        mKeyFrameManager     = new KeyFrameManager();
        mGlobalTouchSystem   = new GlobalTouchSystem();
        mDllImportExtern     = new DllImportExtern();
        mShaderManager       = new ShaderManager();
        mDataBase            = new DataBase();
        mHttpServerManager   = new HttpServerManager();
        mMahjongSystem       = new MahjongSystem();
        mCameraManager       = new CameraManager();
        mResourcesManager    = new ResourceManager();
        mLayoutPrefabManager = new LayoutPrefabManager();
        mMaterialManager     = new MaterialManager();
        mPlayerHeadManager   = new PlayerHeadManager();

        // 所有类都构造完成后通知GameBase
        GameBase.notifyConstructDone();

        // 必须先初始化配置文件
        mApplicationConfig.init();
        int  width      = (int)mApplicationConfig.getFloatParam(GAME_DEFINE_FLOAT.GDF_SCREEN_WIDTH);
        int  height     = (int)mApplicationConfig.getFloatParam(GAME_DEFINE_FLOAT.GDF_SCREEN_HEIGHT);
        bool fullscreen = (int)mApplicationConfig.getFloatParam(GAME_DEFINE_FLOAT.GDF_FULL_SCREEN) != 0;

        Screen.SetResolution(width, height, fullscreen);
        mGameConfig.init();
        mResourcesManager.init();
        mShaderManager.init();
        mDllImportExtern.init();
        mGameUtility.init();
        mBinaryUtility.init();
        mFileUtility.init();
        mMathUtility.init();
        mStringUtility.init();
        mUnityUtility.init();
        mGlobalTouchSystem.init();
        mAudioManager.init();
        mLayoutManager.init();
        bool showDebug = mGameConfig.getFloatParam(GAME_DEFINE_FLOAT.GDF_SHOW_COMMAND_DEBUG_INFO) > 0.0f;

        mCommandSystem.init(showDebug);
        mGameSceneManager.init();
        mCharacterManager.init();
        mSocketManager.init();
        mKeyFrameManager.init();
        mDataBase.init();
        mMahjongSystem.init();
        mHttpServerManager.init("", "", "");
        mCameraManager.init();
        mLayoutPrefabManager.init();
        mMaterialManager.init();
        mPlayerHeadManager.init();

        CommandGameSceneManagerEnter cmd = mCommandSystem.newCmd <CommandGameSceneManagerEnter>(false, false);

        cmd.mSceneType = GAME_SCENE_TYPE.GST_START;
        mCommandSystem.pushCommand(cmd, getGameSceneManager());
    }