wes-50 -> dev
This commit is contained in:
committed by
Tibe Habils
parent
33bdc1464a
commit
f5689090cd
@@ -3,6 +3,7 @@ using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
using UnityEngine.SceneManagement;
|
||||
using TMPro;
|
||||
|
||||
public class Webcam : MonoBehaviour
|
||||
{
|
||||
@@ -10,9 +11,13 @@ public class Webcam : MonoBehaviour
|
||||
WebCamTexture tex;
|
||||
|
||||
public RawImage display;
|
||||
public Button nextSignButton;
|
||||
public Button feedback;
|
||||
public GameObject popup;
|
||||
public TextMeshProUGUI dynamic;
|
||||
|
||||
void Awake(){
|
||||
popup.SetActive(false);
|
||||
|
||||
WebCamDevice device = WebCamTexture.devices[camdex];
|
||||
tex = new WebCamTexture(device.name);
|
||||
display.texture = tex;
|
||||
@@ -47,4 +52,23 @@ public class Webcam : 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);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user