Implement scene transitions
This commit is contained in:
@@ -1,11 +1,32 @@
|
||||
using System.IO;
|
||||
using UnityEngine;
|
||||
using UnityEngine.Playables;
|
||||
|
||||
/// <summary>
|
||||
/// StartScreen scene manager
|
||||
/// </summary>
|
||||
public class MainMenuScreen : MonoBehaviour
|
||||
{
|
||||
/// <summary>
|
||||
/// Reference to the enter animation scene playable director
|
||||
/// </summary>
|
||||
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,
|
||||
/// if not load the UserCreationScreen scene so the user can create a new account
|
||||
@@ -19,6 +40,22 @@ public class MainMenuScreen : MonoBehaviour
|
||||
}
|
||||
}
|
||||
|
||||
/// <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