45 lines
1.9 KiB
C#
45 lines
1.9 KiB
C#
using System.Collections.Generic;
|
|
using EnhancedUI.EnhancedScroller;
|
|
using GameCore;
|
|
using TMPro;
|
|
using UnityEngine.UI;
|
|
using UnityEngine;
|
|
|
|
namespace Event1v1Battle.Panel.RewardPanel
|
|
{
|
|
public class Event1v1BattleSlapRewardCell:EnhancedScrollerCellView
|
|
{
|
|
private RewardItemNew[] _rewardItems;
|
|
private GameObject _currentObj;
|
|
private GameObject _otherObj;
|
|
private Image _progressBar;
|
|
private GameObject _currentTagObj;
|
|
private GameObject _normalTagObj;
|
|
private GameObject _doneTagObj;
|
|
private void Awake()
|
|
{
|
|
_rewardItems = GetComponentsInChildren<RewardItemNew>();
|
|
_currentObj = gameObject.FindChildGameObject("bg_current");
|
|
_otherObj = gameObject.FindChildGameObject("bg_nml");
|
|
_progressBar = gameObject.FindChildGameObject("bar").GetComponent<Image>();
|
|
_currentTagObj = gameObject.FindChildGameObject("tag_current");
|
|
_normalTagObj = gameObject.FindChildGameObject("tag_normal");
|
|
_doneTagObj = gameObject.FindChildGameObject("tag_done");
|
|
}
|
|
|
|
public void SetData(List<ItemData> itemDatas,int stageOrder,bool isCurrent,bool isClaimed)
|
|
{
|
|
_rewardItems.SetData(itemDatas,isClaimed);
|
|
_currentTagObj.SetActive(isCurrent);
|
|
_normalTagObj.SetActive(!isCurrent && !isClaimed);
|
|
_doneTagObj.SetActive(isClaimed&&!isCurrent);
|
|
_currentTagObj.FindChildGameObject("p_text_num").GetComponent<TMP_Text>().text=stageOrder.ToString();
|
|
_normalTagObj.FindChildGameObject("p_text_num").GetComponent<TMP_Text>().text=stageOrder.ToString();
|
|
_doneTagObj.FindChildGameObject("p_text_num").GetComponent<TMP_Text>().text=stageOrder.ToString();
|
|
_currentObj.SetActive(isCurrent);
|
|
_otherObj.SetActive(!isCurrent);
|
|
_progressBar.fillAmount = (isCurrent || isClaimed) ? 1f : 0f;
|
|
}
|
|
|
|
}
|
|
} |