コード例 #1
0
ファイル: GameFramework.cs プロジェクト: isoundy000/FPSDemo
    public virtual void init()
    {
        // 必须先初始化配置文件
        mApplicationConfig.init();
        mDllImportExtern.init();
        mFrameConfig.init();
        mDataBase.init();
        mResourceManager.init();
        mShaderManager.init();
        mBinaryUtility.init();
        mFileUtility.init();
        mMathUtility.init();
        mStringUtility.init();
        mUnityUtility.init();
        mPluginUtility.init();
        mGlobalTouchSystem.init();
        mAudioManager.init();
        mLayoutManager.init();
        bool showDebug = (int)mFrameConfig.getFloatParam(GAME_DEFINE_FLOAT.GDF_SHOW_COMMAND_DEBUG_INFO) != 0;

        mCommandSystem.init(showDebug);
        mGameSceneManager.init();
        mCharacterManager.init();
        mKeyFrameManager.init();
        mCameraManager.init();
        mLayoutPrefabManager.init();
        mModelManager.init();
        System.Net.ServicePointManager.DefaultConnectionLimit = 200;
        int width      = (int)mApplicationConfig.getFloatParam(GAME_DEFINE_FLOAT.GDF_SCREEN_WIDTH);
        int height     = (int)mApplicationConfig.getFloatParam(GAME_DEFINE_FLOAT.GDF_SCREEN_HEIGHT);
        int fullscreen = (int)mApplicationConfig.getFloatParam(GAME_DEFINE_FLOAT.GDF_FULL_SCREEN);

        Screen.SetResolution(width, height, fullscreen == 1);
        int screenCount = (int)mApplicationConfig.getFloatParam(GAME_DEFINE_FLOAT.GDF_SCREEN_COUNT);

        processResolution(width, height, screenCount);
        // 设置为无边框窗口
        if (fullscreen == 2)
        {
            User32.SetWindowLong(User32.GetForegroundWindow(), -16, CommonDefine.WS_POPUP | CommonDefine.WS_VISIBLE);
        }
    }
コード例 #2
0
ファイル: GameFramework.cs プロジェクト: microxw/MaQ
    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());
    }