fix school dialog option
This commit is contained in:
@@ -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}
|
||||
|
||||
@@ -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)
|
||||
{
|
||||
|
||||
@@ -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"); }
|
||||
|
||||
Reference in New Issue
Block a user