//--------------------------------------------------------------------- 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); } }
//------------------------------------------------------------------------- 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); }
//--------------------------------------------------------------------- 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); //} }
//------------------------------------------------------------------------- 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); }
//------------------------------------------------------------------------- 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()"); }
//--------------------------------------------------------------------- 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); } }
//--------------------------------------------------------------------- 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); } }
//------------------------------------------------------------------------- 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); }
//------------------------------------------------------------------------- void _destory() { if (mEngine == null) { return; } if (mEngine != null) { mEngine.close(); mEngine = null; } Screen.sleepTimeout = SleepTimeout.SystemSetting; EbLog.Note("MbSample._destory()"); }
//------------------------------------------------------------------------- void _destory() { if (mEngine == null) return; if (mEngine != null) { mEngine.close(); mEngine = null; } Screen.sleepTimeout = SleepTimeout.SystemSetting; EbLog.Note("MbSample._destory()"); }
//------------------------------------------------------------------------- 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()"); }
//------------------------------------------------------------------------- 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); }