备份CatanBuilding瘦身独立工程
This commit is contained in:
35
Assets/Scripts/UI/FishingTarget/Rewardx1x2.cs
Normal file
35
Assets/Scripts/UI/FishingTarget/Rewardx1x2.cs
Normal file
@@ -0,0 +1,35 @@
|
||||
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<ItemData> 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;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user