Resolve WES-99 "Cc refactor"

This commit is contained in:
Dries Van Schuylenbergh
2023-03-14 10:56:42 +00:00
parent 59d69f7412
commit dfc69ddd76
57 changed files with 733 additions and 1116 deletions

View File

@@ -0,0 +1,38 @@
using System.Collections;
using TMPro;
using UnityEngine;
/// <summary>
/// Authorize and check for available webcam(s)
/// </summary>
public class BootScreen : MonoBehaviour
{
/// <summary>
/// UI Reference to the text object to display an error message
/// </summary>
public TMP_Text errorText;
/// <summary>
/// Request authorization and check whether at least 1 webcam is available
/// </summary>
/// <returns>IEnumerator object</returns>
IEnumerator Start()
{
yield return Application.RequestUserAuthorization(UserAuthorization.WebCam);
if (Application.HasUserAuthorization(UserAuthorization.WebCam))
{
if (0 < WebCamTexture.devices.Length)
{
SystemController.GetInstance().SwapScene("Common/Scenes/MainMenuScreen");
}
else
{
errorText.text = "Zorg ervoor dat je webcam correct is aangesloten!";
}
}
else
{
errorText.text = "Zorg ervoor dat deze applicatie toegang heeft tot je webcam!";
}
}
}