private void Awake() { Utility.Converter.ScreenDpi = Screen.dpi; if (Utility.Converter.ScreenDpi <= 0) { Utility.Converter.ScreenDpi = DefaultDpi; } //Application.targetFrameRate = m_FrameRate; Time.timeScale = m_GameSpeed; Application.runInBackground = m_RunInBackground; Screen.sleepTimeout = m_NeverSleep ? SleepTimeout.NeverSleep : SleepTimeout.SystemSetting; DontDestroyOnLoad(gameObject); ///////////////////////////////////////流程正式开始 GameMainEntry.GameMainEntryComponent = this; var pd_mg = GameMainEntry.GetModule <ProcedureManager>(); var pd_fsm = new FsmManager(); var pd_setting = new Procedure_Setting(); pd_mg.Initialize(pd_fsm, pd_setting); pd_mg.StartProcedure <Procedure_Setting>(); ////////////////////////////////////////// }
private void Awake() { m_rmm = GameMainEntry.GetModule <ResourcesManagerMoudle>(); if (m_rmm == null) { throw new GameFrameworkException("m_rmm NULL "); } }
private void Awake() { m_lm = GameMainEntry.GetModule <LogManager>(); if (m_lm == null) { throw new GameFrameworkException("m_lm NULL "); } }
/// <summary> /// 游戏框架组件初始化。 /// </summary> void Awake() { m_DataNodeManager = GameMainEntry.GetModule <DataNodeManager>(); if (m_DataNodeManager == null) { DebugHandler.LogError("Data node manager is invalid."); return; } }
public override void OnInit(ProcedureOwner procedureOwner) { ////////添加组件的顺序 GameMainEntry.GetModule <LogManager>(); GameMainEntry.GetModule <NetWorkManager>(); /// GameMainEntry.Init(); }
/// <summary> /// 游戏框架组件初始化。 /// </summary> /// private void Awake() { GameMainEntry.GetModule <SettingManager>(); m_CustomSettingHelper = new DefaultSettingHelper(); if (m_CustomSettingHelper == null) { throw new GameFrameworkException("settingHelper NULL "); } }
//ProcedureManager m_pdm; public void Enter() { AppDomain currentDomain = AppDomain.CurrentDomain; currentDomain.UnhandledException += new UnhandledExceptionEventHandler(ExceptHandler); var pd_mg = GameMainEntry.GetModule <ProcedureManager>(); var pd_fsm = new FsmManager(); var pd_setting = new Procedure_Setting(); pd_mg.Initialize(pd_fsm, pd_setting); pd_mg.StartProcedure <Procedure_Setting>(); bool m_quit = false; DateTime lastdt = DateTime.Now; DateTime curdt = DateTime.Now; TimeSpan curts; float elapseSeconds = 0; Task.Factory.StartNew(() => { bool bloop = true; while (bloop) { string strcmd = Console.ReadLine(); if (strcmd == "quit") { bloop = false; m_quit = true; } else if (strcmd == "exp") { } } } ); while (!m_quit) { Thread.Sleep(GameConstant.TThreadInternal); curdt = DateTime.Now; curts = curdt - lastdt; elapseSeconds = (float)curts.TotalMilliseconds / 1000; GameMainEntry.Update(elapseSeconds, elapseSeconds); //m_pdm.Execute((float)curts.TotalMilliseconds/1000); lastdt = curdt; } //m_pdm.Shut(); return; }
public override void OnInit(ProcedureOwner procedureOwner) { ////////添加组件的顺序 ProcedureManagerComponent.Instance.enabled = true; SettingComponent.Instance.enabled = true; LogManagerComponent.Instance.enabled = true; ResourcesManagerComponent.Instance.enabled = true; DataNodeComponent.Instance.enabled = true; TableManagerComponent.Instance.enabled = true; QualityManagerComponent.Instance.enabled = true; SceneManagerComponent.Instance.enabled = true; SceneManagerComponent.Instance.enabled = true; RecordManagerCoponent.Instance.enabled = true; //存档 InputManagerComponent.Instance.enabled = true; //输入 SoundManagerComponent.Instance.enabled = true; //音效 /// UIManagerComponent.Instance.Init(); ////////////////////////////////////////////////////////////////////////// ResourcesManagerComponent.Instance.ResourcesManagerMoudle.Asset_Mode = GameMainEntry.GameMainEntryComponent.Asset_Mode; ////////////////////////////////////////////////////////////////////////// GameMainEntry.Init(); }
void Shutdown() { GameMainEntry.Shutdown(); Destroy(gameObject); }
void Update() { GameMainEntry.Update(Time.deltaTime, Time.unscaledDeltaTime); }
public override void OnEnter(ProcedureOwner procedureOwner) { foreach (GameFrameworkModule module in GameMainEntry.GameFrameworkModules) { DebugHandler.Log(module.GetType().Name + module.Priority); } ///////////////////加载所有模块 ///////////////////////// ////////////////////////////////////////////////////////////////////////// var tm = TableManagerComponent.Instance.TableManager; Dialog_Table dialog_tb = new Dialog_Table(); dialog_tb.Name = typeof(Dialog_Table).Name;//"Dialog_Table"; dialog_tb.AssetId = 2000; dialog_tb.IsLoad = false; tm.AddTable(dialog_tb); ////////////////////////////////////////////////////////////////////////// 加载ui Table // var tm = TableManagerComponent.Instance.TableManager; UI_Table ui_tb = new UI_Table(); ui_tb.Name = typeof(UI_Table).Name;//"UI_Table"; ui_tb.AssetId = 2001; ui_tb.IsLoad = false; tm.AddTable(ui_tb); ////////////////////////////////////////////////////////////////////////// Text_Table text_tb = new Text_Table(); text_tb.Name = typeof(Text_Table).Name; text_tb.AssetId = 2002; text_tb.IsLoad = false; tm.AddTable(text_tb); Role_Expression_Table express_tb = new Role_Expression_Table(); express_tb.Name = typeof(Role_Expression_Table).Name;//"Dialog_Table"; express_tb.AssetId = 2003; express_tb.IsLoad = false; tm.AddTable(express_tb); Role_Table role_tb = new Role_Table(); role_tb.Name = typeof(Role_Table).Name; role_tb.AssetId = 2004; role_tb.IsLoad = false; tm.AddTable(role_tb); Item_Pack_Table item_Pack_Table = new Item_Pack_Table(); item_Pack_Table.Name = typeof(Item_Pack_Table).Name; item_Pack_Table.AssetId = 2005; item_Pack_Table.IsLoad = false; tm.AddTable(item_Pack_Table); CircleOfFriend_Table circleoffriend_Table = new CircleOfFriend_Table(); circleoffriend_Table.Name = typeof(CircleOfFriend_Table).Name; circleoffriend_Table.AssetId = 2006; circleoffriend_Table.IsLoad = false; tm.AddTable(circleoffriend_Table); ////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////// TableManagerComponent.Instance.LoadAllTable(); var pd_mg = GameMainEntry.GetModule <ProcedureManager>(); var pd_MainMenu = new Procedure_MainMenu(); pd_mg.ProcedureFsm.CreateFsmState(pd_MainMenu); ChangeState <Procedure_MainMenu>(procedureOwner); ////////////////////////////////////////////////////////////////////////// var pd_game = new Procedure_Game(); pd_mg.ProcedureFsm.CreateFsmState(pd_game); /* * var sq = DOTween.Sequence(); * sq.PrependInterval(0.5f); * sq.AppendCallback(() * => * { * DebugHandler.Log("finish Callback"); * * var pd_mg = GameMainEntry.GetModule<ProcedureManager>(); * var pd_MainMenu = new Procedure_MainMenu(); * pd_mg.ProcedureFsm.CreateFsmState(pd_MainMenu); * ChangeState<Procedure_MainMenu>(procedureOwner); * ////////////////////////////////////////////////////////////////////////// * var pd_game = new Procedure_Game(); * pd_mg.ProcedureFsm.CreateFsmState(pd_game); * });*/ }