Files
unity-application/Assets/Common/Scripts/StartScreenManager.cs
2023-03-12 19:36:37 +00:00

32 lines
783 B
C#

using System.IO;
using UnityEngine;
using UnityEngine.SceneManagement;
/// <summary>
/// StartScreen scene manager
/// </summary>
public class StartScreenManager : 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)
{
SceneManager.LoadScene("Accounts/Scenes/UserCreationScreen");
}
}
public void QuitApplication()
{
Application.Quit();
}
}