|
@@ -9,9 +9,10 @@ namespace GFGGame
|
|
|
{
|
|
|
private UI_FieldUI _ui;
|
|
|
|
|
|
- private int _curLevelId;
|
|
|
+ // private int _curLevelId;
|
|
|
private FieldCfg _curCfg;
|
|
|
private FieldDataManager _dataManager;
|
|
|
+ private int _selectedIndex = 0;
|
|
|
public override void Dispose()
|
|
|
{
|
|
|
base.Dispose();
|
|
@@ -35,11 +36,12 @@ namespace GFGGame
|
|
|
protected override void OnShown()
|
|
|
{
|
|
|
base.OnShown();
|
|
|
+ _selectedIndex = 0;
|
|
|
+ _ui.m_c1.selectedIndex = _selectedIndex;
|
|
|
+
|
|
|
+ _curCfg = FieldCfgArray.Instance.dataArray[_selectedIndex];
|
|
|
_dataManager = FieldDataManager.Instance;
|
|
|
- _dataManager.difficulty = _ui.m_c1.selectedIndex;
|
|
|
- _dataManager.currFightIndex = 0;
|
|
|
- _curCfg = _dataManager.GetFieldCfgByDifficulty(_ui.m_c1.selectedIndex);
|
|
|
- _curLevelId = _dataManager.GetLevelIdByDifficulty(_dataManager.difficulty, _dataManager.currFightIndex);
|
|
|
+ _dataManager.chapterId = _curCfg.id;
|
|
|
|
|
|
FieldCfg[] cfgs = FieldCfgArray.Instance.dataArray;
|
|
|
for (int i = 0; i < cfgs.Length; i++)
|
|
@@ -64,11 +66,11 @@ namespace GFGGame
|
|
|
|
|
|
private void OnDifficultyChange()
|
|
|
{
|
|
|
- FieldCfg cfg = _dataManager.GetFieldCfgByDifficulty(_ui.m_c1.selectedIndex);
|
|
|
+ FieldCfg cfg = FieldCfgArray.Instance.dataArray[_selectedIndex];
|
|
|
bool isPass = InstanceZonesDataManager.CheckLevelPass(cfg.storyLvId);
|
|
|
if (!isPass && _ui.m_c1.selectedIndex != ConstInstanceZonesSubType.Normal)
|
|
|
{
|
|
|
- _ui.m_c1.selectedIndex = _dataManager.difficulty;
|
|
|
+ _ui.m_c1.selectedIndex = _selectedIndex;
|
|
|
StoryLevelCfg storyLevelCfg = StoryLevelCfgArray.Instance.GetCfg(cfg.storyLvId);
|
|
|
string str = string.Format("完成主线{0}-{1}解锁", storyLevelCfg.chapterId, storyLevelCfg.order);
|
|
|
PromptController.Instance.ShowFloatTextPrompt(str);
|
|
@@ -76,19 +78,19 @@ namespace GFGGame
|
|
|
}
|
|
|
if (_dataManager.fieldInfos.highestLvls[_ui.m_c1.selectedIndex] < cfg.num && _ui.m_c1.selectedIndex != ConstInstanceZonesSubType.Normal)
|
|
|
{
|
|
|
- _ui.m_c1.selectedIndex = _dataManager.difficulty;
|
|
|
+ _ui.m_c1.selectedIndex = _selectedIndex;
|
|
|
PromptController.Instance.ShowFloatTextPrompt("需通关前置关卡");
|
|
|
return;
|
|
|
}
|
|
|
- _dataManager.difficulty = _ui.m_c1.selectedIndex;
|
|
|
- _curCfg = _dataManager.GetFieldCfgByDifficulty(_ui.m_c1.selectedIndex);
|
|
|
- _curLevelId = _dataManager.GetLevelIdByDifficulty(_ui.m_c1.selectedIndex, _dataManager.currFightIndex);
|
|
|
+ _selectedIndex = _ui.m_c1.selectedIndex;
|
|
|
+ _curCfg = cfg;
|
|
|
+ _dataManager.chapterId = _curCfg.id;
|
|
|
UpdateView();
|
|
|
}
|
|
|
private void UpdateView()
|
|
|
{
|
|
|
_ui.m_txtScore.text = ConstDressUpScoreType.scoreTypeList()[_dataManager.fieldInfos.theme].ToString();
|
|
|
- _ui.m_txtMaxLv.text = string.Format("最高记录:{0}/{1}", _dataManager.fieldInfos.highestLvls[_dataManager.difficulty], _curCfg.num);
|
|
|
+ _ui.m_txtMaxLv.text = string.Format("最高记录:{0}/{1}", _dataManager.fieldInfos.highestLvls[_selectedIndex], _curCfg.num);
|
|
|
_ui.m_txtConsume.text = string.Format("x{0}", _curCfg.needPower);
|
|
|
}
|
|
|
private void OnClickBtnGo()
|
|
@@ -115,8 +117,9 @@ namespace GFGGame
|
|
|
}
|
|
|
private void StartFight()
|
|
|
{
|
|
|
- ViewManager.Show(ViewName.DRESS_UP_FIGHT_VIEW, _curLevelId, new object[] { typeof(FieldView).Name, this.viewData }, true);
|
|
|
- InstanceZonesDataManager.currentLevelCfgId = _curLevelId;
|
|
|
+ int curLevelId = StoryLevelCfgArray.Instance.GetCfgs(_curCfg.type, 0, _curCfg.id)[0].id;
|
|
|
+ ViewManager.Show(ViewName.DRESS_UP_FIGHT_VIEW, curLevelId, new object[] { typeof(FieldView).Name, this.viewData }, true);
|
|
|
+ InstanceZonesDataManager.currentLevelCfgId = curLevelId;
|
|
|
}
|
|
|
private void OnBtnTaskClick()
|
|
|
{
|