Sprint 4
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
using System.IO;
|
||||
using UnityEngine;
|
||||
using UnityEngine.Playables;
|
||||
|
||||
/// <summary>
|
||||
/// StartScreen scene manager
|
||||
@@ -7,9 +8,24 @@ using UnityEngine;
|
||||
public class MainMenuScreen : MonoBehaviour
|
||||
{
|
||||
/// <summary>
|
||||
/// Referece to the userlist to check whether an user account is present
|
||||
/// Reference to the enter animation scene playable director
|
||||
/// </summary>
|
||||
public UserList userList;
|
||||
public PlayableDirector directorEnterFromBoot;
|
||||
|
||||
/// <summary>
|
||||
/// Reference to the enter animation scene playable director
|
||||
/// </summary>
|
||||
public PlayableDirector directorEnterFromCourseMenu;
|
||||
|
||||
/// <summary>
|
||||
/// Reference to the enter animation scene playable director
|
||||
/// </summary>
|
||||
public PlayableDirector directorEnterFromListMinigames;
|
||||
|
||||
/// <summary>
|
||||
/// Reference to the enter animation scene playable director
|
||||
/// </summary>
|
||||
public PlayableDirector directorEnterFromSettings;
|
||||
|
||||
/// <summary>
|
||||
/// Check on load whether a user is already present,
|
||||
@@ -17,13 +33,29 @@ public class MainMenuScreen : MonoBehaviour
|
||||
/// </summary>
|
||||
void Awake()
|
||||
{
|
||||
userList.Load();
|
||||
if (!File.Exists(UserList.PATH) || userList.GetUsers().Count <= 0)
|
||||
if (!File.Exists(PersistentDataController.PATH) || UserList.GetUsers().Count <= 0)
|
||||
{
|
||||
UserCreationScreen.canGoBack = false;
|
||||
SystemController.GetInstance().LoadNextScene("Accounts/Scenes/UserCreationScreen");
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Start is called before the first frame update
|
||||
/// </summary>
|
||||
void Start()
|
||||
{
|
||||
var sys = SystemController.GetInstance();
|
||||
if (sys.previousScene == SystemController.GetSceneIndex("Common/Scenes/Boot"))
|
||||
directorEnterFromBoot.Play();
|
||||
else if (sys.previousScene == SystemController.GetSceneIndex("Common/Scenes/CoursesMenuScreen"))
|
||||
directorEnterFromCourseMenu.Play();
|
||||
else if (sys.previousScene == SystemController.GetSceneIndex("Common/Scenes/ListMinigamesScreen"))
|
||||
directorEnterFromListMinigames.Play();
|
||||
else if (sys.previousScene == SystemController.GetSceneIndex("Common/Scenes/SettingsScreen"))
|
||||
directorEnterFromSettings.Play();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Quit the application
|
||||
/// </summary>
|
||||
|
||||
Reference in New Issue
Block a user