Resolve WES-76 "87 themeselection"

This commit is contained in:
Lukas Van Rossem
2023-03-13 21:49:40 +00:00
parent 94ec7e0359
commit a267301ab6
23 changed files with 141 additions and 893 deletions

View File

@@ -4,17 +4,32 @@ using UnityEngine.SceneManagement;
using UnityEngine.UI;
public class SpellingBeeWebcam : MonoBehaviour
{
{
/// <summary>
/// Index of the current camera
/// </summary>
int camdex = 0;
/// <summary>
/// Texture to paste on the display
/// </summary>
WebCamTexture tex;
/// <summary>
/// Display for the video feed
/// </summary>
public RawImage display;
/// <summary>
/// For later use
/// </summary>
public TextMeshProUGUI dynamic;
/// <summary>
/// Initialize the camera view
/// </summary>
void Awake()
{
//popup.SetActive(false);
WebCamDevice device = WebCamTexture.devices[camdex];
tex = new WebCamTexture(device.name);
display.texture = tex;
@@ -22,6 +37,9 @@ public class SpellingBeeWebcam : MonoBehaviour
tex.Play();
}
/// <summary>
/// Switch to a different webcam
/// </summary>
public void SwapCam()
{
if (WebCamTexture.devices.Length > 0)
@@ -44,7 +62,9 @@ public class SpellingBeeWebcam : MonoBehaviour
}
}
// Scene changing is implemented here to avoid problems with webcam
/// <summary>
/// Scene changing is implemented here to avoid problems with webcam
/// </summary>
public void LoadScene(string sceneName)
{
display.texture = null;
@@ -53,24 +73,4 @@ public class SpellingBeeWebcam : MonoBehaviour
SceneManager.LoadScene(sceneName);
}
/*
public void Show_feedback(){
if(popup.activeSelf){
dynamic.text = "";
popup.SetActive(false);
return;
}
double index = UnityEngine.Random.value;
if(index < 0.5){
dynamic.text = "Poor";
}
else if(index > 0.8){
dynamic.text = "Excellent";
}
else{
dynamic.text = "Good";
}
popup.SetActive(true);
}
*/
}