using TMPro; using UnityEngine; using UnityEngine.UI; /// /// Manager infopage for the Courses /// public class CourseActivityScreen : MonoBehaviour { // vvv TEMPORARY STUFF vvv public GameObject playButton; public GameObject previewButton; // ^^^ TEMPORARY STUFF ^^^ /// /// Reference to the courses /// public CourseList courseList; /// /// Reference to the users /// public UserList userList; /// /// Reference to the course progress /// private Progress progress; /// /// Title Display /// public TMP_Text title; /// /// Description Display /// public TMP_Text description; /// /// Image Display (Thumbnail) /// public Image courseImage; /// /// Progress bar Display /// public Slider progressBar; /// /// Sets the infopage for a given course /// void Start() { int index = courseList.currentCourseIndex; Course course = courseList.courses[index]; // vvv TEMPORARY STUFF vvv playButton.SetActive(course.theme.model != null); previewButton.SetActive(course.theme.model == null); // ^^^ TEMPORARY STUFF ^^^ title.text = course.title; description.text = course.description; courseImage.sprite = course.thumbnail; //slider.value = progressValue; // Set progress userList.Load(); progress = userList.GetCurrentUser().GetCourseProgress(course.index); if (progress != null) progressBar.value = progress.Get("courseProgress"); else progressBar.value = 0.0f; } /// /// Callback to start the course /// public void StartCourse() { SystemController.GetInstance().LoadNextScene("Courses/Scenes/CourseScreen"); } }