1
This commit is contained in:
@@ -175,14 +175,22 @@ public class UIHome_BY_RankPanel : SubUIBase
|
||||
return gold.ToString("N0");
|
||||
}
|
||||
|
||||
/// <summary>根据排行类型和排名查找奖励道具</summary>
|
||||
/// <summary>根据排行类型和排名查找奖励道具(服务端gold/diamond在奖励层级而非items里,合成type=1/2条目与items合并显示)</summary>
|
||||
private List<GiftConfig> GetRankRewards(int rank)
|
||||
{
|
||||
if (_rankingRewardConfig == null || !_rankingRewardConfig.isEnabled) return null;
|
||||
var group = _rankingRewardConfig.groups?.Find(g => g.rankingType == _currentRankType);
|
||||
if (group?.rewards == null) return null;
|
||||
var match = group.rewards.Find(r => rank >= r.rankMin && rank <= r.rankMax);
|
||||
return match?.items;
|
||||
if (match == null) return null;
|
||||
|
||||
var list = new List<GiftConfig>();
|
||||
if (match.gold > 0)
|
||||
list.Add(new GiftConfig { type = 1, isRandom = false, count = (int)match.gold });
|
||||
if (match.diamond > 0)
|
||||
list.Add(new GiftConfig { type = 2, isRandom = false, count = match.diamond });
|
||||
if (match.items != null) list.AddRange(match.items);
|
||||
return list.Count > 0 ? list : null;
|
||||
}
|
||||
|
||||
private void ClearRankList()
|
||||
|
||||
Reference in New Issue
Block a user