コード例 #1
0
    //---------------------------------------------------------------------
    public EcEngine(ref EcEngineSettings settings, IEcEngineListener listener)
    {
        mInstance = this;
        mListener = listener;
        Settings  = settings;

        mEntityMgr = new EntityMgr(1, "Client");

        mEntityMgr.regComponent <ClientAutoPatcher <DefAutoPatcher> >();
        mEntityMgr.regComponent <ClientNode <DefNode> >();
        mEntityMgr.regComponent <ClientSuperSocket <DefSuperSocket> >();

        mEntityMgr.regEntityDef <EtAutoPatcher>();
        mEntityMgr.regEntityDef <EtNode>();
        mEntityMgr.regEntityDef <EtSuperSocket>();

        EtNode = mEntityMgr.createEntity <EtNode>(null, null);
        var co_node = EtNode.getComponent <ClientNode <DefNode> >();

        CoSuperSocket = co_node.CoSuperSocket;

        // 通知业务层初始化
        if (mListener != null)
        {
            mListener.init(mEntityMgr, EtNode);
        }
    }
コード例 #2
0
    //-------------------------------------------------------------------------
    void Start()
    {
        // 初始化系统参数
        {
            Application.runInBackground = true;
            Time.fixedDeltaTime         = 0.05f;
            Application.targetFrameRate = 30;
            Screen.sleepTimeout         = SleepTimeout.NeverSleep;
        }

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

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

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

        // 创建EtSampleApp
        EntityMgr.Instance.createEntity <EtSampleApp>(null, EcEngine.Instance.EtNode);
    }
コード例 #3
0
    //---------------------------------------------------------------------
    public EcEngine(ref EcEngineSettings settings, IEcEngineListener listener)
    {
        mInstance = this;
        mListener = listener;
        Settings  = settings;

        mEntityMgr = new EntityMgr(1, "Client");

        mEntityMgr.setRpcSessionFactory(new RpcSessionFactoryTcpClient());

        //mEntityMgr.regComponent<ClientAutoPatcher<DefAutoPatcher>>();
        //mEntityMgr.regComponent<ClientNode<DefNode>>();

        //mEntityMgr.regEntityDef<EtAutoPatcher>();
        //mEntityMgr.regEntityDef<EtNode>();

        //EtNode = mEntityMgr.createEntity<EtNode>(null, null);
        //var co_node = EtNode.getComponent<ClientNode<DefNode>>();

        //// 通知业务层初始化
        //if (mListener != null)
        //{
        //    mListener.init(mEntityMgr, EtNode);
        //}
    }
コード例 #4
0
ファイル: MbSample.cs プロジェクト: yinlei/GF.Core
    //-------------------------------------------------------------------------
    void Start()
    {
        // 初始化系统参数
        {
            Application.runInBackground = true;
            Time.fixedDeltaTime = 0.05f;
            Application.targetFrameRate = 30;
            Screen.sleepTimeout = SleepTimeout.NeverSleep;
        }

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

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

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

        // 创建EtSampleApp
        EntityMgr.Instance.createEntity<EtSampleApp>(null, EcEngine.Instance.EtNode);
    }
コード例 #5
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()");
    }
コード例 #6
0
ファイル: EcEngine.cs プロジェクト: yinlei/GF.Core
    //---------------------------------------------------------------------
    public EcEngine(ref EcEngineSettings settings, IEcEngineListener listener)
    {
        mInstance = this;
        mListener = listener;
        Settings = settings;

        mEntityMgr = new EntityMgr(1, "Client");

        mEntityMgr.regComponent<ClientAutoPatcher<DefAutoPatcher>>();
        mEntityMgr.regComponent<ClientNode<DefNode>>();
        mEntityMgr.regComponent<ClientSuperSocket<DefSuperSocket>>();

        mEntityMgr.regEntityDef<EtAutoPatcher>();
        mEntityMgr.regEntityDef<EtNode>();
        mEntityMgr.regEntityDef<EtSuperSocket>();

        EtNode = mEntityMgr.createEntity<EtNode>(null, null);
        var co_node = EtNode.getComponent<ClientNode<DefNode>>();
        CoSuperSocket = co_node.CoSuperSocket;

        // 通知业务层初始化
        if (mListener != null)
        {
            mListener.init(mEntityMgr, EtNode);
        }
    }
コード例 #7
0
ファイル: EcEngine.cs プロジェクト: yinlei/Fishing
    //---------------------------------------------------------------------
    public EcEngine(ref EcEngineSettings settings, IEcEngineListener listener)
    {
        mInstance = this;
        mListener = listener;
        Settings = settings;

        mEntityMgr = new EntityMgr(1, "Client");

        mEntityMgr.setRpcSessionFactory(new RpcSessionFactoryTcpClient());

        mEntityMgr.regComponent<ClientAutoPatcher<DefAutoPatcher>>();
        mEntityMgr.regComponent<ClientNode<DefNode>>();

        mEntityMgr.regEntityDef<EtAutoPatcher>();
        mEntityMgr.regEntityDef<EtNode>();

        EtNode = mEntityMgr.createEntity<EtNode>(null, null);
        var co_node = EtNode.getComponent<ClientNode<DefNode>>();

        // 通知业务层初始化
        if (mListener != null)
        {
            mListener.init(mEntityMgr, EtNode);
        }
    }
コード例 #8
0
ファイル: MbMain.cs プロジェクト: zhilianghuang/Fishing
    //-------------------------------------------------------------------------
    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);
    }
コード例 #9
0
    //-------------------------------------------------------------------------
    void _destory()
    {
        if (mEngine == null)
        {
            return;
        }

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

        Screen.sleepTimeout = SleepTimeout.SystemSetting;

        EbLog.Note("MbSample._destory()");
    }
コード例 #10
0
ファイル: MbSample.cs プロジェクト: yinlei/GF.Core
    //-------------------------------------------------------------------------
    void _destory()
    {
        if (mEngine == null) return;

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

        Screen.sleepTimeout = SleepTimeout.SystemSetting;

        EbLog.Note("MbSample._destory()");
    }
コード例 #11
0
ファイル: MbMain.cs プロジェクト: yinlei/Fishing
    //-------------------------------------------------------------------------
    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()");
    }
コード例 #12
0
ファイル: MbMain.cs プロジェクト: yinlei/Fishing
    //-------------------------------------------------------------------------
    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);
    }