コード例 #1
0
 public virtual void start()
 {
     mPauseFrame          = false;
     instance             = this;
     mGameFrameObject     = this.transform.gameObject;
     mApplicationConfig   = new ApplicationConfig();
     mResourceManager     = new ResourceManager();
     mBinaryUtility       = new BinaryUtility();
     mFileUtility         = new FileUtility();
     mMathUtility         = new MathUtility();
     mStringUtility       = new StringUtility();
     mUnityUtility        = new UnityUtility();
     mPluginUtility       = new PluginUtility();
     mCommandSystem       = new CommandSystem();
     mLayoutManager       = new GameLayoutManager();
     mAudioManager        = new AudioManager();
     mGameSceneManager    = new GameSceneManager();
     mCharacterManager    = new CharacterManager();
     mKeyFrameManager     = new KeyFrameManager();
     mGlobalTouchSystem   = new GlobalTouchSystem();
     mDllImportExtern     = new DllImportExtern();
     mShaderManager       = new ShaderManager();
     mDataBase            = new DataBase();
     mCameraManager       = new CameraManager();
     mLayoutPrefabManager = new LayoutPrefabManager();
     mFrameConfig         = new FrameConfig();
 }
コード例 #2
0
ファイル: GameFramework.cs プロジェクト: microxw/MaQ
 public void OnDestroy()
 {
     mLayoutPrefabManager.destroy();
     mMahjongSystem.destroy();
     mSocketManager.destroy();
     mCharacterManager.destroy();
     mGameSceneManager.destroy();
     mAudioManager.destroy();
     mLayoutManager.destroy();
     mCommandSystem.destroy();
     mGameConfig.destory();
     mKeyFrameManager.destroy();
     mHttpServerManager.destroy();
     mGlobalTouchSystem.destroy();
     mDllImportExtern.destroy();
     mShaderManager.destroy();
     mDataBase.destroy();
     mCameraManager.destroy();
     mResourcesManager.destroy();
     mMaterialManager.destroy();
     mApplicationConfig.destory();
     mPlayerHeadManager.destroy();
     mLayoutPrefabManager = null;
     mMahjongSystem       = null;
     mGameConfig          = null;
     mGameUtility         = null;
     mBinaryUtility       = null;
     mFileUtility         = null;
     mMathUtility         = null;
     mStringUtility       = null;
     mUnityUtility        = null;
     mCommandSystem       = null;
     mLayoutManager       = null;
     mAudioManager        = null;
     mGameSceneManager    = null;
     mCharacterManager    = null;
     mSocketManager       = null;
     mKeyFrameManager     = null;
     mGlobalTouchSystem   = null;
     mDllImportExtern     = null;
     mShaderManager       = null;
     mDataBase            = null;
     mCameraManager       = null;
     mResourcesManager    = null;
     mMaterialManager     = null;
     mApplicationConfig   = null;
     mPlayerHeadManager   = null;
 }
コード例 #3
0
 public virtual void notifyConstructDone()
 {
     if (mGameFramework == null)
     {
         mGameFramework       = GameFramework.instance;
         mCommandSystem       = mGameFramework.getCommandSystem();
         mAudioManager        = mGameFramework.getAudioManager();
         mGameSceneManager    = mGameFramework.getGameSceneManager();
         mCharacterManager    = mGameFramework.getCharacterManager();
         mLayoutManager       = mGameFramework.getLayoutManager();
         mKeyFrameManager     = mGameFramework.getKeyFrameManager();
         mGlobalTouchSystem   = mGameFramework.getGlobalTouchSystem();
         mShaderManager       = mGameFramework.getShaderManager();
         mDataBase            = mGameFramework.getDataBase();
         mCameraManager       = mGameFramework.getCameraManager();
         mResourceManager     = mGameFramework.getResourceManager();
         mLayoutPrefabManager = mGameFramework.getLayoutPrefabManager();
         mApplicationConfig   = mGameFramework.getApplicationConfig();
         mFrameConfig         = mGameFramework.getFrameConfig();
     }
 }
