|
@@ -11,6 +11,8 @@ namespace GFGGame
|
|
|
|
|
|
private FieldCfg _curCfg;
|
|
private FieldCfg _curCfg;
|
|
private int _curLevelId;
|
|
private int _curLevelId;
|
|
|
|
+
|
|
|
|
+ private FieldDataManager _dataManager;
|
|
public override void Dispose()
|
|
public override void Dispose()
|
|
{
|
|
{
|
|
base.Dispose();
|
|
base.Dispose();
|
|
@@ -34,9 +36,10 @@ namespace GFGGame
|
|
protected override void OnShown()
|
|
protected override void OnShown()
|
|
{
|
|
{
|
|
base.OnShown();
|
|
base.OnShown();
|
|
- FieldDataManager.Instance.c_difficulty = _ui.m_c1.selectedIndex;
|
|
|
|
- _curCfg = FieldDataManager.Instance.GetFieldCfgByDifficulty(_ui.m_c1.selectedIndex);
|
|
|
|
- _curLevelId = FieldDataManager.Instance.GetLevelIdByDifficulty(_ui.m_c1.selectedIndex);
|
|
|
|
|
|
+ _dataManager = FieldDataManager.Instance;
|
|
|
|
+ _dataManager.c_difficulty = _ui.m_c1.selectedIndex;
|
|
|
|
+ _curCfg = _dataManager.GetFieldCfgByDifficulty(_ui.m_c1.selectedIndex);
|
|
|
|
+ _curLevelId = _dataManager.GetLevelIdByDifficulty(_ui.m_c1.selectedIndex);
|
|
FieldCfg[] cfgs = FieldCfgArray.Instance.dataArray;
|
|
FieldCfg[] cfgs = FieldCfgArray.Instance.dataArray;
|
|
for (int i = 0; i < cfgs.Length; i++)
|
|
for (int i = 0; i < cfgs.Length; i++)
|
|
{
|
|
{
|
|
@@ -61,14 +64,14 @@ namespace GFGGame
|
|
|
|
|
|
private void OnDifficultyChange()
|
|
private void OnDifficultyChange()
|
|
{
|
|
{
|
|
- FieldDataManager.Instance.c_difficulty = _ui.m_c1.selectedIndex;
|
|
|
|
- _curCfg = FieldDataManager.Instance.GetFieldCfgByDifficulty(_ui.m_c1.selectedIndex);
|
|
|
|
- _curLevelId = FieldDataManager.Instance.GetLevelIdByDifficulty(_ui.m_c1.selectedIndex);
|
|
|
|
|
|
+ _dataManager.c_difficulty = _ui.m_c1.selectedIndex;
|
|
|
|
+ _curCfg = _dataManager.GetFieldCfgByDifficulty(_ui.m_c1.selectedIndex);
|
|
|
|
+ _curLevelId = _dataManager.GetLevelIdByDifficulty(_ui.m_c1.selectedIndex);
|
|
UpdateView();
|
|
UpdateView();
|
|
}
|
|
}
|
|
private void UpdateView()
|
|
private void UpdateView()
|
|
{
|
|
{
|
|
- _ui.m_txtScore.text = ConstDressUpScoreType.scoreTypeList()[FieldDataManager.Instance.Theme].ToString();
|
|
|
|
|
|
+ _ui.m_txtScore.text = ConstDressUpScoreType.scoreTypeList()[_dataManager.fieldInfos.theme].ToString();
|
|
_ui.m_txtMaxLv.text = string.Format("最高记录:{0}/{1}", 0, _curCfg.num);
|
|
_ui.m_txtMaxLv.text = string.Format("最高记录:{0}/{1}", 0, _curCfg.num);
|
|
_ui.m_txtConsume.text = string.Format("x{0}", _curCfg.needPower);
|
|
_ui.m_txtConsume.text = string.Format("x{0}", _curCfg.needPower);
|
|
}
|
|
}
|