Sprint 4
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using UnityEngine.Playables;
|
||||
|
||||
/// <summary>
|
||||
/// CourseMenuScreen scene manager
|
||||
@@ -27,23 +28,28 @@ public class CourseMenuScreen : MonoBehaviour
|
||||
/// </summary>
|
||||
public GameObject courseItem;
|
||||
|
||||
/// <summary>
|
||||
/// Reference to the users so we can get the current user;
|
||||
/// </summary>
|
||||
public UserList userList;
|
||||
|
||||
/// <summary>
|
||||
/// Reference to the courses
|
||||
/// </summary>
|
||||
public CourseList courseList;
|
||||
|
||||
/// <summary>
|
||||
/// Reference to the scene playable director
|
||||
/// </summary>
|
||||
public PlayableDirector directorEnterFromDefault;
|
||||
|
||||
/// <summary>
|
||||
/// Reference to the scene playable director
|
||||
/// </summary>
|
||||
public PlayableDirector directorEnterFromMainMenu;
|
||||
|
||||
/// <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();
|
||||
|
||||
// Recent courses
|
||||
List<Tuple<CourseIndex, float>> recentCourses = user.GetRecentCourses();
|
||||
@@ -71,6 +77,13 @@ public class CourseMenuScreen : MonoBehaviour
|
||||
item.course = courseList.GetCourseByIndex(course.Item1);
|
||||
item.progress = course.Item2;
|
||||
}
|
||||
|
||||
var sys = SystemController.GetInstance();
|
||||
if (sys.previousScene == SystemController.GetSceneIndex("Common/Scenes/MainMenuScreen"))
|
||||
directorEnterFromMainMenu.Play();
|
||||
else
|
||||
directorEnterFromDefault.Play();
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
Reference in New Issue
Block a user