Esempio n. 1
0
    //-------------------------------------------------------------------------
    void _destory()
    {
        if (mEngine == null)
        {
            return;
        }

        if (mEngine != null)
        {
            mEngine.close();
            mEngine = null;
        }

        if (UiMgr != null)
        {
            UiMgr.destroy();
            UiMgr = null;
        }

        if (mSoundMgr != null)
        {
            mSoundMgr.destroy();
            mSoundMgr = null;
        }

        if (mAsyncLoadAssetMgr != null)
        {
            mAsyncLoadAssetMgr.destory();
            mAsyncLoadAssetMgr = null;
        }

        Screen.sleepTimeout = SleepTimeout.SystemSetting;

        EbLog.Note("MbMain._destory()");
    }
Esempio n. 2
0
    //-------------------------------------------------------------------------
    void Start()
    {
        // 初始化系统参数
        {
            Application.runInBackground = true;
            Time.fixedDeltaTime         = 0.03f;
            Application.targetFrameRate = 60;
            Screen.sleepTimeout         = SleepTimeout.NeverSleep;
        }

        // 初始化日志
        {
            EbLog.NoteCallback    = Debug.Log;
            EbLog.WarningCallback = Debug.LogWarning;
            EbLog.ErrorCallback   = Debug.LogError;
        }

        EbLog.Note("MbMain.Start()");

        // 初始化PathMgr
        if (mPathMgr == null)
        {
            mPathMgr = new PathMgr();
        }

        if (mClientConfig == null)
        {
            mClientConfig = new ClientConfig();
        }

        if (mAsyncLoadAssetMgr == null)
        {
            mAsyncLoadAssetMgr = new AsyncLoadAssetMgr();
            mAsyncLoadAssetMgr.init();
        }

        if (mEngine == null)
        {
            EcEngineSettings settings;
            settings.ProjectName         = "Fishing";
            settings.RootEntityType      = "EtRoot";
            settings.EnableCoSuperSocket = true;
            mEngine = new EcEngine(ref settings, new EcEngineListener());
        }

        UiMgr = new UiMgr();
        UiMgr.create(EntityMgr.Instance);

        mSoundMgr = new CSoundMgr();

        // 创建EtClientApp
        EntityMgr.Instance.createEntity <EtApp>(null, EcEngine.Instance.EtNode);
    }
Esempio n. 3
0
    //-------------------------------------------------------------------------
    void _destory()
    {
        if (mEngine == null) return;

        if (mEngine != null)
        {
            mEngine.close();
            mEngine = null;
        }

        if (UiMgr != null)
        {
            UiMgr.destroy();
            UiMgr = null;
        }

        if (mSoundMgr != null)
        {
            mSoundMgr.destroy();
            mSoundMgr = null;
        }

        if (mAsyncLoadAssetMgr != null)
        {
            mAsyncLoadAssetMgr.destory();
            mAsyncLoadAssetMgr = null;
        }

        Screen.sleepTimeout = SleepTimeout.SystemSetting;

        EbLog.Note("MbMain._destory()");
    }
Esempio n. 4
0
    //-------------------------------------------------------------------------
    void Start()
    {
        // 初始化系统参数
        {
            Application.runInBackground = true;
            Time.fixedDeltaTime = 0.03f;
            Application.targetFrameRate = 60;
            Screen.sleepTimeout = SleepTimeout.NeverSleep;
        }

        // 初始化日志
        {
            EbLog.NoteCallback = Debug.Log;
            EbLog.WarningCallback = Debug.LogWarning;
            EbLog.ErrorCallback = Debug.LogError;
        }

        EbLog.Note("MbMain.Start()");

        // 初始化PathMgr
        if (mPathMgr == null)
        {
            mPathMgr = new PathMgr();
        }

        if (mClientConfig == null)
        {
            mClientConfig = new ClientConfig();
        }

        if (mAsyncLoadAssetMgr == null)
        {
            mAsyncLoadAssetMgr = new AsyncLoadAssetMgr();
            mAsyncLoadAssetMgr.init();
        }

        if (mEngine == null)
        {
            EcEngineSettings settings;
            settings.ProjectName = "Fishing";
            settings.RootEntityType = "EtRoot";
            mEngine = new EcEngine(ref settings, new EcEngineListener());
        }

        UiMgr = new UiMgr();
        UiMgr.create(EntityMgr.Instance);

        mSoundMgr = new CSoundMgr();

        // 创建EtClientApp
        EntityMgr.Instance.createEntity<EtApp>(null, EcEngine.Instance.EtNode);
    }