|
@@ -87,6 +87,7 @@ namespace GFGGame
|
|
|
private void UpdateView()
|
|
|
{
|
|
|
_activityInfo = ActivityGlobalDataManager.Instance.GetActivityInfo(ActivityDataManager.Instance.actLimitChargeId);
|
|
|
+ _rechargeCfgs = SoreCfg(_rechargeCfgs);
|
|
|
_ui.m_list.numItems = _rechargeCfgs.Count;
|
|
|
}
|
|
|
private void RenderListItem(int index, GObject obj)
|
|
@@ -139,10 +140,21 @@ namespace GFGGame
|
|
|
}
|
|
|
private List<ActivityRechargeCfg> SoreCfg(List<ActivityRechargeCfg> rechargeCfgs)
|
|
|
{
|
|
|
- // rechargeCfgs.Sort((ActivityRechargeCfg a, ActivityRechargeCfg b) =>
|
|
|
- // {
|
|
|
+ rechargeCfgs.Sort((ActivityRechargeCfg a, ActivityRechargeCfg b) =>
|
|
|
+ {
|
|
|
+ int limitChargeExp = GameGlobal.myNumericComponent.GetAsInt(NumericType.TotalRechargeScore);
|
|
|
+ int stateA = _activityInfo.GetRewards.IndexOf(a.id);
|
|
|
+ int stateB = _activityInfo.GetRewards.IndexOf(b.id);
|
|
|
+
|
|
|
+ if (limitChargeExp >= a.value && limitChargeExp < b.value && stateA < 0) return -1;
|
|
|
+ if (limitChargeExp >= b.value && limitChargeExp < a.value && stateB < 0) return 1;
|
|
|
+
|
|
|
+
|
|
|
+ if (stateA >= 0 && stateB < 0) return 1;
|
|
|
+ if (stateB >= 0 && stateA < 0) return -1;
|
|
|
|
|
|
- // });
|
|
|
+ return a.id - b.id;
|
|
|
+ });
|
|
|
return rechargeCfgs;
|
|
|
}
|
|
|
}
|