This commit is contained in:
Jelle De Geest
2023-05-24 21:08:16 +02:00
parent 2a172bdb28
commit 163eb40c0f
1052 changed files with 20520 additions and 17253 deletions

View File

@@ -4,6 +4,7 @@ using System.Collections.Generic;
using System.Linq;
using UnityEngine;
using UnityEngine.UI;
/// <summary>
/// Shared abstract class for the minigameControllers
/// </summary>
@@ -69,7 +70,6 @@ public abstract class AbstractMinigameController : AbstractFeedback
// Prepare the signPredictor
signPredictor.SetModel(signPredictorTheme.modelIndex);
signPredictor.SwapScreen(webcamScreen);
signPredictor.SetSignsList(GetSignsList());
AddSelfAsListener();
}
@@ -94,7 +94,6 @@ public abstract class AbstractMinigameController : AbstractFeedback
// This part is the only reason that feedbackProgress is needed in the abstract
else if (feedbackProgress != null)
{
feedbackProgress.value = 0.0f;
}
@@ -115,6 +114,7 @@ public abstract class AbstractMinigameController : AbstractFeedback
score.time = DateTime.Now.ToString();
// Save the new score
user = UserList.GetCurrentUser();
var progress = user.GetMinigameProgress(minigame.index);
// Get the current list of scores
@@ -129,11 +129,12 @@ public abstract class AbstractMinigameController : AbstractFeedback
highestScores.Sort((a, b) => b.scoreValue.CompareTo(a.scoreValue));
// Only save the top 10 scores, so this list doesn't keep growing endlessly
progress.latestScores = latestScores.Take(10).ToList();
progress.latestScores = latestScores.TakeLast(10).ToList();
progress.highestScores = highestScores.Take(10).ToList();
PersistentDataController.GetInstance().Save();
}
/// <summary>
/// The function that activates when the game ends, handles some endgame logic and displays the EndPanel
/// </summary>
@@ -152,7 +153,7 @@ public abstract class AbstractMinigameController : AbstractFeedback
/// </summary>
/// <param name="accuracy">The accuracy of the passed sign</param>
/// <param name="predictedSign">The name of the passed sign</param>
protected abstract void ProcessMostProbableSign(float accuracy, string predictedSign);
public abstract void ProcessMostProbableSign(float accuracy, string predictedSign);
/// <summary>
/// Each minigame has their own way of calculating their score