using GameCore; using System.Collections.Generic; using UnityEngine; public class Rewardx1x2 : MonoBehaviour { public GameObject rewardx2; public GameObject rewardx1; public RewardItemNew reward; public RewardItemNew reward1; public RewardItemNew reward2; public void SetData(List itemDatas) { if (itemDatas != null) { int count = itemDatas.Count; rewardx1.SetActive(count == 1); rewardx2.SetActive(count != 1); if (count == 1) { reward.SetData(itemDatas[0], forceLight: true); reward.id = 0; } else { reward1.SetData(itemDatas[0], forceLight: true); reward2.SetData(itemDatas[1], forceLight: true); reward1.id = 0; reward2.id = 0; } } } }