New basic signs model
This commit is contained in:
committed by
Jelle De Geest
parent
06aa9206ac
commit
43887af670
@@ -365,20 +365,20 @@ public class JustSignController : AbstractMinigameController
|
||||
/// </summary>
|
||||
/// <param name="accuracy">The accuracy of the passed sign</param>
|
||||
/// <param name="predictedSign">The name of the passed sign</param>
|
||||
protected override void ProcessMostProbableSign(float accuracy, string predictedSign)
|
||||
protected override void ProcessMostProbableSign(float distance, string predictedSign)
|
||||
{
|
||||
Learnable predSign = currentTheme.learnables.Find(l => l.name.ToUpper() == predictedSign);
|
||||
|
||||
Learnable predSign = currentTheme.learnables.Find(l => l.name.ToUpper().Replace(" ", "-") == predictedSign);
|
||||
//Learnable predSign = currentTheme.learnables.Find(l => l.name == predictedSign);
|
||||
// If there is a feedback-object, we wil change its appearance
|
||||
if (feedbackText != null && feedbackProgressImage != null)
|
||||
{
|
||||
Color col;
|
||||
if (accuracy > predSign.thresholdPercentage)
|
||||
if (distance < predSign.thresholdDistance)
|
||||
{
|
||||
feedbackText.text = $"Herkent '{predictedSign}'";
|
||||
col = new Color(0x8b / 255.0f, 0xd4 / 255.0f, 0x5e / 255.0f);
|
||||
}
|
||||
else if (accuracy > 0.9 * predSign.thresholdPercentage)
|
||||
else if (distance < 1.5 * predSign.thresholdDistance)
|
||||
{
|
||||
feedbackText.text = $"Lijkt op '{predictedSign}'";
|
||||
col = new Color(0xf2 / 255.0f, 0x7f / 255.0f, 0x0c / 255.0f);
|
||||
@@ -394,7 +394,7 @@ public class JustSignController : AbstractMinigameController
|
||||
|
||||
float oldValue = feedbackProgress.value;
|
||||
// use an exponential scale
|
||||
float newValue = Mathf.Exp(4 * (Mathf.Clamp(accuracy / predSign.thresholdPercentage, 0.0f, 1.0f) - 1.0f));
|
||||
float newValue = 1 - Mathf.Clamp(distance - predSign.thresholdDistance, 0.0f, 3.0f) / 3;
|
||||
feedbackProgress.gameObject.Tween("FeedbackUpdate", oldValue, newValue, 0.2f, TweenScaleFunctions.CubicEaseInOut, (t) =>
|
||||
{
|
||||
if (feedbackProgress != null)
|
||||
@@ -405,7 +405,7 @@ public class JustSignController : AbstractMinigameController
|
||||
}
|
||||
|
||||
// The logic for the internal workings of the game
|
||||
if (accuracy > predSign.thresholdPercentage)
|
||||
if (distance < predSign.thresholdDistance)
|
||||
{
|
||||
int matchedSymbolIndex = activeWords.IndexOf(predictedSign.ToUpper());
|
||||
|
||||
|
||||
Reference in New Issue
Block a user