Resolve WES-99 "Cc refactor"
This commit is contained in:
57
Assets/Common/Scripts/MainMenuScreen.cs
Normal file
57
Assets/Common/Scripts/MainMenuScreen.cs
Normal file
@@ -0,0 +1,57 @@
|
||||
using System.IO;
|
||||
using UnityEngine;
|
||||
|
||||
/// <summary>
|
||||
/// StartScreen scene manager
|
||||
/// </summary>
|
||||
public class MainMenuScreen : MonoBehaviour
|
||||
{
|
||||
/// <summary>
|
||||
/// Referece to the userlist to check whether an user account is present
|
||||
/// </summary>
|
||||
public UserList userList;
|
||||
|
||||
/// <summary>
|
||||
/// Check on load whether a user is already present,
|
||||
/// if not load the UserCreationScreen scene so the user can create a new account
|
||||
/// </summary>
|
||||
void Awake()
|
||||
{
|
||||
if (!File.Exists(UserList.PATH) || userList.GetUsers().Count <= 0)
|
||||
{
|
||||
SystemController.GetInstance().LoadNextScene("Accounts/Scenes/UserCreationScreen");
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Quit the application
|
||||
/// </summary>
|
||||
public void QuitApplication()
|
||||
{
|
||||
Application.Quit();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Load the `CoursesMenuScreen` scene
|
||||
/// </summary>
|
||||
public void GotoCourses()
|
||||
{
|
||||
SystemController.GetInstance().LoadNextScene("Common/Scenes/CoursesMenuScreen");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Load the `ListMinigamesScreen` scene
|
||||
/// </summary>
|
||||
public void GotoMinigames()
|
||||
{
|
||||
SystemController.GetInstance().LoadNextScene("Common/Scenes/ListMinigamesScreen");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Load the `SettingsScreen` scene
|
||||
/// </summary>
|
||||
public void GotoSettings()
|
||||
{
|
||||
SystemController.GetInstance().LoadNextScene("Common/Scenes/SettingsScreen");
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user