protected override void OnEnter(ProcedureOwner procedureOwner) { base.OnInit(procedureOwner); m_ProcedureOwner = procedureOwner; GameEntry.Event.Subscribe(EnterLevelEventArgs.EventId, OnEnterLevel); int playerId = m_ProcedureOwner.GetData <VarInt>(Constant.ProcedureData.PlayerId); GameEntry.Level.EnterLevel(Constant.Define.MainCityLevelId, SceneId.MainCity, playerId); GameEntry.UI.OpenUIForm(UIFormId.ControllerForm); HomeFormData data = new HomeFormData(); data.SceneType = SceneType.City; GameEntry.UI.OpenUIForm(UIFormId.HomeForm, data); }
protected override void OnOpen(object userData) { base.OnOpen(userData); AddListener(); m_Data = userData as HomeFormData; if (m_Data == null) { Log.Error("UI Data is null."); return; } if (m_Data.SceneType == SceneType.City) { m_Ctrl.selectedIndex = 0; } else { m_Ctrl.selectedIndex = 1; } }
private void OnBattleStart() { if (LevelID <= 0) { Log.Error("CopyId is invalid."); return; } if (!GameEntry.DataTable.GetDataTable <DRLevel>().HasDataRow(LevelID)) { Log.Error("the copy is no exist."); return; } m_StartTime = Time.realtimeSinceStartup; HomeFormData data = new HomeFormData(); data.SceneType = SceneType.Battle; GameEntry.UI.OpenUIForm(UIFormId.HomeForm, data); GameEntry.UI.OpenUIForm(UIFormId.ControllerForm); GameEntry.UI.OpenUIForm(UIFormId.ComboForm); }