Resolve WES-90 "Integrate signpredictor in courses"

This commit is contained in:
Louis Adriaens
2023-03-18 19:53:17 +00:00
committed by Jerome Coudron
parent 1a75791d62
commit 746906294b
463 changed files with 99422 additions and 1187 deletions

View File

@@ -29,10 +29,6 @@ public class TemplateCourse : MonoBehaviour
/// </summary>
public Button feedback;
/// <summary>
/// This is a reference to the PANEL that holds the feedbackwindow
/// </summary>
public GameObject feedbackPopup;
/// <summary>
/// This is a reference to the textfield that holds the part of the feedback-window that will change: bad/good/excellent
@@ -134,15 +130,15 @@ public class TemplateCourse : MonoBehaviour
void Awake()
{
// Setting up Webcam
feedbackPopup.SetActive(false);
if (WebCamTexture.devices.Length > 0)
{
WebCamDevice device = WebCamTexture.devices[camdex];
tex = new WebCamTexture(device.name);
webcamDisplay.texture = tex;
// feedbackPopup.SetActive(false);
//if (WebCamTexture.devices.Length > 0)
//{
// WebCamDevice device = WebCamTexture.devices[camdex];
// tex = new WebCamTexture(device.name);
// webcamDisplay.texture = tex;
tex.Play();
}
// tex.Play();
//}
// Setting up course
course = courselist.courses[courselist.currentCourseIndex];
@@ -160,6 +156,9 @@ public class TemplateCourse : MonoBehaviour
}
userList.Save();
// Force the videoplayer to add bars to preserve aspect ratio
player.aspectRatio = VideoAspectRatio.FitInside;
// Setup UI
button.image.sprite = pauseSprite;
title.text = course.name;
@@ -305,9 +304,9 @@ public class TemplateCourse : MonoBehaviour
/// <param name="sceneName"> The path for the scene you want to travel to, assuming root-directory is Assets</param>
public void Back()
{
webcamDisplay.texture = null;
tex.Stop();
tex = null;
//webcamDisplay.texture = null;
//tex.Stop();
//tex = null;
SystemController.GetInstance().BackToPreviousScene();
}
@@ -316,27 +315,34 @@ public class TemplateCourse : MonoBehaviour
/// This function toggles between inactivity and activity for the popup panel.
/// This will be changed later when the model gets integrated, probably being timed to dissapear.
/// </summary>
public void ShowFeedback()
//public void ShowFeedback()
//{
// if (feedbackPopup.activeSelf)
// {
// dynamic.text = "";
// feedbackPopup.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";
// }
// feedbackPopup.SetActive(true);
//}
// Get currentWordIndex
public int GetWordIndex()
{
if (feedbackPopup.activeSelf)
{
dynamic.text = "";
feedbackPopup.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";
}
feedbackPopup.SetActive(true);
return currentWordIndex;
}
}