39 lines
936 B
C#
39 lines
936 B
C#
using TMPro;
|
|
using UnityEngine;
|
|
using UnityEngine.EventSystems;
|
|
using UnityEngine.UI;
|
|
|
|
public class JobTabUITemplate : MonoBehaviour, IPointerEnterHandler,IPointerClickHandler, IPointerExitHandler
|
|
{
|
|
[SerializeField]
|
|
private TextMeshProUGUI _description;
|
|
[SerializeField]
|
|
private Image _icon;
|
|
public JobsListSO _jobListItem;
|
|
|
|
private JobSelectorUI _parent;
|
|
public void SetItem(JobSelectorUI parent, JobsListSO jobListItem)
|
|
{
|
|
_jobListItem = jobListItem;
|
|
_parent = parent;
|
|
_description.text = jobListItem.name;
|
|
//_icon.sprite = item.Icon;
|
|
}
|
|
|
|
public void OnPointerClick(PointerEventData eventData)
|
|
{
|
|
_parent.OnTabSelected(this);
|
|
}
|
|
|
|
public void OnPointerEnter(PointerEventData eventData)
|
|
{
|
|
_parent.OnTabEnter(this);
|
|
}
|
|
|
|
public void OnPointerExit(PointerEventData eventData)
|
|
{
|
|
_parent.OnTabExit(this);
|
|
}
|
|
|
|
}
|