fix school dialog option

This commit is contained in:
Vova
2023-12-18 22:55:58 +02:00
parent d9b84788e1
commit 22149e24c8
5 changed files with 210 additions and 20 deletions
@@ -14,4 +14,5 @@ MonoBehaviour:
m_EditorClassIdentifier:
Title: Hight School
Icon: {fileID: 21300000, guid: aef64b4574ccbc74897f2d9cd98cdf12, type: 3}
OptionsList: []
OptionsList:
- {fileID: 11400000, guid: b2f41f944cd1f3f4f82130491c97d5da, type: 2}
+7 -7
View File
@@ -31,16 +31,16 @@ public class EducationItemUI : MonoBehaviour, IDialogItemUI ,IPointerEnterHandl
_price.text = $"{_item.EnrollPrice}$";
_icon.sprite = item.Icon;
_button.enabled = true;
_button.onClick.AddListener(() => {
if (_button.enabled)
{
_parent.OnItemSelected(this);
}
});
}
public void Click()
{
if (_button.enabled)
{
_parent.OnItemSelected(this);
}
}
public void OnPointerEnter(PointerEventData eventData)
{
+6 -10
View File
@@ -28,17 +28,13 @@ public class JobItemUITemplate : MonoBehaviour, IDialogItemUI ,IPointerEnterHan
_sallary.text = $"{_item.Salary}$";
_icon.sprite = item.Icon;
_button.enabled = Player.Instance.Education>= _item.MinimumEducationSkill;
_button.onClick.AddListener(() => {
if (_button.enabled)
{
_parent.OnItemSelected(this);
}
});
}
public void Click()
{
if (_button.enabled)
{
_parent.OnItemSelected(this);
}
}
public void OnPointerEnter(PointerEventData eventData)
{
if (!_button.enabled) { print("Not enough education"); }