This commit is contained in:
Jelle De Geest
2023-04-26 19:04:34 +02:00
parent 172938cec8
commit 47f8b96122
1004 changed files with 60756 additions and 117444 deletions

View File

@@ -1,15 +1,11 @@
using UnityEngine;
using UnityEngine.Playables;
/// <summary>
/// ListCourseScreen scene manager
/// </summary>
public class ListCoursesScreen : MonoBehaviour
{
/// <summary>
/// Reference to the userlist
/// </summary>
public UserList userList;
/// <summary>
/// Reference to the course-list container object
/// </summary>
@@ -25,13 +21,18 @@ public class ListCoursesScreen : MonoBehaviour
/// </summary>
public CourseList courseList;
/// <summary>
/// Reference to the scene playable director
/// </summary>
public PlayableDirector directorEnterFromCourseMenu;
/// <summary>
/// Start is called before the first frame update
/// </summary>
void Start()
{
userList.Load();
User user = userList.GetCurrentUser();
PersistentDataController.GetInstance().Load();
User user = UserList.GetCurrentUser();
foreach (Course course in courseList.courses)
{
@@ -42,9 +43,13 @@ public class ListCoursesScreen : MonoBehaviour
CourseItem item = instance.GetComponent<CourseItem>();
item.course = course;
Progress progress = user.GetCourseProgress(course.index);
item.progress = progress != null ? progress.Get<float>("courseProgress") : 0.0f;
var progress = user.GetCourseProgress(course.index);
item.progress = progress != null ? progress.progress : 0.0f;
}
var sys = SystemController.GetInstance();
if (sys.previousScene == SystemController.GetSceneIndex("Common/Scenes/CoursesMenuScreen"))
directorEnterFromCourseMenu.Play();
}
/// <summary>