コード例 #4
0
ファイル: GameFramework.cs プロジェクト: isoundy000/FPSDemo
 public virtual void destroy()
 {
     mLayoutPrefabManager.destroy();
     mCharacterManager.destroy();
     mGameSceneManager.destroy();
     mAudioManager.destroy();
     mLayoutManager.destroy();
     mCommandSystem.destroy();
     mKeyFrameManager.destroy();
     mGlobalTouchSystem.destroy();
     mDllImportExtern.destroy();
     mShaderManager.destroy();
     mDataBase.destroy();
     mCameraManager.destroy();
     mPluginUtility.destroy();
     mModelManager.destroy();
     mResourceManager.destroy();                 // 资源管理器必须最后销毁,作为最后的资源清理
     mLayoutPrefabManager = null;
     mResourceManager     = null;
     mBinaryUtility       = null;
     mFileUtility         = null;
     mMathUtility         = null;
     mStringUtility       = null;
     mUnityUtility        = null;
     mPluginUtility       = null;
     mCommandSystem       = null;
     mLayoutManager       = null;
     mAudioManager        = null;
     mGameSceneManager    = null;
     mCharacterManager    = null;
     mKeyFrameManager     = null;
     mGlobalTouchSystem   = null;
     mDllImportExtern     = null;
     mShaderManager       = null;
     mDataBase            = null;
     mCameraManager       = null;
     mModelManager        = null;
 }
コード例 #5
0
 public static void notifyConstructDone()
 {
     if (mGameFramework == null)
     {
         mGameFramework       = GameFramework.instance;
         mCommandSystem       = mGameFramework.getCommandSystem();
         mAudioManager        = mGameFramework.getAudioManager();
         mGameSceneManager    = mGameFramework.getGameSceneManager();
         mCharacterManager    = mGameFramework.getCharacterManager();
         mLayoutManager       = mGameFramework.getLayoutManager();
         mSocketNetManager    = mGameFramework.getSocketManager();
         mKeyFrameManager     = mGameFramework.getKeyFrameManager();
         mGlobalTouchSystem   = mGameFramework.getGlobalTouchSystem();
         mShaderManager       = mGameFramework.getShaderManager();
         mDataBase            = mGameFramework.getDataBase();
         mMahjongSystem       = mGameFramework.getMahjongSystem();
         mResourceManager     = mGameFramework.getResourceManager();
         mCameraManager       = mGameFramework.getCameraManager();
         mLayoutPrefabManager = mGameFramework.getLayoutPrefabManager();
         mGameConfig          = mGameFramework.getGameConfig();
         mMaterialManager     = mGameFramework.getMaterialManager();
         mPlayerHeadManager   = mGameFramework.getPlayerHeadManager();
     }
 }
コード例 #6
0
 public virtual void notifyConstructDone()
 {
     if (mGameFramework == null)
     {
         mGameFramework       = GameFramework.instance;
         mCommandSystem       = mGameFramework.getSystem <CommandSystem>();
         mAudioManager        = mGameFramework.getSystem <AudioManager>();
         mGameSceneManager    = mGameFramework.getSystem <GameSceneManager>();
         mCharacterManager    = mGameFramework.getSystem <CharacterManager>();
         mLayoutManager       = mGameFramework.getSystem <GameLayoutManager>();
         mKeyFrameManager     = mGameFramework.getSystem <KeyFrameManager>();
         mGlobalTouchSystem   = mGameFramework.getSystem <GlobalTouchSystem>();
         mShaderManager       = mGameFramework.getSystem <ShaderManager>();
         mDataBase            = mGameFramework.getSystem <DataBase>();
         mCameraManager       = mGameFramework.getSystem <CameraManager>();
         mResourceManager     = mGameFramework.getSystem <ResourceManager>();
         mLayoutPrefabManager = mGameFramework.getSystem <LayoutPrefabManager>();
         mApplicationConfig   = mGameFramework.getSystem <ApplicationConfig>();
         mFrameConfig         = mGameFramework.getSystem <FrameConfig>();
         mModelManager        = mGameFramework.getSystem <ModelManager>();
         mInputManager        = mGameFramework.getSystem <InputManager>();
         mSceneSystem         = mGameFramework.getSceneSystem();
     }
 }
コード例 #7
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());
    }