26 lines
796 B
C#
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.");
|
|
}
|
|
}
|
|
}
|
|
}
|