ReisenTasker/Assets/Scripts/Task/TaskUIObject.cs

17 lines
496 B
C#

using TMPro;
using UnityEngine;
using UnityEngine.UI;
public class TaskUIObject : MonoBehaviour
{
public Task taskToShow;
public TextMeshProUGUI taskTitle;
public Button thisButton;
public void SetTask(Task requestedTask)
{
taskToShow = requestedTask;
taskTitle.text = requestedTask.taskName;
thisButton.onClick.RemoveAllListeners();
thisButton.onClick.AddListener(() => TaskManager.instance.SetTaskUI(taskToShow)); //unsure if it should be on here or the new task ui function
}
}