备份CatanBuilding瘦身独立工程
This commit is contained in:
27
Assets/Scripts/UI/Shop/GiftSelectionPackSlot.cs
Normal file
27
Assets/Scripts/UI/Shop/GiftSelectionPackSlot.cs
Normal file
@@ -0,0 +1,27 @@
|
||||
using GameCore;
|
||||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
|
||||
public class GiftSelectionPackSlot : MonoBehaviour
|
||||
{
|
||||
private Button _btnEmpty, _btnReward, _btnSelect;
|
||||
private RewardItemNew _reward;
|
||||
private void Awake()
|
||||
{
|
||||
_btnEmpty = transform.Find("empty").GetComponent<Button>();
|
||||
_btnReward = transform.Find("reward_1").GetComponent<Button>();
|
||||
_btnSelect = transform.Find("reward_1/btn_selection").GetComponent<Button>();
|
||||
_reward = transform.Find("reward_1").GetComponent<RewardItemNew>();
|
||||
}
|
||||
public void SetState(ItemData item)
|
||||
{
|
||||
_btnEmpty.gameObject.SetActive(false);
|
||||
_btnReward.gameObject.SetActive(true);
|
||||
_reward.SetData(item, isCanClick: true);
|
||||
}
|
||||
public void SetState()
|
||||
{
|
||||
_btnEmpty.gameObject.SetActive(true);
|
||||
_btnReward.gameObject.SetActive(false);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user