Resolve WES-117 "Persistent data handling"

This commit is contained in:
Dries Van Schuylenbergh
2023-04-04 17:00:47 +00:00
parent 3499e61bb0
commit 5f4408063f
82 changed files with 1963 additions and 1190 deletions

View File

@@ -5,11 +5,6 @@ using UnityEngine;
/// </summary>
public class ListCoursesScreen : MonoBehaviour
{
/// <summary>
/// Reference to the userlist
/// </summary>
public UserList userList;
/// <summary>
/// Reference to the course-list container object
/// </summary>
@@ -30,8 +25,8 @@ public class ListCoursesScreen : MonoBehaviour
/// </summary>
void Start()
{
userList.Load();
User user = userList.GetCurrentUser();
PersistentDataController.GetInstance().Load();
User user = UserList.GetCurrentUser();
foreach (Course course in courseList.courses)
{
@@ -42,8 +37,8 @@ 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;
}
}