Sprint 4
This commit is contained in:
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user