Files
back_cantanBuilding/Assets/Scripts/EventGatherCore/EventGatherCoreInfoPanelDummyRewardView.cs
2026-05-26 16:15:54 +08:00

26 lines
796 B
C#

using UnityEngine;
using System.Linq;
public class EventGatherCoreInfoPanelDummyRewardView : MonoBehaviour
{
[SerializeField] private RewardItemNew[] rewards;
public void Awake()
{
var firstStageId = EventGatherCoreAct.Ctx.GetStageId(0);
var rewardDic = EventGatherCoreAct.Ctx.GetRewardViewInfo(firstStageId);
for (int i = 0; i < rewards.Length; i++)
{
if (rewardDic.Keys.Contains(i))
{
var rewardItem = EventGatherCoreAct.Ctx.GetReward(rewardDic[i].RewardId, out _);
rewards[i].SetData(rewardItem);
}
else
{
Debug.LogWarning($"[EventGatherCore] Reward index mismatch: \"{i}\" not found in dictionary keys.");
}
}
}
}