Demo day booth
This commit is contained in:
committed by
Jelle De Geest
parent
5b4a3ec4e7
commit
fcd8acad1e
@@ -127,7 +127,7 @@ public class CoursesController : AbstractFeedback
|
||||
/// <summary>
|
||||
/// Reference to course progress bar
|
||||
/// </summary>
|
||||
public Slider progressBar;
|
||||
public SlicedSlider progressBar;
|
||||
|
||||
/// <summary>
|
||||
/// Reference to the animator of the confetti animation
|
||||
@@ -200,7 +200,7 @@ public class CoursesController : AbstractFeedback
|
||||
user.AddCourseProgress(progress);
|
||||
}
|
||||
UserList.Save();
|
||||
progressBar.value = progress.progress;
|
||||
progressBar.fillAmount = progress.progress;
|
||||
|
||||
currentWordIndex = 0;
|
||||
previousPanel = SetupPanel();
|
||||
@@ -258,7 +258,7 @@ public class CoursesController : AbstractFeedback
|
||||
return;
|
||||
|
||||
progress.progress = (float)progress.completedLearnables / (float)maxWords;
|
||||
progressBar.value = progress.progress;
|
||||
progressBar.fillAmount = progress.progress;
|
||||
|
||||
// Update UI if course is not finished yet
|
||||
if (progress.completedLearnables < maxWords)
|
||||
@@ -336,7 +336,7 @@ public class CoursesController : AbstractFeedback
|
||||
script.isFingerSpelling = course.theme.title == "Handalfabet";
|
||||
script.Display();
|
||||
signPredictor.SwapScreen(script.webcamScreen);
|
||||
courseTitle.text = "Welk gebaar wordt uitgebeeld?";
|
||||
courseTitle.text = "Welk gebaar zie je hier?";
|
||||
return panel;
|
||||
}
|
||||
case 2:
|
||||
@@ -396,18 +396,19 @@ public class CoursesController : AbstractFeedback
|
||||
{
|
||||
// Get current sign
|
||||
Learnable sign = course.theme.learnables[currentWordIndex];
|
||||
string currentSign = sign.name;
|
||||
string currentSign = sign.name.ToUpper().Replace(" ", "-");
|
||||
|
||||
// Get the predicted sign
|
||||
if (signPredictor != null && signPredictor.learnableProbabilities != null &&
|
||||
currentSign != null && signPredictor.learnableProbabilities.ContainsKey(currentSign))
|
||||
{
|
||||
//Debug.Log($"{signPredictor.learnableProbabilities.Aggregate("", (t, e) => $"{t}{e.Key}={e.Value}, ")}");
|
||||
float accCurrentSign = signPredictor.learnableProbabilities[currentSign];
|
||||
|
||||
// Get highest predicted sign
|
||||
string predictedSign = signPredictor.learnableProbabilities.Aggregate((a, b) => a.Value > b.Value ? a : b).Key;
|
||||
float accPredictSign = signPredictor.learnableProbabilities[predictedSign];
|
||||
Learnable predSign = course.theme.learnables.Find(l => l.name == predictedSign);
|
||||
Learnable predSign = course.theme.learnables.Find(l => l.name.ToUpper().Replace(" ", "-") == predictedSign);
|
||||
|
||||
if (feedbackText != null && feedbackProgressImage != null)
|
||||
{
|
||||
@@ -424,7 +425,7 @@ public class CoursesController : AbstractFeedback
|
||||
}
|
||||
else if (accPredictSign > predSign.thresholdPercentage)
|
||||
{
|
||||
feedbackText.text = $"Verkeerde gebaar: '{predictedSign}'";
|
||||
feedbackText.text = $"Verkeerde gebaar: '{predSign.name}'";
|
||||
col = new Color(0xf5 / 255.0f, 0x49 / 255.0f, 0x3d / 255.0f);
|
||||
accCurrentSign = 0.0f;
|
||||
}
|
||||
@@ -498,7 +499,8 @@ public class CoursesController : AbstractFeedback
|
||||
if (current == predicted)
|
||||
{
|
||||
hasAnswered = true;
|
||||
progress.UpdateLearnable(predicted, 1.5f);
|
||||
var p = progress.learnables.Find((l) => l.name.ToUpper().Replace(" ", "-") == predicted);
|
||||
progress.UpdateLearnable(p.name, 1.5f);
|
||||
confettiAnimation.SetTrigger("Display Confetti");
|
||||
StartCoroutine(WaitNextSign());
|
||||
}
|
||||
|
||||
@@ -187,7 +187,7 @@ public class PanelMultipleChoice : MonoBehaviour
|
||||
private IEnumerator GoToNextScreen()
|
||||
{
|
||||
// Wait for 5 seconds
|
||||
yield return new WaitForSeconds(3.0f);
|
||||
yield return new WaitForSeconds(1.5f);
|
||||
courseController.NextSign();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user