Options Dialog refactor for more generic
This commit is contained in:
@@ -1,9 +1,10 @@
|
||||
using Assets.Scripts.Interfaces;
|
||||
using TMPro;
|
||||
using UnityEngine;
|
||||
using UnityEngine.EventSystems;
|
||||
using UnityEngine.UI;
|
||||
|
||||
public class JobItemUITemplate : MonoBehaviour, IPointerEnterHandler
|
||||
public class JobItemUITemplate : MonoBehaviour, IDialogItemUI ,IPointerEnterHandler
|
||||
{
|
||||
[SerializeField]
|
||||
private TextMeshProUGUI _descreiption;
|
||||
@@ -15,18 +16,18 @@ public class JobItemUITemplate : MonoBehaviour, IPointerEnterHandler
|
||||
[SerializeField]
|
||||
private Button _button;
|
||||
|
||||
private JobSelectorUI _parent;
|
||||
private DialogOptionsUI _parent;
|
||||
private JobInfoSO _item;
|
||||
public JobInfoSO Item=> _item;
|
||||
|
||||
public void SetItem(JobSelectorUI parent,JobInfoSO item)
|
||||
public void SetItem(DialogOptionsUI parent,IDialogOption item)
|
||||
{
|
||||
_item= item;
|
||||
_item= item as JobInfoSO;
|
||||
_parent = parent;
|
||||
_descreiption.text = item.Description;
|
||||
_sallary.text = $"{item.Salary}$";
|
||||
_descreiption.text = _item.Description;
|
||||
_sallary.text = $"{_item.Salary}$";
|
||||
_icon.sprite = item.Icon;
|
||||
_button.enabled = Player.Instance.Education>=item.MinimumEducationSkill;
|
||||
_button.enabled = Player.Instance.Education>= _item.MinimumEducationSkill;
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user