|
@@ -19,8 +19,8 @@ namespace GFGGame
|
|
|
private bool _actionIsPic;
|
|
|
|
|
|
private List<int> _suitIds;//已解锁套装列表
|
|
|
- private SortedList _propertyList;
|
|
|
- private SortedList _addPropertyList;
|
|
|
+ private SortedList _propertyList = new SortedList();
|
|
|
+ private SortedList _addPropertyList = new SortedList();
|
|
|
private int _suitId;
|
|
|
private int _index;
|
|
|
|
|
@@ -85,8 +85,12 @@ namespace GFGGame
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ _index = SuitFosterDataManager.Instance.GetSuitFosterData(_suitId).maintainStep;
|
|
|
+ _ui.m_c1.selectedIndex = 0;
|
|
|
UpdateView();
|
|
|
|
|
|
+ Debug.Log("养护奖励:" + ItemDataManager.GetItemNum(100169));
|
|
|
+ Debug.Log("换新奖励:" + ItemDataManager.GetItemNum(10370));
|
|
|
}
|
|
|
|
|
|
protected override void OnHide()
|
|
@@ -160,6 +164,7 @@ namespace GFGGame
|
|
|
if (targetIndex >= 0 && direction == -1 || targetIndex < _suitIds.Count && direction == 1)
|
|
|
{
|
|
|
_suitId = _suitIds[targetIndex];
|
|
|
+ _index = SuitFosterDataManager.Instance.GetSuitFosterData(_suitId).maintainStep;
|
|
|
UpdateView();
|
|
|
}
|
|
|
}
|
|
@@ -168,6 +173,8 @@ namespace GFGGame
|
|
|
private void UpdateFoster()
|
|
|
{
|
|
|
UpdateFosterReward();
|
|
|
+ _propertyList.Clear();
|
|
|
+ _addPropertyList.Clear();
|
|
|
SuitFosterDataManager.Instance.GetPropertyData(_suitId, _index, out _propertyList, out _addPropertyList);
|
|
|
_ui.m_listProperty.numItems = _propertyList.Count;
|
|
|
_ui.m_listFoster.numItems = SuitFosterCfgArray.Instance.GetCfgs(_suitId).Length;
|
|
@@ -186,10 +193,10 @@ namespace GFGGame
|
|
|
UI_ListFosterItem item = UI_ListFosterItem.Proxy(obj);
|
|
|
item.target.data = index;
|
|
|
item.m_finish.selectedIndex = SuitFosterDataManager.Instance.GetFosterState(_suitId, index);
|
|
|
- if (SuitFosterDataManager.Instance.GetSuitFosterData(_suitId).maintainStep == index)
|
|
|
- {
|
|
|
- _index = index;
|
|
|
- }
|
|
|
+ // if (SuitFosterDataManager.Instance.GetSuitFosterData(_suitId).maintainStep == index)
|
|
|
+ // {
|
|
|
+ // _index = index;
|
|
|
+ // }
|
|
|
}
|
|
|
|
|
|
private void ListPropertyItemRender(int index, GObject obj)
|
|
@@ -216,7 +223,6 @@ namespace GFGGame
|
|
|
{
|
|
|
PromptController.Instance.ShowFloatTextPrompt(string.Format("请完成{0}阶段", SuitFosterDataManager.Instance.stepNames[_index]));
|
|
|
}
|
|
|
- SuitFosterHelper.SendMaintainSuit(_suitId, index + 1).Coroutine();
|
|
|
}
|
|
|
private void OnClickComFosterReward()
|
|
|
{
|
|
@@ -238,11 +244,12 @@ namespace GFGGame
|
|
|
private void OnListenerFoster()
|
|
|
{
|
|
|
_ui.m_comFosterAni.target.visible = true;
|
|
|
+ _ui.m_comFosterAni.m_txtContent.text = string.Format("服装{0}中......", SuitFosterDataManager.Instance.stepNames[_index]);
|
|
|
_ui.m_comFosterAni.m_proFoster.value = 0;
|
|
|
_ui.m_comFosterAni.m_proFoster.TweenValue(100, 2f).OnComplete(() =>
|
|
|
{
|
|
|
_ui.m_comFosterAni.target.visible = false;
|
|
|
- ViewManager.Show<SuitFosterFinishView>(_propertyList);
|
|
|
+ ViewManager.Show<SuitFosterFinishView>(new object[] { _suitId, _index, _propertyList });
|
|
|
UpdateFoster();
|
|
|
});
|
|
|
|
|
@@ -252,6 +259,8 @@ namespace GFGGame
|
|
|
SuitFosterCfg cfg = SuitFosterCfgArray.Instance.GetCfgs(_suitId)[(int)(context.data) - 1];
|
|
|
ViewManager.Show<RewardView>(ItemUtil.CreateItemDataList(cfg.rewardsArr));
|
|
|
UpdateFosterReward();
|
|
|
+ Debug.Log("养护奖励:" + ItemDataManager.GetItemNum(100169));
|
|
|
+
|
|
|
}
|
|
|
/*************************************************换新************************************************/
|
|
|
private void UpdateRenew()
|
|
@@ -288,7 +297,7 @@ namespace GFGGame
|
|
|
UI_ComConsumeCurrency comConsumeCurrency = UI_ComConsumeCurrency.Proxy(_ui.m_comRenewCost);
|
|
|
int has = ItemDataManager.GetItemNum(renewCfg.costId);
|
|
|
int need = renewCfg.costNum;
|
|
|
- // comConsumeCurrency.m_txtHas.text = has.ToString();
|
|
|
+ comConsumeCurrency.m_txtHas.text = has.ToString();
|
|
|
comConsumeCurrency.m_txtNeed.text = need.ToString();
|
|
|
if (_canRenew && has < need) _canRenew = false;
|
|
|
}
|
|
@@ -330,11 +339,21 @@ namespace GFGGame
|
|
|
PromptController.Instance.ShowFloatTextPrompt("材料不足");
|
|
|
return;
|
|
|
}
|
|
|
+ SuitFosterData data = SuitFosterDataManager.Instance.GetSuitFosterData(_suitId);
|
|
|
+ SuitFosterListCfg cfg = SuitFosterListCfgArray.Instance.GetCfg(_suitId);
|
|
|
+ if (data.maintainStep < cfg.renewOpenLv)
|
|
|
+ {
|
|
|
+ PromptController.Instance.ShowFloatTextPrompt(string.Format("完成{0}开启换新", SuitFosterDataManager.Instance.stepNames[cfg.renewOpenLv - 1]));
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ SuitFosterHelper.SendMakeNewSuit(_suitId).Coroutine();
|
|
|
}
|
|
|
private void OnListenerRenew()
|
|
|
{
|
|
|
ViewManager.Show<SuitRenewFinishView>(_suitId);
|
|
|
UpdateRenew();
|
|
|
+ Debug.Log("换新奖励:" + ItemDataManager.GetItemNum(10370));
|
|
|
+
|
|
|
}
|
|
|
}
|
|
|
}
|