40 lines
1.2 KiB
C#
40 lines
1.2 KiB
C#
using asap.core;
|
|
using TMPro;
|
|
using UnityEngine;
|
|
using UnityEngine.UI;
|
|
|
|
public class EventFishRaidAndBombTipView : MonoBehaviour
|
|
{
|
|
[SerializeField] private Button btnClose;
|
|
[SerializeField] private TMP_Text[] textTicketNums;
|
|
private void Start()
|
|
{
|
|
if (btnClose != null)
|
|
btnClose.onClick.AddListener(() =>
|
|
{
|
|
gameObject.SetActive(false);
|
|
});
|
|
}
|
|
|
|
public void Init(IHasFishRaidAndBombTipView data)
|
|
{
|
|
// var data = GContext.container.Resolve<IEventOfferJourneyData>();
|
|
if (data == null)
|
|
return;
|
|
textTicketNums[0].text = data.GetTicketRewardArray()[0].ToString();
|
|
textTicketNums[1].text = data.GetTicketRewardArray()[1].ToString();
|
|
}
|
|
|
|
private void Reset()
|
|
{
|
|
btnClose = transform.Find("btn_close").GetComponent<Button>();
|
|
textTicketNums = new TMP_Text[2];
|
|
textTicketNums[0] = transform.Find("content/way1/text_num").GetComponent<TMP_Text>();
|
|
textTicketNums[1] = transform.Find("content/way2/text_num").GetComponent<TMP_Text>();
|
|
}
|
|
}
|
|
|
|
public interface IHasFishRaidAndBombTipView
|
|
{
|
|
public int[] GetTicketRewardArray();
|
|
} |