using TMPro; using UnityEngine; using UnityEngine.Events; using UnityEngine.UI; /// /// Class to handle course progress card display /// public class CourseProgressCard : MonoBehaviour { /// /// Callback to the UpdateSelection /// public UnityAction selectActivity; /// /// Button to place to callback on /// public Button button; /// /// Reference to the progress so we can display a progress bar /// public PersistentDataController.SavedCourseProgress courseProgress; /// /// Reference to the list of minigameCards so we can query the correct course /// public CourseList courseList; /// /// UI reference to the thumbnail of the course /// public Image thumbnail; /// /// UI refeerence to the title of the course /// public TMP_Text title; /// /// Reference to the progress bar for the course /// public Slider progressBar; /// /// Start is called before the first frame update /// void Start() { Course course = courseList.GetCourseByIndex(courseProgress.courseIndex); thumbnail.sprite = course.thumbnail; title.text = course.title; progressBar.value = courseProgress.progress; button.onClick.AddListener(selectActivity); } }