Working on UI and job assignment, harvesting and depositing to TownHall working

This commit is contained in:
2026-06-12 11:36:57 +01:00
parent 479b0577a8
commit 529b25daf5
17106 changed files with 1370244 additions and 186 deletions

View File

@@ -0,0 +1,22 @@
using UnityEngine;
using UnityEngine.EventSystems;
// IPointerClickHandler is the magic interface that listens to ALL mouse clicks
public class JobButton : MonoBehaviour, IPointerClickHandler
{
[Tooltip("Select which job this specific button manages.")]
public NPC.Job jobType;
public void OnPointerClick(PointerEventData eventData)
{
// Intercept the click and pass the command to the UIController
if (eventData.button == PointerEventData.InputButton.Left)
{
UIController.Instance.AddJob(jobType);
}
else if (eventData.button == PointerEventData.InputButton.Right)
{
UIController.Instance.RemoveJob(jobType);
}
}
}