612b793677
Enable job offer according to Player education
40 lines
947 B
C#
40 lines
947 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=> _jobListItem;
|
|
private JobsListSO _jobListItem;
|
|
|
|
private JobSelectorUI _parent;
|
|
public void SetItem(JobSelectorUI parent, JobsListSO jobListItem)
|
|
{
|
|
_jobListItem = jobListItem;
|
|
_parent = parent;
|
|
_icon.sprite = jobListItem.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);
|
|
}
|
|
|
|
}
|