57 lines
1.3 KiB
C#
57 lines
1.3 KiB
C#
using asap.core;
|
|
using cfg;
|
|
using GameCore;
|
|
using System;
|
|
using TMPro;
|
|
using UnityEngine;
|
|
using UnityEngine.UI;
|
|
|
|
public class SignupRewardItem : MonoBehaviour
|
|
{
|
|
public TMP_Text text_num;
|
|
public GameObject num_bg;
|
|
public GameObject received;
|
|
public Button btn_click;
|
|
Action OnClickReward;
|
|
private void Awake()
|
|
{
|
|
|
|
text_num = transform.Find("text_progress").GetComponent<TMP_Text>();
|
|
num_bg = transform.Find("bg_progress").gameObject;
|
|
|
|
received = transform.Find("received").gameObject;
|
|
|
|
btn_click = GetComponent<Button>();
|
|
}
|
|
public void SetReceived(bool _isReceived)
|
|
{
|
|
text_num.gameObject.SetActive(!_isReceived);
|
|
num_bg.gameObject.SetActive(!_isReceived);
|
|
received.SetActive(_isReceived);
|
|
}
|
|
|
|
private void Start()
|
|
{
|
|
if (btn_click != null)
|
|
{
|
|
btn_click.onClick.AddListener(OnClick);
|
|
}
|
|
}
|
|
|
|
void OnClick()
|
|
{
|
|
OnClickReward();
|
|
//GContext.container.Resolve<PlayerItemData>().ShowItemTips(id, transform);
|
|
}
|
|
public void SetData(Action onClickReward, string num)
|
|
{
|
|
OnClickReward = onClickReward;
|
|
|
|
//GContext.container.Resolve<IUIService>().SetImageSprite(icon, _tables.GetItemIconName(id), BasePanel.PanelName);
|
|
|
|
text_num.text = num;
|
|
|
|
}
|
|
|
|
}
|