Files
SimUL/Assets/Scripts/UIElements/JobTabUITemplate.cs
T
vova 612b793677 Implement player education parameter
Enable job offer according to Player education
2023-05-01 19:40:14 +03:00

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);
}
}