G3 finish

This commit is contained in:
SepComet
2026-03-13 09:46:59 +08:00
parent 53b6b261dd
commit 26aaa945a9
8 changed files with 344 additions and 240 deletions
@@ -1,5 +1,6 @@
using System;
using System.Collections.Generic;
using GeometryTD.Definition;
using UnityEngine;
using Random = UnityEngine.Random;
@@ -51,6 +52,37 @@ namespace GeometryTD.UI
_currentModel = null;
}
public void ConfigureRewardCandidates(
IReadOnlyList<TowerCompItemData> rewardCandidates,
int displayCount = 3,
int refreshCost = 0,
bool allowRefreshOnce = true,
bool allowGiveUp = true,
string tipText = null)
{
_rewardPool.Clear();
if (rewardCandidates != null)
{
foreach (var item in rewardCandidates)
{
if (item == null)
{
continue;
}
_rewardPool.Add(RewardSelectItemRawDataBuilder.Build(item));
}
}
_displayCount = Mathf.Max(1, displayCount);
_refreshCost = Mathf.Max(0, refreshCost);
_allowRefreshOnce = allowRefreshOnce;
_allowGiveUp = allowGiveUp;
_tipText = string.IsNullOrWhiteSpace(tipText) ? "Select one reward" : tipText;
_hasRefreshed = false;
_currentModel = null;
}
public void SetCallbacks(Action<RewardSelectItemRawData> onRewardSelected, Action onGiveUp = null)
{
_onRewardSelected = onRewardSelected;