From 785e56b8837137ce23e9e9d5d52f03b5d1ea6b7c Mon Sep 17 00:00:00 2001 From: Jelle De Geest Date: Tue, 16 May 2023 11:09:41 +0000 Subject: [PATCH] Annotations + Removal of unneeded lines --- .../Prefabs/CourseProgressCard.prefab | 6 +- .../Prefabs/MinigameProgressCard.prefab | 8 +- Assets/Accounts/Prefabs/UserCard.prefab | 4 +- .../Accounts/Scenes/UserProgressScreen.unity | 18 +- Assets/Accounts/Scripts/ChangeUserScreen.cs | 4 +- .../Accounts/Scripts/PanelCourseProgress.cs | 4 +- .../Accounts/Scripts/PanelMinigameProgress.cs | 4 +- Assets/Accounts/Scripts/UserProgressScreen.cs | 8 +- .../Tests/PlayMode/ChangeUserScreenTests.cs | 30 ++-- .../Tests/PlayMode/CourseProgressCardTests.cs | 2 +- .../PlayMode/LearnableProgressCardTests.cs | 2 +- .../PlayMode/MinigameProgressCardTests.cs | 4 +- .../PlayMode/PanelCourseProgressTests.cs | 8 +- .../PlayMode/PanelMinigamesProgressTests.cs | 10 +- .../Tests/PlayMode/ProgressGraphTests.cs | 2 +- .../Accounts/Tests/PlayMode/UserCardTests.cs | 2 +- .../Tests/PlayMode/UserCreationScreenTests.cs | 2 +- .../Tests/PlayMode/UserProgressScreenTests.cs | 2 +- .../Scripts/PersistentDataController.cs | 2 +- .../EditMode/PersistentDataControllerTests.cs | 18 +- .../Tests/PlayMode/SystemControllerTests.cs | 2 +- .../FingerspellingTheme.asset | 2 +- .../ScriptableObjects/HangmanThemeList.asset | 1 - .../Common/Tests/PlayMode/BackButtonTests.cs | 2 +- .../Common/Tests/PlayMode/BootScreenTests.cs | 2 +- .../PlayMode/CourseActivityScreenTests.cs | 2 +- .../Common/Tests/PlayMode/CourseItemTests.cs | 2 +- .../Tests/PlayMode/CourseMenuScreenTests.cs | 2 +- .../Tests/PlayMode/ListCoursesScreenTests.cs | 2 +- .../PlayMode/ListMinigamesScreenTests.cs | 2 +- .../Tests/PlayMode/MainMenuScreenTests.cs | 2 +- .../PlayMode/MinigameActivityScreenTests.cs | 4 +- .../Tests/PlayMode/MinigameItemTests.cs | 2 +- .../Common/Tests/PlayMode/ThemeItemTests.cs | 2 +- .../Common/Tests/PlayMode/UserButtonTests.cs | 2 +- Assets/Courses/Scenes/CourseScreen.unity | 10 +- Assets/Courses/Scripts/CoursesController.cs | 1 - .../Tests/PlayMode/CoursePanelsTests.cs | 2 +- .../Tests/PlayMode/CoursesControllerTests.cs | 2 +- .../Tests/PlayMode/HangmanPlaymodeTests.cs | 2 +- Assets/JustSign/Scenes/JustSignGame.unity | 10 +- .../Tests/PlayMode/JustSignControllerTests.cs | 2 +- .../MediaPipeUnity/Scripts/SignPredictor.cs | 165 ++++++------------ .../Scripts/AbstractMinigameController.cs | 1 - .../SpellingBee/Scenes/SpellingBeeGame.unity | 6 +- .../PlayMode/SpellingBeeControllerTests.cs | 7 +- 46 files changed, 161 insertions(+), 218 deletions(-) diff --git a/Assets/Accounts/Prefabs/CourseProgressCard.prefab b/Assets/Accounts/Prefabs/CourseProgressCard.prefab index 8eb5eaf..a47cdf9 100644 --- a/Assets/Accounts/Prefabs/CourseProgressCard.prefab +++ b/Assets/Accounts/Prefabs/CourseProgressCard.prefab @@ -504,8 +504,8 @@ MonoBehaviour: m_fontMaterials: [] m_fontColor32: serializedVersion: 2 - rgba: 4294967295 - m_fontColor: {r: 1, g: 1, b: 1, a: 1} + rgba: 4284235525 + m_fontColor: {r: 0.019607844, g: 0.24705882, b: 0.36078432, a: 1} m_enableVertexGradient: 0 m_colorMode: 3 m_fontColorGradient: @@ -623,7 +623,7 @@ MonoBehaviour: m_Name: m_EditorClassIdentifier: m_Material: {fileID: 0} - m_Color: {r: 0, g: 0.7529412, b: 1, a: 1} + m_Color: {r: 0.9490196, g: 0.49803922, b: 0.047058824, a: 1} m_RaycastTarget: 1 m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} m_Maskable: 1 diff --git a/Assets/Accounts/Prefabs/MinigameProgressCard.prefab b/Assets/Accounts/Prefabs/MinigameProgressCard.prefab index 832d01d..04b145a 100644 --- a/Assets/Accounts/Prefabs/MinigameProgressCard.prefab +++ b/Assets/Accounts/Prefabs/MinigameProgressCard.prefab @@ -75,8 +75,8 @@ MonoBehaviour: m_fontMaterials: [] m_fontColor32: serializedVersion: 2 - rgba: 4294967295 - m_fontColor: {r: 1, g: 1, b: 1, a: 1} + rgba: 4284235525 + m_fontColor: {r: 0.019607844, g: 0.24705882, b: 0.36078432, a: 1} m_enableVertexGradient: 0 m_colorMode: 3 m_fontColorGradient: @@ -433,8 +433,8 @@ MonoBehaviour: m_fontMaterials: [] m_fontColor32: serializedVersion: 2 - rgba: 4294967295 - m_fontColor: {r: 1, g: 1, b: 1, a: 1} + rgba: 4284235525 + m_fontColor: {r: 0.019607844, g: 0.24705882, b: 0.36078432, a: 1} m_enableVertexGradient: 0 m_colorMode: 3 m_fontColorGradient: diff --git a/Assets/Accounts/Prefabs/UserCard.prefab b/Assets/Accounts/Prefabs/UserCard.prefab index dc8137f..5048710 100644 --- a/Assets/Accounts/Prefabs/UserCard.prefab +++ b/Assets/Accounts/Prefabs/UserCard.prefab @@ -284,8 +284,8 @@ MonoBehaviour: m_fontMaterials: [] m_fontColor32: serializedVersion: 2 - rgba: 4294309365 - m_fontColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1} + rgba: 4284235525 + m_fontColor: {r: 0.019607844, g: 0.24705882, b: 0.36078432, a: 1} m_enableVertexGradient: 0 m_colorMode: 3 m_fontColorGradient: diff --git a/Assets/Accounts/Scenes/UserProgressScreen.unity b/Assets/Accounts/Scenes/UserProgressScreen.unity index 8eeb4c4..23c4d36 100644 --- a/Assets/Accounts/Scenes/UserProgressScreen.unity +++ b/Assets/Accounts/Scenes/UserProgressScreen.unity @@ -394,7 +394,7 @@ MonoBehaviour: m_Name: m_EditorClassIdentifier: m_Material: {fileID: 0} - m_Color: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 1} + m_Color: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1} m_RaycastTarget: 1 m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} m_Maskable: 1 @@ -766,7 +766,7 @@ MonoBehaviour: m_Name: m_EditorClassIdentifier: m_Material: {fileID: 0} - m_Color: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 1} + m_Color: {r: 0.62352943, g: 0.90588236, b: 0.9607843, a: 0.47058824} m_RaycastTarget: 1 m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} m_Maskable: 1 @@ -1821,7 +1821,7 @@ GameObject: m_Icon: {fileID: 0} m_NavMeshLayer: 0 m_StaticEditorFlags: 0 - m_IsActive: 0 + m_IsActive: 1 --- !u!114 &919169249 MonoBehaviour: m_ObjectHideFlags: 0 @@ -2278,8 +2278,8 @@ MonoBehaviour: m_fontMaterials: [] m_fontColor32: serializedVersion: 2 - rgba: 4279242768 - m_fontColor: {r: 0.0627451, g: 0.0627451, b: 0.0627451, a: 1} + rgba: 4284235525 + m_fontColor: {r: 0.019607844, g: 0.24705882, b: 0.36078432, a: 1} m_enableVertexGradient: 0 m_colorMode: 3 m_fontColorGradient: @@ -2623,7 +2623,7 @@ RectTransform: m_AnchorMin: {x: 0, y: 1} m_AnchorMax: {x: 1, y: 1} m_AnchoredPosition: {x: 0, y: 0} - m_SizeDelta: {x: -3, y: 0} + m_SizeDelta: {x: 0, y: 0} m_Pivot: {x: 0, y: 1} --- !u!114 &1338988555 MonoBehaviour: @@ -3105,7 +3105,7 @@ MonoBehaviour: m_Name: m_EditorClassIdentifier: m_Material: {fileID: 0} - m_Color: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 1} + m_Color: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1} m_RaycastTarget: 1 m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} m_Maskable: 1 @@ -3701,7 +3701,7 @@ RectTransform: m_RootOrder: 0 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 0} - m_AnchorMax: {x: 1, y: 1} + m_AnchorMax: {x: 0, y: 0} m_AnchoredPosition: {x: 0, y: 0} m_SizeDelta: {x: 20, y: 20} m_Pivot: {x: 0.5, y: 0.5} @@ -4225,7 +4225,7 @@ MonoBehaviour: m_Name: m_EditorClassIdentifier: m_Material: {fileID: 0} - m_Color: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 1} + m_Color: {r: 0.62352943, g: 0.90588236, b: 0.9607843, a: 0.47058824} m_RaycastTarget: 1 m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} m_Maskable: 1 diff --git a/Assets/Accounts/Scripts/ChangeUserScreen.cs b/Assets/Accounts/Scripts/ChangeUserScreen.cs index 01065c4..e0991da 100644 --- a/Assets/Accounts/Scripts/ChangeUserScreen.cs +++ b/Assets/Accounts/Scripts/ChangeUserScreen.cs @@ -72,7 +72,7 @@ public class ChangeUserScreen : MonoBehaviour Image background = instance.GetComponent(); userBackgrounds.Add(background); // Set background color - background.color = i == currentUserIndex ? new Color(66 / 255f, 158 / 255f, 189 / 255f, 1f) : Color.gray; + background.color = i == currentUserIndex ? new Color(66 / 255f, 158 / 255f, 189 / 255f, 1f) : new Color(159 / 255f, 231 / 255f, 245 / 255f, 1f); } } @@ -82,7 +82,7 @@ public class ChangeUserScreen : MonoBehaviour /// Index to the user in the this.userBackgrounds list private void UpdateSelection(int index) { - userBackgrounds[currentUserIndex].color = Color.gray; + userBackgrounds[currentUserIndex].color = new Color(159 / 255f, 231 / 255f, 245 / 255f, 1f); currentUserIndex = index; userBackgrounds[currentUserIndex].color = new Color(66 / 255f, 158 / 255f, 189 / 255f, 1f); } diff --git a/Assets/Accounts/Scripts/PanelCourseProgress.cs b/Assets/Accounts/Scripts/PanelCourseProgress.cs index bcb338e..ef25237 100644 --- a/Assets/Accounts/Scripts/PanelCourseProgress.cs +++ b/Assets/Accounts/Scripts/PanelCourseProgress.cs @@ -94,7 +94,7 @@ public class PanelCourseProgress : MonoBehaviour // Store reference to background so we can apply fancy coloring Image background = instance.GetComponent(); - background.color = Color.gray; + background.color = new Color(159 / 255f, 231 / 255f, 245 / 255f, 120/255f); this.courseCards.Add(Tuple.Create(background, courseProgress.courseIndex)); } if (0 < courses.Count) @@ -107,7 +107,7 @@ public class PanelCourseProgress : MonoBehaviour /// Index to the new course private void UpdateSelection(int newCourse) { - courseCards[selectedCourse].Item1.color = Color.gray; + courseCards[selectedCourse].Item1.color = new Color(159 / 255f, 231 / 255f, 245 / 255f, 120 / 255f); selectedCourse = newCourse; courseCards[selectedCourse].Item1.color = new Color(66 / 255f, 158 / 255f, 189 / 255f, 1f); diff --git a/Assets/Accounts/Scripts/PanelMinigameProgress.cs b/Assets/Accounts/Scripts/PanelMinigameProgress.cs index 7cc662c..9ebd5fc 100644 --- a/Assets/Accounts/Scripts/PanelMinigameProgress.cs +++ b/Assets/Accounts/Scripts/PanelMinigameProgress.cs @@ -90,7 +90,7 @@ public class PanelMinigameProgress : MonoBehaviour // Store reference to background so we can apply fancy coloring Image background = instance.GetComponent(); - background.color = Color.gray; + background.color = new Color(159 / 255f, 231 / 255f, 245 / 255f, 120 / 255f); minigameCards.Add(Tuple.Create(background, minigameProgress.minigameIndex)); } if (0 < minigames.Count) @@ -103,7 +103,7 @@ public class PanelMinigameProgress : MonoBehaviour /// Index to the new course private void UpdateSelection(int newMinigame) { - minigameCards[selectedMinigame].Item1.color = Color.gray; + minigameCards[selectedMinigame].Item1.color = new Color(159 / 255f, 231 / 255f, 245 / 255f, 120 / 255f); selectedMinigame = newMinigame; minigameCards[selectedMinigame].Item1.color = new Color(66 / 255f, 158 / 255f, 189 / 255f, 1f); diff --git a/Assets/Accounts/Scripts/UserProgressScreen.cs b/Assets/Accounts/Scripts/UserProgressScreen.cs index b708df0..541ffa9 100644 --- a/Assets/Accounts/Scripts/UserProgressScreen.cs +++ b/Assets/Accounts/Scripts/UserProgressScreen.cs @@ -64,9 +64,9 @@ public class UserProgressScreen : MonoBehaviour public void DisplayCourses() { coursesPanel.SetActive(true); - coursesTabButton.color = new Color(66 / 255f, 158 / 255f, 189 / 255f, 1f); + coursesTabButton.color = new Color(247 / 255f, 173 / 255f, 25 / 255f, 1f); minigamesPanel.SetActive(false); - minigamesTabButton.color = Color.gray; + minigamesTabButton.color = new Color(247 / 255f, 173 / 255f, 25 / 255f, 120/255f); } /// @@ -75,8 +75,8 @@ public class UserProgressScreen : MonoBehaviour public void DisplayMinigames() { coursesPanel.SetActive(false); - coursesTabButton.color = Color.gray; + coursesTabButton.color = new Color(247 / 255f, 173 / 255f, 25 / 255f, 120 / 255f); minigamesPanel.SetActive(true); - minigamesTabButton.color = new Color(66 / 255f, 158 / 255f, 189 / 255f, 1f); + minigamesTabButton.color = new Color(247 / 255f, 173 / 255f, 25 / 255f, 1f); } } diff --git a/Assets/Accounts/Tests/PlayMode/ChangeUserScreenTests.cs b/Assets/Accounts/Tests/PlayMode/ChangeUserScreenTests.cs index 8d54e6a..c87a645 100644 --- a/Assets/Accounts/Tests/PlayMode/ChangeUserScreenTests.cs +++ b/Assets/Accounts/Tests/PlayMode/ChangeUserScreenTests.cs @@ -29,7 +29,7 @@ public class ChangeUserScreenTests private IEnumerator Setup_ChangeUserScreen_SingleUser(string startScreen = "Accounts/Scenes/ChangeUserScreen") { string path = $"{Application.persistentDataPath}/wesign_unit_test.json"; - string oneUser = "{\"version\":1027,\"users\":[{\"entries\":[],\"username\":\"Tester0\",\"avatarIndex\":0,\"playtime\":0.0,\"minigames\":[],\"courses\":[]}],\"currentUser\":0,\"currentMinigame\":0,\"currentCourse\":0,\"currentTheme\":0}"; + string oneUser = "{\"version\":1537,\"users\":[{\"entries\":[],\"username\":\"Tester0\",\"avatarIndex\":0,\"playtime\":0.0,\"minigames\":[],\"courses\":[]}],\"currentUser\":0,\"currentMinigame\":0,\"currentCourse\":0,\"currentTheme\":0}"; File.WriteAllText(path, oneUser); PersistentDataController.PATH = path; @@ -53,7 +53,7 @@ public class ChangeUserScreenTests if (i < 4) users += ","; } const int currentUser = 2; - string fiveUsers = $"{{\"version\":1027,\"users\":[{users}],\"currentUser\":{currentUser},\"currentMinigame\":0,\"currentCourse\":0,\"currentTheme\":0}}"; + string fiveUsers = $"{{\"version\":1537,\"users\":[{users}],\"currentUser\":{currentUser},\"currentMinigame\":0,\"currentCourse\":0,\"currentTheme\":0}}"; File.WriteAllText(path, fiveUsers); PersistentDataController.PATH = path; @@ -132,7 +132,7 @@ public class ChangeUserScreenTests Assert.AreEqual(UserList.GetUsers().Count, cards.Count); for (int i = 0; i < cards.Count; i++) { - Color expected = i == currentUser ? new Color(66 / 255f, 158 / 255f, 189 / 255f, 1f) : Color.gray; + Color expected = i == currentUser ? new Color(66 / 255f, 158 / 255f, 189 / 255f, 1f) : new Color(159 / 255f, 231 / 255f, 245 / 255f, 1f); Assert.AreEqual(expected, cards[i].gameObject.GetComponent().color); } } @@ -150,7 +150,7 @@ public class ChangeUserScreenTests // Before update for (int i = 0; i < cards.Count; i++) { - Color expected = i == currentUser ? new Color(66 / 255f, 158 / 255f, 189 / 255f, 1f) : Color.gray; + Color expected = i == currentUser ? new Color(66 / 255f, 158 / 255f, 189 / 255f, 1f) : new Color(159 / 255f, 231 / 255f, 245 / 255f, 1f); Assert.AreEqual(expected, cards[i].gameObject.GetComponent().color); } @@ -161,7 +161,7 @@ public class ChangeUserScreenTests // After update for (int i = 0; i < cards.Count; i++) { - Color expected = i == newUser ? new Color(66 / 255f, 158 / 255f, 189 / 255f, 1f) : Color.gray; + Color expected = i == newUser ? new Color(66 / 255f, 158 / 255f, 189 / 255f, 1f) : new Color(159 / 255f, 231 / 255f, 245 / 255f, 1f); Assert.AreEqual(expected, cards[i].gameObject.GetComponent().color); } } @@ -179,7 +179,7 @@ public class ChangeUserScreenTests // Before update for (int i = 0; i < cards.Count; i++) { - Color expected = i == currentUser ? new Color(66 / 255f, 158 / 255f, 189 / 255f, 1f) : Color.gray; + Color expected = i == currentUser ? new Color(66 / 255f, 158 / 255f, 189 / 255f, 1f) : new Color(159 / 255f, 231 / 255f, 245 / 255f, 1f); Assert.AreEqual(expected, cards[i].gameObject.GetComponent().color); } @@ -189,7 +189,7 @@ public class ChangeUserScreenTests // After update for (int i = 0; i < cards.Count; i++) { - Color expected = i == currentUser ? new Color(66 / 255f, 158 / 255f, 189 / 255f, 1f) : Color.gray; + Color expected = i == currentUser ? new Color(66 / 255f, 158 / 255f, 189 / 255f, 1f) : new Color(159 / 255f, 231 / 255f, 245 / 255f, 1f); Assert.AreEqual(expected, cards[i].gameObject.GetComponent().color); } } @@ -207,7 +207,7 @@ public class ChangeUserScreenTests // Before update for (int i = 0; i < cards.Count; i++) { - Color expected = i == currentUser ? new Color(66 / 255f, 158 / 255f, 189 / 255f, 1f) : Color.gray; + Color expected = i == currentUser ? new Color(66 / 255f, 158 / 255f, 189 / 255f, 1f) : new Color(159 / 255f, 231 / 255f, 245 / 255f, 1f); Assert.AreEqual(expected, cards[i].gameObject.GetComponent().color); } @@ -218,7 +218,7 @@ public class ChangeUserScreenTests // After update for (int i = 0; i < cards.Count; i++) { - Color expected = i == newUser ? new Color(66 / 255f, 158 / 255f, 189 / 255f, 1f) : Color.gray; + Color expected = i == newUser ? new Color(66 / 255f, 158 / 255f, 189 / 255f, 1f) : new Color(159 / 255f, 231 / 255f, 245 / 255f, 1f); Assert.AreEqual(expected, cards[i].gameObject.GetComponent().color); } } @@ -269,7 +269,7 @@ public class ChangeUserScreenTests var oldCards = GameObject.FindObjectsOfType().ToList(); for (int i = 0; i < oldCards.Count; i++) { - Color expected = i == currentUser ? new Color(66 / 255f, 158 / 255f, 189 / 255f, 1f) : Color.gray; + Color expected = i == currentUser ? new Color(66 / 255f, 158 / 255f, 189 / 255f, 1f) : new Color(159 / 255f, 231 / 255f, 245 / 255f, 1f); Assert.AreEqual(expected, oldCards[i].gameObject.GetComponent().color); } @@ -284,7 +284,7 @@ public class ChangeUserScreenTests Assert.AreEqual(oldCards.Count - 1, newCards.Count); for (int i = 0; i < newCards.Count; i++) { - Color expected = i == (currentUser - 1) ? new Color(66 / 255f, 158 / 255f, 189 / 255f, 1f) : Color.gray; + Color expected = i == (currentUser - 1) ? new Color(66 / 255f, 158 / 255f, 189 / 255f, 1f) : new Color(159 / 255f, 231 / 255f, 245 / 255f, 1f); Assert.AreEqual(expected, newCards[i].gameObject.GetComponent().color); } } @@ -301,7 +301,7 @@ public class ChangeUserScreenTests var oldCards = GameObject.FindObjectsOfType().ToList(); for (int i = 0; i < oldCards.Count; i++) { - Color expected = i == currentUser ? new Color(66 / 255f, 158 / 255f, 189 / 255f, 1f) : Color.gray; + Color expected = i == currentUser ? new Color(66 / 255f, 158 / 255f, 189 / 255f, 1f) : new Color(159 / 255f, 231 / 255f, 245 / 255f, 1f); Assert.AreEqual(expected, oldCards[i].gameObject.GetComponent().color); } @@ -316,7 +316,7 @@ public class ChangeUserScreenTests Assert.AreEqual(oldCards.Count - 1, newCards.Count); for (int i = 0; i < newCards.Count; i++) { - Color expected = i == currentUser ? new Color(66 / 255f, 158 / 255f, 189 / 255f, 1f) : Color.gray; + Color expected = i == currentUser ? new Color(66 / 255f, 158 / 255f, 189 / 255f, 1f) : new Color(159 / 255f, 231 / 255f, 245 / 255f, 1f); Assert.AreEqual(expected, newCards[i].gameObject.GetComponent().color); } } @@ -333,7 +333,7 @@ public class ChangeUserScreenTests var oldCards = GameObject.FindObjectsOfType().ToList(); for (int i = 0; i < oldCards.Count; i++) { - Color expected = i == currentUser ? new Color(66 / 255f, 158 / 255f, 189 / 255f, 1f) : Color.gray; + Color expected = i == currentUser ? new Color(66 / 255f, 158 / 255f, 189 / 255f, 1f) : new Color(159 / 255f, 231 / 255f, 245 / 255f, 1f); Assert.AreEqual(expected, oldCards[i].gameObject.GetComponent().color); } @@ -348,7 +348,7 @@ public class ChangeUserScreenTests Assert.AreEqual(oldCards.Count - 1, newCards.Count); for (int i = 0; i < newCards.Count; i++) { - Color expected = i == currentUser ? new Color(66 / 255f, 158 / 255f, 189 / 255f, 1f) : Color.gray; + Color expected = i == currentUser ? new Color(66 / 255f, 158 / 255f, 189 / 255f, 1f) : new Color(159 / 255f, 231 / 255f, 245 / 255f, 1f); Assert.AreEqual(expected, newCards[i].gameObject.GetComponent().color); } } diff --git a/Assets/Accounts/Tests/PlayMode/CourseProgressCardTests.cs b/Assets/Accounts/Tests/PlayMode/CourseProgressCardTests.cs index d275dfb..09d4b3d 100644 --- a/Assets/Accounts/Tests/PlayMode/CourseProgressCardTests.cs +++ b/Assets/Accounts/Tests/PlayMode/CourseProgressCardTests.cs @@ -24,7 +24,7 @@ public class CourseProgressCardTests { string path = $"{Application.persistentDataPath}/wesign_unit_test.json"; string course = "{\"entries\":[],\"courseIndex\":0,\"progress\":0.03846153989434242,\"completedLearnables\":1,\"inUseLearnables\":7,\"totalLearnables\":26,\"learnables\":[{\"entries\":[],\"index\":0,\"inUse\":true,\"name\":\"A\",\"progress\":3.0},{\"entries\":[],\"index\":1,\"inUse\":true,\"name\":\"B\",\"progress\":4.5},{\"entries\":[],\"index\":2,\"inUse\":true,\"name\":\"C\",\"progress\":1.5},{\"entries\":[],\"index\":3,\"inUse\":true,\"name\":\"D\",\"progress\":1.5},{\"entries\":[],\"index\":4,\"inUse\":true,\"name\":\"E\",\"progress\":1.5},{\"entries\":[],\"index\":5,\"inUse\":true,\"name\":\"F\",\"progress\":1.5},{\"entries\":[],\"index\":6,\"inUse\":true,\"name\":\"G\",\"progress\":0.0},{\"entries\":[],\"index\":7,\"inUse\":false,\"name\":\"H\",\"progress\":0.0},{\"entries\":[],\"index\":8,\"inUse\":false,\"name\":\"I\",\"progress\":0.0},{\"entries\":[],\"index\":9,\"inUse\":false,\"name\":\"J\",\"progress\":0.0},{\"entries\":[],\"index\":10,\"inUse\":false,\"name\":\"K\",\"progress\":0.0},{\"entries\":[],\"index\":11,\"inUse\":false,\"name\":\"L\",\"progress\":0.0},{\"entries\":[],\"index\":12,\"inUse\":false,\"name\":\"M\",\"progress\":0.0},{\"entries\":[],\"index\":13,\"inUse\":false,\"name\":\"N\",\"progress\":0.0},{\"entries\":[],\"index\":14,\"inUse\":false,\"name\":\"O\",\"progress\":0.0},{\"entries\":[],\"index\":15,\"inUse\":false,\"name\":\"P\",\"progress\":0.0},{\"entries\":[],\"index\":16,\"inUse\":false,\"name\":\"Q\",\"progress\":0.0},{\"entries\":[],\"index\":17,\"inUse\":false,\"name\":\"R\",\"progress\":0.0},{\"entries\":[],\"index\":18,\"inUse\":false,\"name\":\"S\",\"progress\":0.0},{\"entries\":[],\"index\":19,\"inUse\":false,\"name\":\"T\",\"progress\":0.0},{\"entries\":[],\"index\":20,\"inUse\":false,\"name\":\"U\",\"progress\":0.0},{\"entries\":[],\"index\":21,\"inUse\":false,\"name\":\"V\",\"progress\":0.0},{\"entries\":[],\"index\":22,\"inUse\":false,\"name\":\"W\",\"progress\":0.0},{\"entries\":[],\"index\":23,\"inUse\":false,\"name\":\"X\",\"progress\":0.0},{\"entries\":[],\"index\":24,\"inUse\":false,\"name\":\"Y\",\"progress\":0.0},{\"entries\":[],\"index\":25,\"inUse\":false,\"name\":\"Z\",\"progress\":0.0}]}"; - string oneUser = $"{{\"version\":1027,\"users\":[{{\"entries\":[],\"username\":\"Tester0\",\"avatarIndex\":0,\"playtime\":0.0,\"minigames\":[],\"courses\":[{course}]}}],\"currentUser\":0,\"currentMinigame\":0,\"currentCourse\":0,\"currentTheme\":0}}"; + string oneUser = $"{{\"version\":1537,\"users\":[{{\"entries\":[],\"username\":\"Tester0\",\"avatarIndex\":0,\"playtime\":0.0,\"minigames\":[],\"courses\":[{course}]}}],\"currentUser\":0,\"currentMinigame\":0,\"currentCourse\":0,\"currentTheme\":0}}"; File.WriteAllText(path, oneUser); PersistentDataController.PATH = path; diff --git a/Assets/Accounts/Tests/PlayMode/LearnableProgressCardTests.cs b/Assets/Accounts/Tests/PlayMode/LearnableProgressCardTests.cs index ca4b14a..ba1b36c 100644 --- a/Assets/Accounts/Tests/PlayMode/LearnableProgressCardTests.cs +++ b/Assets/Accounts/Tests/PlayMode/LearnableProgressCardTests.cs @@ -24,7 +24,7 @@ public class LearnableProgressCardTests { string path = $"{Application.persistentDataPath}/wesign_unit_test.json"; string course = "{\"entries\":[],\"courseIndex\":0,\"progress\":0.03846153989434242,\"completedLearnables\":1,\"inUseLearnables\":7,\"totalLearnables\":26,\"learnables\":[{\"entries\":[],\"index\":0,\"inUse\":true,\"name\":\"A\",\"progress\":3.0},{\"entries\":[],\"index\":1,\"inUse\":true,\"name\":\"B\",\"progress\":4.5},{\"entries\":[],\"index\":2,\"inUse\":true,\"name\":\"C\",\"progress\":1.5},{\"entries\":[],\"index\":3,\"inUse\":true,\"name\":\"D\",\"progress\":1.5},{\"entries\":[],\"index\":4,\"inUse\":true,\"name\":\"E\",\"progress\":1.5},{\"entries\":[],\"index\":5,\"inUse\":true,\"name\":\"F\",\"progress\":1.5},{\"entries\":[],\"index\":6,\"inUse\":true,\"name\":\"G\",\"progress\":0.0},{\"entries\":[],\"index\":7,\"inUse\":false,\"name\":\"H\",\"progress\":0.0},{\"entries\":[],\"index\":8,\"inUse\":false,\"name\":\"I\",\"progress\":0.0},{\"entries\":[],\"index\":9,\"inUse\":false,\"name\":\"J\",\"progress\":0.0},{\"entries\":[],\"index\":10,\"inUse\":false,\"name\":\"K\",\"progress\":0.0},{\"entries\":[],\"index\":11,\"inUse\":false,\"name\":\"L\",\"progress\":0.0},{\"entries\":[],\"index\":12,\"inUse\":false,\"name\":\"M\",\"progress\":0.0},{\"entries\":[],\"index\":13,\"inUse\":false,\"name\":\"N\",\"progress\":0.0},{\"entries\":[],\"index\":14,\"inUse\":false,\"name\":\"O\",\"progress\":0.0},{\"entries\":[],\"index\":15,\"inUse\":false,\"name\":\"P\",\"progress\":0.0},{\"entries\":[],\"index\":16,\"inUse\":false,\"name\":\"Q\",\"progress\":0.0},{\"entries\":[],\"index\":17,\"inUse\":false,\"name\":\"R\",\"progress\":0.0},{\"entries\":[],\"index\":18,\"inUse\":false,\"name\":\"S\",\"progress\":0.0},{\"entries\":[],\"index\":19,\"inUse\":false,\"name\":\"T\",\"progress\":0.0},{\"entries\":[],\"index\":20,\"inUse\":false,\"name\":\"U\",\"progress\":0.0},{\"entries\":[],\"index\":21,\"inUse\":false,\"name\":\"V\",\"progress\":0.0},{\"entries\":[],\"index\":22,\"inUse\":false,\"name\":\"W\",\"progress\":0.0},{\"entries\":[],\"index\":23,\"inUse\":false,\"name\":\"X\",\"progress\":0.0},{\"entries\":[],\"index\":24,\"inUse\":false,\"name\":\"Y\",\"progress\":0.0},{\"entries\":[],\"index\":25,\"inUse\":false,\"name\":\"Z\",\"progress\":0.0}]}"; - string oneUser = $"{{\"version\":1027,\"users\":[{{\"entries\":[],\"username\":\"Tester0\",\"avatarIndex\":0,\"playtime\":0.0,\"minigames\":[],\"courses\":[{course}]}}],\"currentUser\":0,\"currentMinigame\":0,\"currentCourse\":0,\"currentTheme\":0}}"; + string oneUser = $"{{\"version\":1537,\"users\":[{{\"entries\":[],\"username\":\"Tester0\",\"avatarIndex\":0,\"playtime\":0.0,\"minigames\":[],\"courses\":[{course}]}}],\"currentUser\":0,\"currentMinigame\":0,\"currentCourse\":0,\"currentTheme\":0}}"; File.WriteAllText(path, oneUser); PersistentDataController.PATH = path; diff --git a/Assets/Accounts/Tests/PlayMode/MinigameProgressCardTests.cs b/Assets/Accounts/Tests/PlayMode/MinigameProgressCardTests.cs index 4a88c1c..b62f686 100644 --- a/Assets/Accounts/Tests/PlayMode/MinigameProgressCardTests.cs +++ b/Assets/Accounts/Tests/PlayMode/MinigameProgressCardTests.cs @@ -23,7 +23,7 @@ public class MinigameProgressCardTests { string path = $"{Application.persistentDataPath}/wesign_unit_test.json"; string minigame = "{\"entries\":[],\"minigameIndex\":1,\"latestScores\":[{\"scoreValue\":70,\"time\":\"19/04/2023 22:32:39\"},{\"scoreValue\":55,\"time\":\"20/04/2023 11:50:10\"},{\"scoreValue\":55,\"time\":\"20/04/2023 13:27:15\"}],\"highestScores\":[{\"scoreValue\":70,\"time\":\"19/04/2023 22:32:39\"},{\"scoreValue\":55,\"time\":\"20/04/2023 11:50:10\"},{\"scoreValue\":55,\"time\":\"20/04/2023 13:27:15\"}]}"; - string oneUser = $"{{\"version\":1027,\"users\":[{{\"entries\":[],\"username\":\"Tester0\",\"avatarIndex\":0,\"playtime\":0.0,\"minigames\":[{minigame}],\"courses\":[]}}],\"currentUser\":0,\"currentMinigame\":0,\"currentCourse\":0,\"currentTheme\":0}}"; + string oneUser = $"{{\"version\":1537,\"users\":[{{\"entries\":[],\"username\":\"Tester0\",\"avatarIndex\":0,\"playtime\":0.0,\"minigames\":[{minigame}],\"courses\":[]}}],\"currentUser\":0,\"currentMinigame\":0,\"currentCourse\":0,\"currentTheme\":0}}"; File.WriteAllText(path, oneUser); PersistentDataController.PATH = path; @@ -44,7 +44,7 @@ public class MinigameProgressCardTests { string path = $"{Application.persistentDataPath}/wesign_unit_test.json"; string minigame = "{\"entries\":[],\"minigameIndex\":0,\"latestScores\":[],\"highestScores\":[]}"; - string oneUser = $"{{\"version\":1027,\"users\":[{{\"entries\":[],\"username\":\"Tester0\",\"avatarIndex\":0,\"playtime\":0.0,\"minigames\":[{minigame}],\"courses\":[]}}],\"currentUser\":0,\"currentMinigame\":0,\"currentCourse\":0,\"currentTheme\":0}}"; + string oneUser = $"{{\"version\":1537,\"users\":[{{\"entries\":[],\"username\":\"Tester0\",\"avatarIndex\":0,\"playtime\":0.0,\"minigames\":[{minigame}],\"courses\":[]}}],\"currentUser\":0,\"currentMinigame\":0,\"currentCourse\":0,\"currentTheme\":0}}"; File.WriteAllText(path, oneUser); PersistentDataController.PATH = path; diff --git a/Assets/Accounts/Tests/PlayMode/PanelCourseProgressTests.cs b/Assets/Accounts/Tests/PlayMode/PanelCourseProgressTests.cs index ba20f71..8c6b417 100644 --- a/Assets/Accounts/Tests/PlayMode/PanelCourseProgressTests.cs +++ b/Assets/Accounts/Tests/PlayMode/PanelCourseProgressTests.cs @@ -24,7 +24,7 @@ public class PanelCourseProgressTests { string path = $"{Application.persistentDataPath}/wesign_unit_test.json"; string course = "{\"entries\":[],\"courseIndex\":0,\"progress\":0.03846153989434242,\"completedLearnables\":1,\"inUseLearnables\":7,\"totalLearnables\":26,\"learnables\":[{\"entries\":[],\"index\":0,\"inUse\":true,\"name\":\"A\",\"progress\":3.0},{\"entries\":[],\"index\":1,\"inUse\":true,\"name\":\"B\",\"progress\":4.5},{\"entries\":[],\"index\":2,\"inUse\":true,\"name\":\"C\",\"progress\":1.5},{\"entries\":[],\"index\":3,\"inUse\":true,\"name\":\"D\",\"progress\":1.5},{\"entries\":[],\"index\":4,\"inUse\":true,\"name\":\"E\",\"progress\":1.5},{\"entries\":[],\"index\":5,\"inUse\":true,\"name\":\"F\",\"progress\":1.5},{\"entries\":[],\"index\":6,\"inUse\":true,\"name\":\"G\",\"progress\":0.0},{\"entries\":[],\"index\":7,\"inUse\":false,\"name\":\"H\",\"progress\":0.0},{\"entries\":[],\"index\":8,\"inUse\":false,\"name\":\"I\",\"progress\":0.0},{\"entries\":[],\"index\":9,\"inUse\":false,\"name\":\"J\",\"progress\":0.0},{\"entries\":[],\"index\":10,\"inUse\":false,\"name\":\"K\",\"progress\":0.0},{\"entries\":[],\"index\":11,\"inUse\":false,\"name\":\"L\",\"progress\":0.0},{\"entries\":[],\"index\":12,\"inUse\":false,\"name\":\"M\",\"progress\":0.0},{\"entries\":[],\"index\":13,\"inUse\":false,\"name\":\"N\",\"progress\":0.0},{\"entries\":[],\"index\":14,\"inUse\":false,\"name\":\"O\",\"progress\":0.0},{\"entries\":[],\"index\":15,\"inUse\":false,\"name\":\"P\",\"progress\":0.0},{\"entries\":[],\"index\":16,\"inUse\":false,\"name\":\"Q\",\"progress\":0.0},{\"entries\":[],\"index\":17,\"inUse\":false,\"name\":\"R\",\"progress\":0.0},{\"entries\":[],\"index\":18,\"inUse\":false,\"name\":\"S\",\"progress\":0.0},{\"entries\":[],\"index\":19,\"inUse\":false,\"name\":\"T\",\"progress\":0.0},{\"entries\":[],\"index\":20,\"inUse\":false,\"name\":\"U\",\"progress\":0.0},{\"entries\":[],\"index\":21,\"inUse\":false,\"name\":\"V\",\"progress\":0.0},{\"entries\":[],\"index\":22,\"inUse\":false,\"name\":\"W\",\"progress\":0.0},{\"entries\":[],\"index\":23,\"inUse\":false,\"name\":\"X\",\"progress\":0.0},{\"entries\":[],\"index\":24,\"inUse\":false,\"name\":\"Y\",\"progress\":0.0},{\"entries\":[],\"index\":25,\"inUse\":false,\"name\":\"Z\",\"progress\":0.0}]}"; - string oneUser = $"{{\"version\":1027,\"users\":[{{\"entries\":[],\"username\":\"Tester0\",\"avatarIndex\":0,\"playtime\":0.0,\"minigames\":[],\"courses\":[{course}]}}],\"currentUser\":0,\"currentMinigame\":0,\"currentCourse\":0,\"currentTheme\":0}}"; + string oneUser = $"{{\"version\":1537,\"users\":[{{\"entries\":[],\"username\":\"Tester0\",\"avatarIndex\":0,\"playtime\":0.0,\"minigames\":[],\"courses\":[{course}]}}],\"currentUser\":0,\"currentMinigame\":0,\"currentCourse\":0,\"currentTheme\":0}}"; File.WriteAllText(path, oneUser); PersistentDataController.PATH = path; @@ -44,7 +44,7 @@ public class PanelCourseProgressTests private IEnumerator Setup_PanelCourseProgress_Empty() { string path = $"{Application.persistentDataPath}/wesign_unit_test.json"; - string oneUser = $"{{\"version\":1027,\"users\":[{{\"entries\":[],\"username\":\"Tester0\",\"avatarIndex\":0,\"playtime\":0.0,\"minigames\":[],\"courses\":[]}}],\"currentUser\":0,\"currentMinigame\":0,\"currentCourse\":0,\"currentTheme\":0}}"; + string oneUser = $"{{\"version\":1537,\"users\":[{{\"entries\":[],\"username\":\"Tester0\",\"avatarIndex\":0,\"playtime\":0.0,\"minigames\":[],\"courses\":[]}}],\"currentUser\":0,\"currentMinigame\":0,\"currentCourse\":0,\"currentTheme\":0}}"; File.WriteAllText(path, oneUser); PersistentDataController.PATH = path; @@ -65,7 +65,7 @@ public class PanelCourseProgressTests { string path = $"{Application.persistentDataPath}/wesign_unit_test.json"; string courses = "[{\"entries\":[],\"courseIndex\":1,\"progress\":-1.0,\"completedLearnables\":0,\"inUseLearnables\":1,\"totalLearnables\":15,\"learnables\":[{\"entries\":[],\"index\":0,\"inUse\":true,\"name\":\"Tot ziens\",\"progress\":0.0},{\"entries\":[],\"index\":1,\"inUse\":false,\"name\":\"Saluut\",\"progress\":0.0},{\"entries\":[],\"index\":2,\"inUse\":false,\"name\":\"Goedemorgen\",\"progress\":0.0},{\"entries\":[],\"index\":3,\"inUse\":false,\"name\":\"Goedemiddag\",\"progress\":0.0},{\"entries\":[],\"index\":4,\"inUse\":false,\"name\":\"Goed\",\"progress\":0.0},{\"entries\":[],\"index\":5,\"inUse\":false,\"name\":\"Slecht\",\"progress\":0.0},{\"entries\":[],\"index\":6,\"inUse\":false,\"name\":\"Ja\",\"progress\":0.0},{\"entries\":[],\"index\":7,\"inUse\":false,\"name\":\"Links\",\"progress\":0.0},{\"entries\":[],\"index\":8,\"inUse\":false,\"name\":\"Rechts\",\"progress\":0.0},{\"entries\":[],\"index\":9,\"inUse\":false,\"name\":\"Bedanken\",\"progress\":0.0},{\"entries\":[],\"index\":10,\"inUse\":false,\"name\":\"Sorry\",\"progress\":0.0},{\"entries\":[],\"index\":11,\"inUse\":false,\"name\":\"Goedenacht\",\"progress\":0.0},{\"entries\":[],\"index\":12,\"inUse\":false,\"name\":\"Smakelijk\",\"progress\":0.0},{\"entries\":[],\"index\":13,\"inUse\":false,\"name\":\"Goedenavond\",\"progress\":0.0},{\"entries\":[],\"index\":14,\"inUse\":false,\"name\":\"Nee\",\"progress\":0.0}]},{\"entries\":[],\"courseIndex\":0,\"progress\":0.07692307978868485,\"completedLearnables\":2,\"inUseLearnables\":8,\"totalLearnables\":26,\"learnables\":[{\"entries\":[],\"index\":0,\"inUse\":true,\"name\":\"A\",\"progress\":1.5},{\"entries\":[],\"index\":1,\"inUse\":true,\"name\":\"B\",\"progress\":3.0},{\"entries\":[],\"index\":2,\"inUse\":true,\"name\":\"C\",\"progress\":4.5},{\"entries\":[],\"index\":3,\"inUse\":true,\"name\":\"D\",\"progress\":0.0},{\"entries\":[],\"index\":4,\"inUse\":true,\"name\":\"E\",\"progress\":4.5},{\"entries\":[],\"index\":5,\"inUse\":true,\"name\":\"F\",\"progress\":1.5},{\"entries\":[],\"index\":6,\"inUse\":true,\"name\":\"G\",\"progress\":3.0},{\"entries\":[],\"index\":7,\"inUse\":true,\"name\":\"H\",\"progress\":1.5},{\"entries\":[],\"index\":8,\"inUse\":false,\"name\":\"I\",\"progress\":0.0},{\"entries\":[],\"index\":9,\"inUse\":false,\"name\":\"J\",\"progress\":0.0},{\"entries\":[],\"index\":10,\"inUse\":false,\"name\":\"K\",\"progress\":0.0},{\"entries\":[],\"index\":11,\"inUse\":false,\"name\":\"L\",\"progress\":0.0},{\"entries\":[],\"index\":12,\"inUse\":false,\"name\":\"M\",\"progress\":0.0},{\"entries\":[],\"index\":13,\"inUse\":false,\"name\":\"N\",\"progress\":0.0},{\"entries\":[],\"index\":14,\"inUse\":false,\"name\":\"O\",\"progress\":0.0},{\"entries\":[],\"index\":15,\"inUse\":false,\"name\":\"P\",\"progress\":0.0},{\"entries\":[],\"index\":16,\"inUse\":false,\"name\":\"Q\",\"progress\":0.0},{\"entries\":[],\"index\":17,\"inUse\":false,\"name\":\"R\",\"progress\":0.0},{\"entries\":[],\"index\":18,\"inUse\":false,\"name\":\"S\",\"progress\":0.0},{\"entries\":[],\"index\":19,\"inUse\":false,\"name\":\"T\",\"progress\":0.0},{\"entries\":[],\"index\":20,\"inUse\":false,\"name\":\"U\",\"progress\":0.0},{\"entries\":[],\"index\":21,\"inUse\":false,\"name\":\"V\",\"progress\":0.0},{\"entries\":[],\"index\":22,\"inUse\":false,\"name\":\"W\",\"progress\":0.0},{\"entries\":[],\"index\":23,\"inUse\":false,\"name\":\"X\",\"progress\":0.0},{\"entries\":[],\"index\":24,\"inUse\":false,\"name\":\"Y\",\"progress\":0.0},{\"entries\":[],\"index\":25,\"inUse\":false,\"name\":\"Z\",\"progress\":0.0}]},{\"entries\":[],\"courseIndex\":3,\"progress\":0.04545454680919647,\"completedLearnables\":1,\"inUseLearnables\":7,\"totalLearnables\":22,\"learnables\":[{\"entries\":[],\"index\":0,\"inUse\":true,\"name\":\"Aardappel\",\"progress\":4.5},{\"entries\":[],\"index\":1,\"inUse\":true,\"name\":\"Aardbei\",\"progress\":1.5},{\"entries\":[],\"index\":2,\"inUse\":true,\"name\":\"Ajuin\",\"progress\":1.5},{\"entries\":[],\"index\":3,\"inUse\":true,\"name\":\"Appel\",\"progress\":1.5},{\"entries\":[],\"index\":4,\"inUse\":true,\"name\":\"Appelsien\",\"progress\":3.0},{\"entries\":[],\"index\":5,\"inUse\":true,\"name\":\"Banaan\",\"progress\":3.0},{\"entries\":[],\"index\":6,\"inUse\":true,\"name\":\"Bessen\",\"progress\":0.0},{\"entries\":[],\"index\":7,\"inUse\":false,\"name\":\"Bloemkool\",\"progress\":0.0},{\"entries\":[],\"index\":8,\"inUse\":false,\"name\":\"Bonen\",\"progress\":0.0},{\"entries\":[],\"index\":9,\"inUse\":false,\"name\":\"Broccoli\",\"progress\":0.0},{\"entries\":[],\"index\":10,\"inUse\":false,\"name\":\"Champignon\",\"progress\":0.0},{\"entries\":[],\"index\":11,\"inUse\":false,\"name\":\"Erwt\",\"progress\":0.0},{\"entries\":[],\"index\":12,\"inUse\":false,\"name\":\"Kers\",\"progress\":0.0},{\"entries\":[],\"index\":13,\"inUse\":false,\"name\":\"Kiwi\",\"progress\":0.0},{\"entries\":[],\"index\":14,\"inUse\":false,\"name\":\"Komkommer\",\"progress\":0.0},{\"entries\":[],\"index\":15,\"inUse\":false,\"name\":\"Meloen\",\"progress\":0.0},{\"entries\":[],\"index\":16,\"inUse\":false,\"name\":\"Peer\",\"progress\":0.0},{\"entries\":[],\"index\":17,\"inUse\":false,\"name\":\"Perzik\",\"progress\":0.0},{\"entries\":[],\"index\":18,\"inUse\":false,\"name\":\"Pompoen\",\"progress\":0.0},{\"entries\":[],\"index\":19,\"inUse\":false,\"name\":\"Prei\",\"progress\":0.0},{\"entries\":[],\"index\":20,\"inUse\":false,\"name\":\"Tomaat\",\"progress\":0.0},{\"entries\":[],\"index\":21,\"inUse\":false,\"name\":\"Wortel\",\"progress\":0.0}]},{\"entries\":[],\"courseIndex\":2,\"progress\":-1.0,\"completedLearnables\":0,\"inUseLearnables\":4,\"totalLearnables\":22,\"learnables\":[{\"entries\":[],\"index\":0,\"inUse\":true,\"name\":\"Walvis\",\"progress\":0.0},{\"entries\":[],\"index\":1,\"inUse\":true,\"name\":\"Konijn\",\"progress\":0.0},{\"entries\":[],\"index\":2,\"inUse\":true,\"name\":\"Giraf\",\"progress\":0.0},{\"entries\":[],\"index\":3,\"inUse\":true,\"name\":\"Vis\",\"progress\":0.0},{\"entries\":[],\"index\":4,\"inUse\":false,\"name\":\"Schildpad\",\"progress\":0.0},{\"entries\":[],\"index\":5,\"inUse\":false,\"name\":\"Lama\",\"progress\":0.0},{\"entries\":[],\"index\":6,\"inUse\":false,\"name\":\"Dolfijn\",\"progress\":0.0},{\"entries\":[],\"index\":7,\"inUse\":false,\"name\":\"Haai\",\"progress\":0.0},{\"entries\":[],\"index\":8,\"inUse\":false,\"name\":\"Kangoeroe\",\"progress\":0.0},{\"entries\":[],\"index\":9,\"inUse\":false,\"name\":\"Kat\",\"progress\":0.0},{\"entries\":[],\"index\":10,\"inUse\":false,\"name\":\"Hond\",\"progress\":0.0},{\"entries\":[],\"index\":11,\"inUse\":false,\"name\":\"Kip\",\"progress\":0.0},{\"entries\":[],\"index\":12,\"inUse\":false,\"name\":\"Leeuw\",\"progress\":0.0},{\"entries\":[],\"index\":13,\"inUse\":false,\"name\":\"Olifant\",\"progress\":0.0},{\"entries\":[],\"index\":14,\"inUse\":false,\"name\":\"Paard\",\"progress\":0.0},{\"entries\":[],\"index\":15,\"inUse\":false,\"name\":\"Panda\",\"progress\":0.0},{\"entries\":[],\"index\":16,\"inUse\":false,\"name\":\"Papegaai\",\"progress\":0.0},{\"entries\":[],\"index\":17,\"inUse\":false,\"name\":\"Ram\",\"progress\":0.0},{\"entries\":[],\"index\":18,\"inUse\":false,\"name\":\"Tijger\",\"progress\":0.0},{\"entries\":[],\"index\":19,\"inUse\":false,\"name\":\"Varken\",\"progress\":0.0},{\"entries\":[],\"index\":20,\"inUse\":false,\"name\":\"Vos\",\"progress\":0.0},{\"entries\":[],\"index\":21,\"inUse\":false,\"name\":\"Zebra\",\"progress\":0.0}]},{\"entries\":[],\"courseIndex\":6,\"progress\":-1.0,\"completedLearnables\":0,\"inUseLearnables\":4,\"totalLearnables\":16,\"learnables\":[{\"entries\":[],\"index\":0,\"inUse\":true,\"name\":\"Broer\",\"progress\":0.0},{\"entries\":[],\"index\":1,\"inUse\":true,\"name\":\"Dochter\",\"progress\":0.0},{\"entries\":[],\"index\":2,\"inUse\":true,\"name\":\"Echtgenoot\",\"progress\":0.0},{\"entries\":[],\"index\":3,\"inUse\":true,\"name\":\"Familie\",\"progress\":0.0},{\"entries\":[],\"index\":4,\"inUse\":false,\"name\":\"Generatie\",\"progress\":0.0},{\"entries\":[],\"index\":5,\"inUse\":false,\"name\":\"Gezin\",\"progress\":0.0},{\"entries\":[],\"index\":6,\"inUse\":false,\"name\":\"Kind\",\"progress\":0.0},{\"entries\":[],\"index\":7,\"inUse\":false,\"name\":\"Moeder\",\"progress\":0.0},{\"entries\":[],\"index\":8,\"inUse\":false,\"name\":\"Neef\",\"progress\":0.0},{\"entries\":[],\"index\":9,\"inUse\":false,\"name\":\"Nicht\",\"progress\":0.0},{\"entries\":[],\"index\":10,\"inUse\":false,\"name\":\"Oom\",\"progress\":0.0},{\"entries\":[],\"index\":11,\"inUse\":false,\"name\":\"Ouders\",\"progress\":0.0},{\"entries\":[],\"index\":12,\"inUse\":false,\"name\":\"Tante\",\"progress\":0.0},{\"entries\":[],\"index\":13,\"inUse\":false,\"name\":\"Vader\",\"progress\":0.0},{\"entries\":[],\"index\":14,\"inUse\":false,\"name\":\"Zoon\",\"progress\":0.0},{\"entries\":[],\"index\":15,\"inUse\":false,\"name\":\"Zus\",\"progress\":0.0}]}]"; - string oneUser = $"{{\"version\":1027,\"users\":[{{\"entries\":[],\"username\":\"Tester0\",\"avatarIndex\":0,\"playtime\":0.0,\"minigames\":[],\"courses\":{courses}}}],\"currentUser\":0,\"currentMinigame\":0,\"currentCourse\":0,\"currentTheme\":0}}"; + string oneUser = $"{{\"version\":1537,\"users\":[{{\"entries\":[],\"username\":\"Tester0\",\"avatarIndex\":0,\"playtime\":0.0,\"minigames\":[],\"courses\":{courses}}}],\"currentUser\":0,\"currentMinigame\":0,\"currentCourse\":0,\"currentTheme\":0}}"; File.WriteAllText(path, oneUser); PersistentDataController.PATH = path; @@ -159,7 +159,7 @@ public class PanelCourseProgressTests Assert.AreEqual(new Color(66 / 255f, 158 / 255f, 189 / 255f, 1f), currentCourse.GetComponent().color); for (int i = 1; i < courses.Length; i++) - Assert.AreEqual(Color.gray, courses[i].GetComponent().color); + Assert.AreEqual(new Color(159 / 255f, 231 / 255f, 245 / 255f, 120 / 255f), courses[i].GetComponent().color); Assert.AreEqual(currentCourse.title.text, panel.courseTitle.text); Assert.AreEqual(0.0f, panel.progressBar.fillAmount); diff --git a/Assets/Accounts/Tests/PlayMode/PanelMinigamesProgressTests.cs b/Assets/Accounts/Tests/PlayMode/PanelMinigamesProgressTests.cs index 0190cb6..994f2c3 100644 --- a/Assets/Accounts/Tests/PlayMode/PanelMinigamesProgressTests.cs +++ b/Assets/Accounts/Tests/PlayMode/PanelMinigamesProgressTests.cs @@ -24,7 +24,7 @@ public class PanelMinigameProgressTests { string path = $"{Application.persistentDataPath}/wesign_unit_test.json"; string minigame = "{\"entries\":[],\"minigameIndex\":1,\"latestScores\":[{\"scoreValue\":70,\"time\":\"19/04/2023 22:32:39\"},{\"scoreValue\":55,\"time\":\"20/04/2023 11:50:10\"},{\"scoreValue\":55,\"time\":\"20/04/2023 13:27:15\"}],\"highestScores\":[{\"scoreValue\":70,\"time\":\"19/04/2023 22:32:39\"},{\"scoreValue\":55,\"time\":\"20/04/2023 11:50:10\"},{\"scoreValue\":55,\"time\":\"20/04/2023 13:27:15\"}]}"; - string oneUser = $"{{\"version\":1027,\"users\":[{{\"entries\":[],\"username\":\"Tester0\",\"avatarIndex\":0,\"playtime\":0.0,\"minigames\":[{minigame}],\"courses\":[]}}],\"currentUser\":0,\"currentMinigame\":0,\"currentCourse\":0,\"currentTheme\":0}}"; + string oneUser = $"{{\"version\":1537,\"users\":[{{\"entries\":[],\"username\":\"Tester0\",\"avatarIndex\":0,\"playtime\":0.0,\"minigames\":[{minigame}],\"courses\":[]}}],\"currentUser\":0,\"currentMinigame\":0,\"currentCourse\":0,\"currentTheme\":0}}"; File.WriteAllText(path, oneUser); PersistentDataController.PATH = path; @@ -44,7 +44,7 @@ public class PanelMinigameProgressTests private IEnumerator Setup_PanelMinigameProgress_Empty() { string path = $"{Application.persistentDataPath}/wesign_unit_test.json"; - string oneUser = $"{{\"version\":1027,\"users\":[{{\"entries\":[],\"username\":\"Tester0\",\"avatarIndex\":0,\"playtime\":0.0,\"minigames\":[],\"courses\":[]}}],\"currentUser\":0,\"currentMinigame\":0,\"currentCourse\":0,\"currentTheme\":0}}"; + string oneUser = $"{{\"version\":1537,\"users\":[{{\"entries\":[],\"username\":\"Tester0\",\"avatarIndex\":0,\"playtime\":0.0,\"minigames\":[],\"courses\":[]}}],\"currentUser\":0,\"currentMinigame\":0,\"currentCourse\":0,\"currentTheme\":0}}"; File.WriteAllText(path, oneUser); PersistentDataController.PATH = path; @@ -65,7 +65,7 @@ public class PanelMinigameProgressTests { string path = $"{Application.persistentDataPath}/wesign_unit_test.json"; string minigame = "{\"entries\":[],\"minigameIndex\":1,\"latestScores\":[],\"highestScores\":[]}"; - string oneUser = $"{{\"version\":1027,\"users\":[{{\"entries\":[],\"username\":\"Tester0\",\"avatarIndex\":0,\"playtime\":0.0,\"minigames\":[{minigame}],\"courses\":[]}}],\"currentUser\":0,\"currentMinigame\":0,\"currentCourse\":0,\"currentTheme\":0}}"; + string oneUser = $"{{\"version\":1537,\"users\":[{{\"entries\":[],\"username\":\"Tester0\",\"avatarIndex\":0,\"playtime\":0.0,\"minigames\":[{minigame}],\"courses\":[]}}],\"currentUser\":0,\"currentMinigame\":0,\"currentCourse\":0,\"currentTheme\":0}}"; File.WriteAllText(path, oneUser); PersistentDataController.PATH = path; @@ -86,7 +86,7 @@ public class PanelMinigameProgressTests { string path = $"{Application.persistentDataPath}/wesign_unit_test.json"; string minigame = "[{\"entries\":[],\"minigameIndex\":1,\"latestScores\":[{\"scoreValue\":70,\"time\":\"20/04/2023 16:08:43\"},{\"scoreValue\":20,\"time\":\"20/04/2023 16:11:53\"}],\"highestScores\":[{\"scoreValue\":70,\"time\":\"20/04/2023 16:08:43\"},{\"scoreValue\":20,\"time\":\"20/04/2023 16:11:53\"}]},{\"entries\":[],\"minigameIndex\":2,\"latestScores\":[{\"scoreValue\":194,\"time\":\"20/04/2023 15:27:41\"},{\"scoreValue\":155,\"time\":\"20/04/2023 15:28:56\"},{\"scoreValue\":84,\"time\":\"20/04/2023 15:42:10\"},{\"scoreValue\":465,\"time\":\"20/04/2023 16:14:22\"}],\"highestScores\":[{\"scoreValue\":465,\"time\":\"20/04/2023 16:14:22\"},{\"scoreValue\":194,\"time\":\"20/04/2023 15:27:41\"},{\"scoreValue\":155,\"time\":\"20/04/2023 15:28:56\"},{\"scoreValue\":84,\"time\":\"20/04/2023 15:42:10\"}]},{\"entries\":[],\"minigameIndex\":0,\"latestScores\":[{\"scoreValue\":1090,\"time\":\"20/04/2023 16:02:14\"},{\"scoreValue\":1180,\"time\":\"20/04/2023 16:07:02\"}],\"highestScores\":[{\"scoreValue\":1180,\"time\":\"20/04/2023 16:07:02\"},{\"scoreValue\":1090,\"time\":\"20/04/2023 16:02:14\"}]}]"; - string oneUser = $"{{\"version\":1027,\"users\":[{{\"entries\":[],\"username\":\"Tester0\",\"avatarIndex\":0,\"playtime\":0.0,\"minigames\":{minigame},\"courses\":[]}}],\"currentUser\":0,\"currentMinigame\":0,\"currentCourse\":0,\"currentTheme\":0}}"; + string oneUser = $"{{\"version\":1537,\"users\":[{{\"entries\":[],\"username\":\"Tester0\",\"avatarIndex\":0,\"playtime\":0.0,\"minigames\":{minigame},\"courses\":[]}}],\"currentUser\":0,\"currentMinigame\":0,\"currentCourse\":0,\"currentTheme\":0}}"; File.WriteAllText(path, oneUser); PersistentDataController.PATH = path; @@ -192,7 +192,7 @@ public class PanelMinigameProgressTests Assert.AreEqual(new Color(66 / 255f, 158 / 255f, 189 / 255f, 1f), currentMinigame.GetComponent().color); for (int i = 1; i < minigames.Length; i++) - Assert.AreEqual(Color.gray, minigames[i].GetComponent().color); + Assert.AreEqual(new Color(159 / 255f, 231 / 255f, 245 / 255f, 120 / 255f), minigames[i].GetComponent().color); Assert.AreEqual(currentMinigame.title.text, panel.minigameTitle.text); } diff --git a/Assets/Accounts/Tests/PlayMode/ProgressGraphTests.cs b/Assets/Accounts/Tests/PlayMode/ProgressGraphTests.cs index fcd1b94..a6d3485 100644 --- a/Assets/Accounts/Tests/PlayMode/ProgressGraphTests.cs +++ b/Assets/Accounts/Tests/PlayMode/ProgressGraphTests.cs @@ -32,7 +32,7 @@ public class ProgressGraphTests } string minigame = $"{{\"entries\":[],\"minigameIndex\":1,\"latestScores\":[{score}],\"highestScores\":[{score}]}}"; - string oneUser = $"{{\"version\":1027,\"users\":[{{\"entries\":[],\"username\":\"Tester0\",\"avatarIndex\":0,\"playtime\":0.0,\"minigames\":[{minigame}],\"courses\":[]}}],\"currentUser\":0,\"currentMinigame\":0,\"currentCourse\":0,\"currentTheme\":0}}"; + string oneUser = $"{{\"version\":1537,\"users\":[{{\"entries\":[],\"username\":\"Tester0\",\"avatarIndex\":0,\"playtime\":0.0,\"minigames\":[{minigame}],\"courses\":[]}}],\"currentUser\":0,\"currentMinigame\":0,\"currentCourse\":0,\"currentTheme\":0}}"; File.WriteAllText(path, oneUser); PersistentDataController.PATH = path; diff --git a/Assets/Accounts/Tests/PlayMode/UserCardTests.cs b/Assets/Accounts/Tests/PlayMode/UserCardTests.cs index c004c09..4d45099 100644 --- a/Assets/Accounts/Tests/PlayMode/UserCardTests.cs +++ b/Assets/Accounts/Tests/PlayMode/UserCardTests.cs @@ -23,7 +23,7 @@ public class UserCardTests public IEnumerator Setup_UserCard() { string path = $"{Application.persistentDataPath}/wesign_unit_test.json"; - string oneUser = "{\"version\":1027,\"users\":[{\"entries\":[],\"username\":\"Tester0\",\"avatarIndex\":0,\"playtime\":0.0,\"minigames\":[],\"courses\":[]}],\"currentUser\":0,\"currentMinigame\":0,\"currentCourse\":0,\"currentTheme\":0}"; + string oneUser = "{\"version\":1537,\"users\":[{\"entries\":[],\"username\":\"Tester0\",\"avatarIndex\":0,\"playtime\":0.0,\"minigames\":[],\"courses\":[]}],\"currentUser\":0,\"currentMinigame\":0,\"currentCourse\":0,\"currentTheme\":0}"; File.WriteAllText(path, oneUser); PersistentDataController.PATH = path; diff --git a/Assets/Accounts/Tests/PlayMode/UserCreationScreenTests.cs b/Assets/Accounts/Tests/PlayMode/UserCreationScreenTests.cs index 417dbf6..5bf531e 100644 --- a/Assets/Accounts/Tests/PlayMode/UserCreationScreenTests.cs +++ b/Assets/Accounts/Tests/PlayMode/UserCreationScreenTests.cs @@ -25,7 +25,7 @@ public class UserCreationScreenTests private IEnumerator Setup_UserCreationScreen(string startScreen = "Accounts/Scenes/UserCreationScreen") { string path = $"{Application.persistentDataPath}/wesign_unit_test.json"; - string oneUser = "{\"version\":1027,\"users\":[{\"entries\":[],\"username\":\"Tester0\",\"avatarIndex\":0,\"playtime\":0.0,\"minigames\":[],\"courses\":[]}],\"currentUser\":0,\"currentMinigame\":0,\"currentCourse\":0,\"currentTheme\":0}"; + string oneUser = "{\"version\":1537,\"users\":[{\"entries\":[],\"username\":\"Tester0\",\"avatarIndex\":0,\"playtime\":0.0,\"minigames\":[],\"courses\":[]}],\"currentUser\":0,\"currentMinigame\":0,\"currentCourse\":0,\"currentTheme\":0}"; File.WriteAllText(path, oneUser); PersistentDataController.PATH = path; diff --git a/Assets/Accounts/Tests/PlayMode/UserProgressScreenTests.cs b/Assets/Accounts/Tests/PlayMode/UserProgressScreenTests.cs index 90a9ee0..01d2217 100644 --- a/Assets/Accounts/Tests/PlayMode/UserProgressScreenTests.cs +++ b/Assets/Accounts/Tests/PlayMode/UserProgressScreenTests.cs @@ -26,7 +26,7 @@ public class UserProgressScreenTests string course = "{\"entries\":[],\"courseIndex\":0,\"progress\":0.03846153989434242,\"completedLearnables\":1,\"inUseLearnables\":7,\"totalLearnables\":26,\"learnables\":[{\"entries\":[],\"index\":0,\"inUse\":true,\"name\":\"A\",\"progress\":3.0},{\"entries\":[],\"index\":1,\"inUse\":true,\"name\":\"B\",\"progress\":4.5},{\"entries\":[],\"index\":2,\"inUse\":true,\"name\":\"C\",\"progress\":1.5},{\"entries\":[],\"index\":3,\"inUse\":true,\"name\":\"D\",\"progress\":1.5},{\"entries\":[],\"index\":4,\"inUse\":true,\"name\":\"E\",\"progress\":1.5},{\"entries\":[],\"index\":5,\"inUse\":true,\"name\":\"F\",\"progress\":1.5},{\"entries\":[],\"index\":6,\"inUse\":true,\"name\":\"G\",\"progress\":0.0},{\"entries\":[],\"index\":7,\"inUse\":false,\"name\":\"H\",\"progress\":0.0},{\"entries\":[],\"index\":8,\"inUse\":false,\"name\":\"I\",\"progress\":0.0},{\"entries\":[],\"index\":9,\"inUse\":false,\"name\":\"J\",\"progress\":0.0},{\"entries\":[],\"index\":10,\"inUse\":false,\"name\":\"K\",\"progress\":0.0},{\"entries\":[],\"index\":11,\"inUse\":false,\"name\":\"L\",\"progress\":0.0},{\"entries\":[],\"index\":12,\"inUse\":false,\"name\":\"M\",\"progress\":0.0},{\"entries\":[],\"index\":13,\"inUse\":false,\"name\":\"N\",\"progress\":0.0},{\"entries\":[],\"index\":14,\"inUse\":false,\"name\":\"O\",\"progress\":0.0},{\"entries\":[],\"index\":15,\"inUse\":false,\"name\":\"P\",\"progress\":0.0},{\"entries\":[],\"index\":16,\"inUse\":false,\"name\":\"Q\",\"progress\":0.0},{\"entries\":[],\"index\":17,\"inUse\":false,\"name\":\"R\",\"progress\":0.0},{\"entries\":[],\"index\":18,\"inUse\":false,\"name\":\"S\",\"progress\":0.0},{\"entries\":[],\"index\":19,\"inUse\":false,\"name\":\"T\",\"progress\":0.0},{\"entries\":[],\"index\":20,\"inUse\":false,\"name\":\"U\",\"progress\":0.0},{\"entries\":[],\"index\":21,\"inUse\":false,\"name\":\"V\",\"progress\":0.0},{\"entries\":[],\"index\":22,\"inUse\":false,\"name\":\"W\",\"progress\":0.0},{\"entries\":[],\"index\":23,\"inUse\":false,\"name\":\"X\",\"progress\":0.0},{\"entries\":[],\"index\":24,\"inUse\":false,\"name\":\"Y\",\"progress\":0.0},{\"entries\":[],\"index\":25,\"inUse\":false,\"name\":\"Z\",\"progress\":0.0}]}"; string minigame = "{\"entries\":[],\"minigameIndex\":1,\"latestScores\":[{\"scoreValue\":70,\"time\":\"19/04/2023 22:32:39\"},{\"scoreValue\":55,\"time\":\"20/04/2023 11:50:10\"},{\"scoreValue\":55,\"time\":\"20/04/2023 13:27:15\"}],\"highestScores\":[{\"scoreValue\":70,\"time\":\"19/04/2023 22:32:39\"},{\"scoreValue\":55,\"time\":\"20/04/2023 11:50:10\"},{\"scoreValue\":55,\"time\":\"20/04/2023 13:27:15\"}]}"; if (!progress) course = minigame = ""; - string oneUser = $"{{\"version\":1027,\"users\":[{{\"entries\":[],\"username\":\"Tester0\",\"avatarIndex\":0,\"playtime\":0.0,\"minigames\":[{minigame}],\"courses\":[{course}]}}],\"currentUser\":0,\"currentMinigame\":0,\"currentCourse\":0,\"currentTheme\":0}}"; + string oneUser = $"{{\"version\":1537,\"users\":[{{\"entries\":[],\"username\":\"Tester0\",\"avatarIndex\":0,\"playtime\":0.0,\"minigames\":[{minigame}],\"courses\":[{course}]}}],\"currentUser\":0,\"currentMinigame\":0,\"currentCourse\":0,\"currentTheme\":0}}"; File.WriteAllText(path, oneUser); PersistentDataController.PATH = path; diff --git a/Assets/Architecture/Scripts/PersistentDataController.cs b/Assets/Architecture/Scripts/PersistentDataController.cs index 10dbfbd..5b54f5f 100644 --- a/Assets/Architecture/Scripts/PersistentDataController.cs +++ b/Assets/Architecture/Scripts/PersistentDataController.cs @@ -19,7 +19,7 @@ public class PersistentDataController /// Current implementation version of the PersistentDataController /// /// MSB represent sprint version, LSB represent subversion - public const int VERSION = 0x04_03; + public const int VERSION = 0x06_01; /// /// Path of the .json-file to store all serialized data diff --git a/Assets/Architecture/Tests/EditMode/PersistentDataControllerTests.cs b/Assets/Architecture/Tests/EditMode/PersistentDataControllerTests.cs index 963e7a0..ec63cec 100644 --- a/Assets/Architecture/Tests/EditMode/PersistentDataControllerTests.cs +++ b/Assets/Architecture/Tests/EditMode/PersistentDataControllerTests.cs @@ -69,7 +69,7 @@ public class PersistentDataControllerTests { PersistentDataController.PATH = null; Assert.IsNotNull(PersistentDataController.GetInstance()); - Assert.AreEqual(0x04_03, PersistentDataController.VERSION); + Assert.AreEqual(0x06_01, PersistentDataController.VERSION); Assert.AreEqual($"{Application.persistentDataPath}/wesign_saved_data.json", PersistentDataController.PATH); } @@ -98,7 +98,7 @@ public class PersistentDataControllerTests FileAssert.Exists(PATH); string content = File.ReadAllText(PATH); - string expected = "{\"version\":1027,\"users\":[],\"currentUser\":-1,\"currentMinigame\":0,\"currentCourse\":0,\"currentTheme\":0,\"useGPU\":false}"; + string expected = "{\"version\":1537,\"users\":[],\"currentUser\":-1,\"currentMinigame\":0,\"currentCourse\":0,\"currentTheme\":0,\"useGPU\":false}"; Assert.AreEqual(expected, content); } @@ -117,7 +117,7 @@ public class PersistentDataControllerTests FileAssert.Exists(PATH); string content = File.ReadAllText(PATH); - string expected = "{\"version\":1027,\"users\":[],\"currentUser\":-1,\"currentMinigame\":0,\"currentCourse\":0,\"currentTheme\":0,\"useGPU\":false}"; + string expected = "{\"version\":1537,\"users\":[],\"currentUser\":-1,\"currentMinigame\":0,\"currentCourse\":0,\"currentTheme\":0,\"useGPU\":false}"; Assert.AreEqual(expected, content); } @@ -127,7 +127,7 @@ public class PersistentDataControllerTests [Test] public void Test_PersistentDataController_Load_Existing() { - string content = "{\"version\":1027,\"users\":[],\"currentUser\":-1,\"currentMinigame\":0,\"currentCourse\":0,\"currentTheme\":0,\"useGPU\":false}"; + string content = "{\"version\":1537,\"users\":[],\"currentUser\":-1,\"currentMinigame\":0,\"currentCourse\":0,\"currentTheme\":0,\"useGPU\":false}"; File.WriteAllText(PATH, content); Assert.IsTrue(pdc.Load(false)); } @@ -138,7 +138,7 @@ public class PersistentDataControllerTests [Test] public void Test_PersistentDataController_Load_OlderVersion() { - string content = "{\"version\":1026,\"users\":[],\"currentUser\":-1,\"currentMinigame\":0,\"currentCourse\":0,\"currentTheme\":0,\"useGPU\":false}"; + string content = "{\"version\":1536,\"users\":[],\"currentUser\":-1,\"currentMinigame\":0,\"currentCourse\":0,\"currentTheme\":0,\"useGPU\":false}"; File.WriteAllText(PATH, content); Assert.IsFalse(pdc.Load(false)); } @@ -149,7 +149,7 @@ public class PersistentDataControllerTests [Test] public void Test_PersistentDataController_Load_NewerVersion() { - string content = "{\"version\":1028,\"users\":[],\"currentUser\":-1,\"currentMinigame\":0,\"currentCourse\":0,\"currentTheme\":0,\"useGPU\":false}"; + string content = "{\"version\":1538,\"users\":[],\"currentUser\":-1,\"currentMinigame\":0,\"currentCourse\":0,\"currentTheme\":0,\"useGPU\":false}"; File.WriteAllText(PATH, content); Assert.IsFalse(pdc.Load(false)); } @@ -186,7 +186,7 @@ public class PersistentDataControllerTests File.WriteAllText(PATH, "https://www.youtube.com/watch?v=dQw4w9WgXcQ"); Assert.IsFalse(pdc.Load(true)); string content = File.ReadAllText(PATH); - string expected = "{\"version\":1027,\"users\":[],\"currentUser\":-1,\"currentMinigame\":0,\"currentCourse\":0,\"currentTheme\":0,\"useGPU\":false}"; + string expected = "{\"version\":1537,\"users\":[],\"currentUser\":-1,\"currentMinigame\":0,\"currentCourse\":0,\"currentTheme\":0,\"useGPU\":false}"; Assert.AreEqual(expected, content); } @@ -196,7 +196,7 @@ public class PersistentDataControllerTests [Test] public void Test_PersistentDataController_Version() { - const int VERSION = 0x04_03; + const int VERSION = 0x06_01; Assert.AreEqual(VERSION, PersistentDataController.VERSION); } @@ -216,7 +216,7 @@ public class PersistentDataControllerTests pdc.AddUser(d); string content = File.ReadAllText(PATH); - string expected = "{\"version\":1027,\"users\":[{\"entries\":[],\"username\":\"username\",\"avatarIndex\":0,\"playtime\":0.0,\"minigames\":[],\"courses\":[]}],\"currentUser\":0,\"currentMinigame\":0,\"currentCourse\":0,\"currentTheme\":0,\"useGPU\":false}"; + string expected = "{\"version\":1537,\"users\":[{\"entries\":[],\"username\":\"username\",\"avatarIndex\":0,\"playtime\":0.0,\"minigames\":[],\"courses\":[]}],\"currentUser\":0,\"currentMinigame\":0,\"currentCourse\":0,\"currentTheme\":0,\"useGPU\":false}"; Assert.AreEqual(expected, content); } diff --git a/Assets/Architecture/Tests/PlayMode/SystemControllerTests.cs b/Assets/Architecture/Tests/PlayMode/SystemControllerTests.cs index fd2e5df..cfc704d 100644 --- a/Assets/Architecture/Tests/PlayMode/SystemControllerTests.cs +++ b/Assets/Architecture/Tests/PlayMode/SystemControllerTests.cs @@ -30,7 +30,7 @@ public class SystemControllerTests public IEnumerator Setup_SystemController() { string path = $"{Application.persistentDataPath}/wesign_unit_test.json"; - string oneUser = "{\"version\":1027,\"users\":[{\"entries\":[],\"username\":\"Tester0\",\"avatarIndex\":0,\"playtime\":0.0,\"minigames\":[],\"courses\":[]}],\"currentUser\":0,\"currentMinigame\":0,\"currentCourse\":0,\"currentTheme\":0}"; + string oneUser = "{\"version\":1537,\"users\":[{\"entries\":[],\"username\":\"Tester0\",\"avatarIndex\":0,\"playtime\":0.0,\"minigames\":[],\"courses\":[]}],\"currentUser\":0,\"currentMinigame\":0,\"currentCourse\":0,\"currentTheme\":0}"; File.WriteAllText(path, oneUser); PersistentDataController.PATH = path; diff --git a/Assets/Common/ScriptableObjects/FingerspellingTheme.asset b/Assets/Common/ScriptableObjects/FingerspellingTheme.asset index 741013b..3db18b7 100644 --- a/Assets/Common/ScriptableObjects/FingerspellingTheme.asset +++ b/Assets/Common/ScriptableObjects/FingerspellingTheme.asset @@ -110,7 +110,7 @@ MonoBehaviour: - name: S image: {fileID: 21300000, guid: d934313344ebc264cb9a7ab061c5c4aa, type: 3} handGuide: {fileID: 21300000, guid: 5c157ea40838eb74f8226c89a7244613, type: 3} - thresholdDistance: 2 + thresholdDistance: 3 clip: {fileID: 32900000, guid: a110b3f082d2a8b4596df2964bf56b81, type: 3} - name: T image: {fileID: 21300000, guid: 1c0841dbd38336841acbe8b5d2b70ff4, type: 3} diff --git a/Assets/Common/ScriptableObjects/HangmanThemeList.asset b/Assets/Common/ScriptableObjects/HangmanThemeList.asset index 4ec2317..ca4a0d8 100644 --- a/Assets/Common/ScriptableObjects/HangmanThemeList.asset +++ b/Assets/Common/ScriptableObjects/HangmanThemeList.asset @@ -20,6 +20,5 @@ MonoBehaviour: - {fileID: 11400000, guid: 12f3260b96f41d1478804406d793a927, type: 2} - {fileID: 11400000, guid: 70b23bd64ac995b41ae7c26221a9d039, type: 2} - {fileID: 11400000, guid: adc0467561c43494db61e303d4aeefee, type: 2} - - {fileID: 11400000, guid: 44b4a0fb3c08b144a9fba68adaf2414f, type: 2} - {fileID: 11400000, guid: 4bdbe6f72de6d654cabc18639fdf7435, type: 2} - {fileID: 11400000, guid: dfe10d654a2eef045b1570cd4724c28f, type: 2} diff --git a/Assets/Common/Tests/PlayMode/BackButtonTests.cs b/Assets/Common/Tests/PlayMode/BackButtonTests.cs index 7ded43d..259fce5 100644 --- a/Assets/Common/Tests/PlayMode/BackButtonTests.cs +++ b/Assets/Common/Tests/PlayMode/BackButtonTests.cs @@ -17,7 +17,7 @@ public class BackButtonTests public IEnumerator SetupFunction() { string path = $"{Application.persistentDataPath}/wesign_unit_test.json"; - string oneUser = $"{{\"version\":1027,\"users\":[{{\"entries\":[],\"username\":\"TEST\",\"avatarIndex\":0,\"playtime\":0.0,\"minigames\":[],\"courses\":[]}}],\"currentUser\":0,\"currentMinigame\":0,\"currentCourse\":0,\"currentTheme\":0}}"; + string oneUser = $"{{\"version\":1537,\"users\":[{{\"entries\":[],\"username\":\"TEST\",\"avatarIndex\":0,\"playtime\":0.0,\"minigames\":[],\"courses\":[]}}],\"currentUser\":0,\"currentMinigame\":0,\"currentCourse\":0,\"currentTheme\":0}}"; File.WriteAllText(path, oneUser); PersistentDataController.PATH = path; diff --git a/Assets/Common/Tests/PlayMode/BootScreenTests.cs b/Assets/Common/Tests/PlayMode/BootScreenTests.cs index c161061..c13f0b9 100644 --- a/Assets/Common/Tests/PlayMode/BootScreenTests.cs +++ b/Assets/Common/Tests/PlayMode/BootScreenTests.cs @@ -18,7 +18,7 @@ public class BootScreenTests public IEnumerator BootWithUsersTest() { string path = $"{Application.persistentDataPath}/wesign_unit_test.json"; - string oneUser = $"{{\"version\":1027,\"users\":[{{\"entries\":[],\"username\":\"TEST\",\"avatarIndex\":0,\"playtime\":0.0,\"minigames\":[],\"courses\":[]}}],\"currentUser\":0,\"currentMinigame\":0,\"currentCourse\":0,\"currentTheme\":0}}"; + string oneUser = $"{{\"version\":1537,\"users\":[{{\"entries\":[],\"username\":\"TEST\",\"avatarIndex\":0,\"playtime\":0.0,\"minigames\":[],\"courses\":[]}}],\"currentUser\":0,\"currentMinigame\":0,\"currentCourse\":0,\"currentTheme\":0}}"; File.WriteAllText(path, oneUser); PersistentDataController.PATH = path; diff --git a/Assets/Common/Tests/PlayMode/CourseActivityScreenTests.cs b/Assets/Common/Tests/PlayMode/CourseActivityScreenTests.cs index 2090869..ab18be7 100644 --- a/Assets/Common/Tests/PlayMode/CourseActivityScreenTests.cs +++ b/Assets/Common/Tests/PlayMode/CourseActivityScreenTests.cs @@ -17,7 +17,7 @@ public class CourseActivityScreenTests public IEnumerator SetupFunction() { string path = $"{Application.persistentDataPath}/wesign_unit_test.json"; - string oneUser = $"{{\"version\":1027,\"users\":[{{\"entries\":[],\"username\":\"TEST\",\"avatarIndex\":0,\"playtime\":0.0,\"minigames\":[],\"courses\":[]}}],\"currentUser\":0,\"currentMinigame\":0,\"currentCourse\":0,\"currentTheme\":0}}"; + string oneUser = $"{{\"version\":1537,\"users\":[{{\"entries\":[],\"username\":\"TEST\",\"avatarIndex\":0,\"playtime\":0.0,\"minigames\":[],\"courses\":[]}}],\"currentUser\":0,\"currentMinigame\":0,\"currentCourse\":0,\"currentTheme\":0}}"; File.WriteAllText(path, oneUser); PersistentDataController.PATH = path; diff --git a/Assets/Common/Tests/PlayMode/CourseItemTests.cs b/Assets/Common/Tests/PlayMode/CourseItemTests.cs index 5c149d7..1be0998 100644 --- a/Assets/Common/Tests/PlayMode/CourseItemTests.cs +++ b/Assets/Common/Tests/PlayMode/CourseItemTests.cs @@ -19,7 +19,7 @@ public class CourseItemTests public IEnumerator SetupFunction() { string path = $"{Application.persistentDataPath}/wesign_unit_test.json"; - string oneUser = $"{{\"version\":1027,\"users\":[{{\"entries\":[],\"username\":\"TEST\",\"avatarIndex\":0,\"playtime\":0.0,\"minigames\":[],\"courses\":[]}}],\"currentUser\":0,\"currentMinigame\":0,\"currentCourse\":0,\"currentTheme\":0}}"; + string oneUser = $"{{\"version\":1537,\"users\":[{{\"entries\":[],\"username\":\"TEST\",\"avatarIndex\":0,\"playtime\":0.0,\"minigames\":[],\"courses\":[]}}],\"currentUser\":0,\"currentMinigame\":0,\"currentCourse\":0,\"currentTheme\":0}}"; File.WriteAllText(path, oneUser); PersistentDataController.PATH = path; diff --git a/Assets/Common/Tests/PlayMode/CourseMenuScreenTests.cs b/Assets/Common/Tests/PlayMode/CourseMenuScreenTests.cs index 08e654a..590a574 100644 --- a/Assets/Common/Tests/PlayMode/CourseMenuScreenTests.cs +++ b/Assets/Common/Tests/PlayMode/CourseMenuScreenTests.cs @@ -17,7 +17,7 @@ public class CourseMenuScreenTests public IEnumerator SetupFunction() { string path = $"{Application.persistentDataPath}/wesign_unit_test.json"; - string oneUser = $"{{\"version\":1027,\"users\":[{{\"entries\":[],\"username\":\"TEST\",\"avatarIndex\":0,\"playtime\":0.0,\"minigames\":[],\"courses\":[]}}],\"currentUser\":0,\"currentMinigame\":0,\"currentCourse\":0,\"currentTheme\":0}}"; + string oneUser = $"{{\"version\":1537,\"users\":[{{\"entries\":[],\"username\":\"TEST\",\"avatarIndex\":0,\"playtime\":0.0,\"minigames\":[],\"courses\":[]}}],\"currentUser\":0,\"currentMinigame\":0,\"currentCourse\":0,\"currentTheme\":0}}"; File.WriteAllText(path, oneUser); PersistentDataController.PATH = path; diff --git a/Assets/Common/Tests/PlayMode/ListCoursesScreenTests.cs b/Assets/Common/Tests/PlayMode/ListCoursesScreenTests.cs index ab2f003..d296151 100644 --- a/Assets/Common/Tests/PlayMode/ListCoursesScreenTests.cs +++ b/Assets/Common/Tests/PlayMode/ListCoursesScreenTests.cs @@ -17,7 +17,7 @@ public class ListCoursesScreenTests public IEnumerator SetupFunction() { string path = $"{Application.persistentDataPath}/wesign_unit_test.json"; - string oneUser = $"{{\"version\":1027,\"users\":[{{\"entries\":[],\"username\":\"TEST\",\"avatarIndex\":0,\"playtime\":0.0,\"minigames\":[],\"courses\":[]}}],\"currentUser\":0,\"currentMinigame\":0,\"currentCourse\":0,\"currentTheme\":0}}"; + string oneUser = $"{{\"version\":1537,\"users\":[{{\"entries\":[],\"username\":\"TEST\",\"avatarIndex\":0,\"playtime\":0.0,\"minigames\":[],\"courses\":[]}}],\"currentUser\":0,\"currentMinigame\":0,\"currentCourse\":0,\"currentTheme\":0}}"; File.WriteAllText(path, oneUser); PersistentDataController.PATH = path; diff --git a/Assets/Common/Tests/PlayMode/ListMinigamesScreenTests.cs b/Assets/Common/Tests/PlayMode/ListMinigamesScreenTests.cs index c494895..ff8f488 100644 --- a/Assets/Common/Tests/PlayMode/ListMinigamesScreenTests.cs +++ b/Assets/Common/Tests/PlayMode/ListMinigamesScreenTests.cs @@ -17,7 +17,7 @@ public class ListMinigamesScreenTests public IEnumerator SetupFunction() { string path = $"{Application.persistentDataPath}/wesign_unit_test.json"; - string oneUser = $"{{\"version\":1027,\"users\":[{{\"entries\":[],\"username\":\"TEST\",\"avatarIndex\":0,\"playtime\":0.0,\"minigames\":[],\"courses\":[]}}],\"currentUser\":0,\"currentMinigame\":0,\"currentCourse\":0,\"currentTheme\":0}}"; + string oneUser = $"{{\"version\":1537,\"users\":[{{\"entries\":[],\"username\":\"TEST\",\"avatarIndex\":0,\"playtime\":0.0,\"minigames\":[],\"courses\":[]}}],\"currentUser\":0,\"currentMinigame\":0,\"currentCourse\":0,\"currentTheme\":0}}"; File.WriteAllText(path, oneUser); PersistentDataController.PATH = path; diff --git a/Assets/Common/Tests/PlayMode/MainMenuScreenTests.cs b/Assets/Common/Tests/PlayMode/MainMenuScreenTests.cs index b274f48..0739740 100644 --- a/Assets/Common/Tests/PlayMode/MainMenuScreenTests.cs +++ b/Assets/Common/Tests/PlayMode/MainMenuScreenTests.cs @@ -18,7 +18,7 @@ public class MainMenuScreenTests public IEnumerator SetupFunction() { string path = $"{Application.persistentDataPath}/wesign_unit_test.json"; - string oneUser = $"{{\"version\":1027,\"users\":[{{\"entries\":[],\"username\":\"TEST\",\"avatarIndex\":0,\"playtime\":0.0,\"minigames\":[],\"courses\":[]}}],\"currentUser\":0,\"currentMinigame\":0,\"currentCourse\":0,\"currentTheme\":0}}"; + string oneUser = $"{{\"version\":1537,\"users\":[{{\"entries\":[],\"username\":\"TEST\",\"avatarIndex\":0,\"playtime\":0.0,\"minigames\":[],\"courses\":[]}}],\"currentUser\":0,\"currentMinigame\":0,\"currentCourse\":0,\"currentTheme\":0}}"; File.WriteAllText(path, oneUser); PersistentDataController.PATH = path; diff --git a/Assets/Common/Tests/PlayMode/MinigameActivityScreenTests.cs b/Assets/Common/Tests/PlayMode/MinigameActivityScreenTests.cs index a038a1f..373d1cb 100644 --- a/Assets/Common/Tests/PlayMode/MinigameActivityScreenTests.cs +++ b/Assets/Common/Tests/PlayMode/MinigameActivityScreenTests.cs @@ -17,7 +17,7 @@ public class MinigameActivityScreenTests public IEnumerator SetupFunction() { string path = $"{Application.persistentDataPath}/wesign_unit_test.json"; - string oneUser = $"{{\"version\":1027,\"users\":[{{\"entries\":[],\"username\":\"TEST\",\"avatarIndex\":0,\"playtime\":0.0,\"minigames\":[],\"courses\":[]}}],\"currentUser\":0,\"currentMinigame\":0,\"currentCourse\":0,\"currentTheme\":0}}"; + string oneUser = $"{{\"version\":1537,\"users\":[{{\"entries\":[],\"username\":\"TEST\",\"avatarIndex\":0,\"playtime\":0.0,\"minigames\":[],\"courses\":[]}}],\"currentUser\":0,\"currentMinigame\":0,\"currentCourse\":0,\"currentTheme\":0}}"; File.WriteAllText(path, oneUser); PersistentDataController.PATH = path; @@ -80,7 +80,7 @@ public class MinigameActivityScreenTests { string path = $"{Application.persistentDataPath}/wesign_unit_test.json"; string minigame = "{\"entries\":[],\"minigameIndex\":1,\"latestScores\":[{\"scoreValue\":70,\"time\":\"19/04/2023 22:32:39\"},{\"scoreValue\":55,\"time\":\"20/04/2023 11:50:10\"},{\"scoreValue\":55,\"time\":\"20/04/2023 13:27:15\"}],\"highestScores\":[{\"scoreValue\":70,\"time\":\"19/04/2023 22:32:39\"},{\"scoreValue\":55,\"time\":\"20/04/2023 11:50:10\"},{\"scoreValue\":55,\"time\":\"20/04/2023 13:27:15\"}]}"; - string oneUser = $"{{\"version\":1027,\"users\":[{{\"entries\":[],\"username\":\"Tester0\",\"avatarIndex\":0,\"playtime\":0.0,\"minigames\":[{minigame}],\"courses\":[]}}],\"currentUser\":0,\"currentMinigame\":0,\"currentCourse\":0,\"currentTheme\":0}}"; + string oneUser = $"{{\"version\":1537,\"users\":[{{\"entries\":[],\"username\":\"Tester0\",\"avatarIndex\":0,\"playtime\":0.0,\"minigames\":[{minigame}],\"courses\":[]}}],\"currentUser\":0,\"currentMinigame\":0,\"currentCourse\":0,\"currentTheme\":0}}"; File.WriteAllText(path, oneUser); PersistentDataController.PATH = path; diff --git a/Assets/Common/Tests/PlayMode/MinigameItemTests.cs b/Assets/Common/Tests/PlayMode/MinigameItemTests.cs index c58fed5..74156f2 100644 --- a/Assets/Common/Tests/PlayMode/MinigameItemTests.cs +++ b/Assets/Common/Tests/PlayMode/MinigameItemTests.cs @@ -19,7 +19,7 @@ public class MinigameItemTests public IEnumerator SetupFunction() { string path = $"{Application.persistentDataPath}/wesign_unit_test.json"; - string oneUser = $"{{\"version\":1027,\"users\":[{{\"entries\":[],\"username\":\"TEST\",\"avatarIndex\":0,\"playtime\":0.0,\"minigames\":[],\"courses\":[]}}],\"currentUser\":0,\"currentMinigame\":0,\"currentCourse\":0,\"currentTheme\":0}}"; + string oneUser = $"{{\"version\":1537,\"users\":[{{\"entries\":[],\"username\":\"TEST\",\"avatarIndex\":0,\"playtime\":0.0,\"minigames\":[],\"courses\":[]}}],\"currentUser\":0,\"currentMinigame\":0,\"currentCourse\":0,\"currentTheme\":0}}"; File.WriteAllText(path, oneUser); PersistentDataController.PATH = path; diff --git a/Assets/Common/Tests/PlayMode/ThemeItemTests.cs b/Assets/Common/Tests/PlayMode/ThemeItemTests.cs index 9ab94be..a772faa 100644 --- a/Assets/Common/Tests/PlayMode/ThemeItemTests.cs +++ b/Assets/Common/Tests/PlayMode/ThemeItemTests.cs @@ -19,7 +19,7 @@ public class ThemeItemTests public IEnumerator SetupFunction() { string path = $"{Application.persistentDataPath}/wesign_unit_test.json"; - string oneUser = $"{{\"version\":1027,\"users\":[{{\"entries\":[],\"username\":\"TEST\",\"avatarIndex\":0,\"playtime\":0.0,\"minigames\":[],\"courses\":[]}}],\"currentUser\":0,\"currentMinigame\":0,\"currentCourse\":0,\"currentTheme\":0}}"; + string oneUser = $"{{\"version\":1537,\"users\":[{{\"entries\":[],\"username\":\"TEST\",\"avatarIndex\":0,\"playtime\":0.0,\"minigames\":[],\"courses\":[]}}],\"currentUser\":0,\"currentMinigame\":0,\"currentCourse\":0,\"currentTheme\":0}}"; File.WriteAllText(path, oneUser); PersistentDataController.PATH = path; diff --git a/Assets/Common/Tests/PlayMode/UserButtonTests.cs b/Assets/Common/Tests/PlayMode/UserButtonTests.cs index 354ddd5..49a5111 100644 --- a/Assets/Common/Tests/PlayMode/UserButtonTests.cs +++ b/Assets/Common/Tests/PlayMode/UserButtonTests.cs @@ -17,7 +17,7 @@ public class UserButtonTests public IEnumerator SetupFunction() { string path = $"{Application.persistentDataPath}/wesign_unit_test.json"; - string oneUser = $"{{\"version\":1027,\"users\":[{{\"entries\":[],\"username\":\"TEST\",\"avatarIndex\":0,\"playtime\":0.0,\"minigames\":[],\"courses\":[]}}],\"currentUser\":0,\"currentMinigame\":0,\"currentCourse\":0,\"currentTheme\":0}}"; + string oneUser = $"{{\"version\":1537,\"users\":[{{\"entries\":[],\"username\":\"TEST\",\"avatarIndex\":0,\"playtime\":0.0,\"minigames\":[],\"courses\":[]}}],\"currentUser\":0,\"currentMinigame\":0,\"currentCourse\":0,\"currentTheme\":0}}"; File.WriteAllText(path, oneUser); PersistentDataController.PATH = path; diff --git a/Assets/Courses/Scenes/CourseScreen.unity b/Assets/Courses/Scenes/CourseScreen.unity index 7a8c242..b9d7a31 100644 --- a/Assets/Courses/Scenes/CourseScreen.unity +++ b/Assets/Courses/Scenes/CourseScreen.unity @@ -2020,7 +2020,7 @@ RectTransform: - {fileID: 880507767} - {fileID: 1881341544} m_Father: {fileID: 1559094126} - m_RootOrder: 4 + m_RootOrder: 3 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0.5, y: 0.5} m_AnchorMax: {x: 0.5, y: 0.5} @@ -2643,7 +2643,7 @@ PrefabInstance: objectReference: {fileID: 0} - target: {fileID: 8299246693487308515, guid: 3bccdf365a4fbea4d8fa1aa461d3dc5c, type: 3} propertyPath: m_RootOrder - value: 2 + value: 5 objectReference: {fileID: 0} - target: {fileID: 8299246693487308515, guid: 3bccdf365a4fbea4d8fa1aa461d3dc5c, type: 3} propertyPath: m_AnchorMax.x @@ -2842,7 +2842,7 @@ RectTransform: - {fileID: 1148236155} - {fileID: 554169248} m_Father: {fileID: 1559094126} - m_RootOrder: 5 + m_RootOrder: 4 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 0} m_AnchorMax: {x: 1, y: 1} @@ -2995,10 +2995,10 @@ RectTransform: m_Children: - {fileID: 388014848} - {fileID: 257279697} - - {fileID: 1335886460} - {fileID: 1677120324} - {fileID: 994659357} - {fileID: 1383144367} + - {fileID: 1335886460} m_Father: {fileID: 0} m_RootOrder: 5 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} @@ -3290,7 +3290,7 @@ RectTransform: m_Children: - {fileID: 1614792576} m_Father: {fileID: 1559094126} - m_RootOrder: 3 + m_RootOrder: 2 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 1} m_AnchorMax: {x: 1, y: 1} diff --git a/Assets/Courses/Scripts/CoursesController.cs b/Assets/Courses/Scripts/CoursesController.cs index 7112b04..61f6575 100644 --- a/Assets/Courses/Scripts/CoursesController.cs +++ b/Assets/Courses/Scripts/CoursesController.cs @@ -184,7 +184,6 @@ public class CoursesController : AbstractFeedback void Start() { StartCourseController(); - signPredictor.SetSignsList(GetSignsList()); signPredictor.SetModel(course.theme.modelIndex); AddSelfAsListener(); } diff --git a/Assets/Courses/Tests/PlayMode/CoursePanelsTests.cs b/Assets/Courses/Tests/PlayMode/CoursePanelsTests.cs index d305814..5a24b63 100644 --- a/Assets/Courses/Tests/PlayMode/CoursePanelsTests.cs +++ b/Assets/Courses/Tests/PlayMode/CoursePanelsTests.cs @@ -19,7 +19,7 @@ public class CoursePanelsTests public IEnumerator SetupFunction() { string path = $"{Application.persistentDataPath}/wesign_unit_test.json"; - string oneUser = $"{{\"version\":1027,\"users\":[{{\"entries\":[],\"username\":\"TEST\",\"avatarIndex\":0,\"playtime\":0.0,\"minigames\":[],\"courses\":[]}}],\"currentUser\":0,\"currentMinigame\":0,\"currentCourse\":0,\"currentTheme\":0}}"; + string oneUser = $"{{\"version\":1537,\"users\":[{{\"entries\":[],\"username\":\"TEST\",\"avatarIndex\":0,\"playtime\":0.0,\"minigames\":[],\"courses\":[]}}],\"currentUser\":0,\"currentMinigame\":0,\"currentCourse\":0,\"currentTheme\":0}}"; File.WriteAllText(path, oneUser); PersistentDataController.PATH = path; diff --git a/Assets/Courses/Tests/PlayMode/CoursesControllerTests.cs b/Assets/Courses/Tests/PlayMode/CoursesControllerTests.cs index e24f4c6..e82ce7d 100644 --- a/Assets/Courses/Tests/PlayMode/CoursesControllerTests.cs +++ b/Assets/Courses/Tests/PlayMode/CoursesControllerTests.cs @@ -21,7 +21,7 @@ public class CoursesControllerTests public IEnumerator SetupFunction() { string path = $"{Application.persistentDataPath}/wesign_unit_test.json"; - string oneUser = $"{{\"version\":1027,\"users\":[{{\"entries\":[],\"username\":\"TEST\",\"avatarIndex\":0,\"playtime\":0.0,\"minigames\":[],\"courses\":[]}}],\"currentUser\":0,\"currentMinigame\":0,\"currentCourse\":0,\"currentTheme\":0}}"; + string oneUser = $"{{\"version\":1537,\"users\":[{{\"entries\":[],\"username\":\"TEST\",\"avatarIndex\":0,\"playtime\":0.0,\"minigames\":[],\"courses\":[]}}],\"currentUser\":0,\"currentMinigame\":0,\"currentCourse\":0,\"currentTheme\":0}}"; File.WriteAllText(path, oneUser); PersistentDataController.PATH = path; diff --git a/Assets/Hangman/Tests/PlayMode/HangmanPlaymodeTests.cs b/Assets/Hangman/Tests/PlayMode/HangmanPlaymodeTests.cs index bf84b81..420be5e 100644 --- a/Assets/Hangman/Tests/PlayMode/HangmanPlaymodeTests.cs +++ b/Assets/Hangman/Tests/PlayMode/HangmanPlaymodeTests.cs @@ -30,7 +30,7 @@ public class HangmanPlaymodeTests public IEnumerator SetupFunction() { string path = $"{Application.persistentDataPath}/wesign_unit_test.json"; - string oneUser = $"{{\"version\":1027,\"users\":[{{\"entries\":[],\"username\":\"TEST\",\"avatarIndex\":0,\"playtime\":0.0,\"minigames\":[],\"courses\":[]}}],\"currentUser\":0,\"currentMinigame\":0,\"currentCourse\":0,\"currentTheme\":0}}"; + string oneUser = $"{{\"version\":1537,\"users\":[{{\"entries\":[],\"username\":\"TEST\",\"avatarIndex\":0,\"playtime\":0.0,\"minigames\":[],\"courses\":[]}}],\"currentUser\":0,\"currentMinigame\":0,\"currentCourse\":0,\"currentTheme\":0}}"; File.WriteAllText(path, oneUser); PersistentDataController.PATH = path; diff --git a/Assets/JustSign/Scenes/JustSignGame.unity b/Assets/JustSign/Scenes/JustSignGame.unity index 8347518..c96db82 100644 --- a/Assets/JustSign/Scenes/JustSignGame.unity +++ b/Assets/JustSign/Scenes/JustSignGame.unity @@ -258,7 +258,7 @@ RectTransform: m_ConstrainProportionsScale: 0 m_Children: [] m_Father: {fileID: 906197777} - m_RootOrder: 5 + m_RootOrder: 4 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0.5, y: 0.5} m_AnchorMax: {x: 0.5, y: 0.5} @@ -1780,7 +1780,7 @@ PrefabInstance: objectReference: {fileID: 0} - target: {fileID: 8299246693487308515, guid: 3bccdf365a4fbea4d8fa1aa461d3dc5c, type: 3} propertyPath: m_RootOrder - value: 4 + value: 7 objectReference: {fileID: 0} - target: {fileID: 8299246693487308515, guid: 3bccdf365a4fbea4d8fa1aa461d3dc5c, type: 3} propertyPath: m_AnchorMax.x @@ -2324,10 +2324,10 @@ RectTransform: - {fileID: 2093721209} - {fileID: 1627575592} - {fileID: 496523653} - - {fileID: 656044897} - {fileID: 106848221} - {fileID: 330718655} - {fileID: 1809925090} + - {fileID: 656044897} m_Father: {fileID: 1768150806} m_RootOrder: 0 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} @@ -4399,7 +4399,7 @@ PrefabInstance: objectReference: {fileID: 0} - target: {fileID: 4318122119930585316, guid: 7c71c65ecb5fe0449a8b0d178987f016, type: 3} propertyPath: m_RootOrder - value: 6 + value: 5 objectReference: {fileID: 0} - target: {fileID: 4318122119930585316, guid: 7c71c65ecb5fe0449a8b0d178987f016, type: 3} propertyPath: m_AnchorMax.x @@ -4752,7 +4752,7 @@ RectTransform: - {fileID: 901475051} - {fileID: 1767314334} m_Father: {fileID: 906197777} - m_RootOrder: 7 + m_RootOrder: 6 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 0} m_AnchorMax: {x: 1, y: 1} diff --git a/Assets/JustSign/Tests/PlayMode/JustSignControllerTests.cs b/Assets/JustSign/Tests/PlayMode/JustSignControllerTests.cs index dcab982..11d33ea 100644 --- a/Assets/JustSign/Tests/PlayMode/JustSignControllerTests.cs +++ b/Assets/JustSign/Tests/PlayMode/JustSignControllerTests.cs @@ -17,7 +17,7 @@ public class JustSignControllerTests public IEnumerator SetupFunction() { string path = $"{Application.persistentDataPath}/wesign_unit_test.json"; - string oneUser = $"{{\"version\":1027,\"users\":[{{\"entries\":[],\"username\":\"TEST\",\"avatarIndex\":0,\"playtime\":0.0,\"minigames\":[],\"courses\":[]}}],\"currentUser\":0,\"currentMinigame\":0,\"currentCourse\":0,\"currentTheme\":0}}"; + string oneUser = $"{{\"version\":1537,\"users\":[{{\"entries\":[],\"username\":\"TEST\",\"avatarIndex\":0,\"playtime\":0.0,\"minigames\":[],\"courses\":[]}}],\"currentUser\":0,\"currentMinigame\":0,\"currentCourse\":0,\"currentTheme\":0}}"; File.WriteAllText(path, oneUser); PersistentDataController.GetInstance().Load(); diff --git a/Assets/MediaPipeUnity/Scripts/SignPredictor.cs b/Assets/MediaPipeUnity/Scripts/SignPredictor.cs index fe29e18..93e9cb9 100644 --- a/Assets/MediaPipeUnity/Scripts/SignPredictor.cs +++ b/Assets/MediaPipeUnity/Scripts/SignPredictor.cs @@ -10,7 +10,9 @@ using System.Threading.Tasks; using UnityEngine; using UnityEngine.UI; - +/// +/// Class for EmbeddingData, Embeddings are used in the Model to make prediction +/// [System.Serializable] public class EmbeddingData { @@ -19,26 +21,45 @@ public class EmbeddingData public int labels; } +/// +/// Class for a list of EmbeddingData +/// [System.Serializable] public class EmbeddingDataList { public List dataList; } +/// +/// Class to save the distance of an embedding +/// public class DistanceEmbedding { public float distance; public EmbeddingData embeddingData; + /// + /// Creation of DistanceEmbedding + /// + /// + /// public DistanceEmbedding(float distance, EmbeddingData embeddingData) { this.distance = distance; this.embeddingData = embeddingData; } } - +/// +/// Class to compare the distance of two embeddings +/// public class DistanceComparer : IComparer { + /// + /// Function to compare the distance of two DistanceEmbeddings + /// + /// + /// + /// public int Compare(DistanceEmbedding x, DistanceEmbedding y) { return x.distance.CompareTo(y.distance); @@ -46,7 +67,7 @@ public class DistanceComparer : IComparer } /// -/// +/// Sign predictor class which gives input to the games/courses by extractin information from the webcam /// public class SignPredictor : MonoBehaviour { @@ -95,7 +116,6 @@ public class SignPredictor : MonoBehaviour return predictions; } - /// /// Disposing the MLEdgeModel /// @@ -153,7 +173,6 @@ public class SignPredictor : MonoBehaviour return predictions; } - /// /// Disposing the MLEdgeModel /// @@ -163,6 +182,9 @@ public class SignPredictor : MonoBehaviour } } + /// + /// List of listeners that want to get notified on new predictions + /// public List listeners = new List(); /// @@ -170,9 +192,6 @@ public class SignPredictor : MonoBehaviour /// private NatMLSignPredictorEmbed predictor_embed; - private NatMLSignPredictor predictor; - - /// /// The asynchronous predictor which is used to predict the sign using an MLEdgemodel /// @@ -197,6 +216,10 @@ public class SignPredictor : MonoBehaviour /// Reference to the model info file /// public TextAsset modelInfoFile; + + /// + /// Reference to the model Embedding file + /// public TextAsset modelInfoFileEmbedding; /// @@ -296,11 +319,11 @@ public class SignPredictor : MonoBehaviour /// private static bool resourceManagerIsInitialized = false; - private List signs; + /// + /// List of the EmbeddingData + /// private EmbeddingDataList embeddingDataList; - private ModelIndex modelID; - /// /// Google Mediapipe setup & run /// @@ -380,10 +403,6 @@ public class SignPredictor : MonoBehaviour yield return new WaitUntil(() => t.IsCompleted); model = t.Result; - - - - predictor_embed = new NatMLSignPredictorEmbed(model); asyncPredictor = predictor_embed.ToAsync(); // Creating a KeypointManager @@ -397,34 +416,6 @@ public class SignPredictor : MonoBehaviour StartCoroutine(MediapipeCoroutineEmbed()); } - /* - /// - /// Coroutine which executes the mediapipe pipeline - /// - /// - private IEnumerator MediapipeCoroutine() - { - while (true) - { - inputTexture.SetPixels32(webcamTexture.GetPixels32(pixelData)); - var imageFrame = new ImageFrame(ImageFormat.Types.Format.Srgba, width, height, width * 4, inputTexture.GetRawTextureData()); - var currentTimestamp = stopwatch.ElapsedTicks / (System.TimeSpan.TicksPerMillisecond / 1000); - graph.AddPacketToInputStream("input_video", new ImageFramePacket(imageFrame, new Timestamp(currentTimestamp))).AssertOk(); - yield return new WaitForEndOfFrame(); - - NormalizedLandmarkList _poseLandmarks = null; - NormalizedLandmarkList _leftHandLandmarks = null; - NormalizedLandmarkList _rightHandLandmarks = null; - - yield return new WaitUntil(() => { posestream.TryGetNext(out _poseLandmarks); return true; }); - yield return new WaitUntil(() => { leftstream.TryGetNext(out _leftHandLandmarks); return true; }); - yield return new WaitUntil(() => { rightstream.TryGetNext(out _rightHandLandmarks); return true; }); - - keypointManager.AddLandmarks(_poseLandmarks, _leftHandLandmarks, _rightHandLandmarks); - } - } - */ - /// /// Coroutine which executes the mediapipe pipeline /// @@ -451,7 +442,14 @@ public class SignPredictor : MonoBehaviour } } - + /// + /// This function calculates the Minkowski distance between two points in a p-dimensional space. + /// The Minkowski distance is a generalization of Euclidean and Manhattan distances, depending on the value of p. + /// + /// List of float values representing the coordinates of the first point. + /// Array of float values representing the coordinates of the second point. + /// Integer value representing the power parameter of the Minkowski distance. When p=2, it calculates Euclidean distance, and when p=1, it calculates Manhattan distance. + /// Returns the Minkowski distance between two points x and y in a p-dimensional space. private float MinkowskiDistance(List x, float[] y, int p) { int dimensions = x.Count; @@ -465,6 +463,13 @@ public class SignPredictor : MonoBehaviour return Mathf.Pow(sum, 1.0f / p); } + /// + /// This function calculates the Minkowski distances between a given embedding and a list of predefined embeddings. + /// The function returns a sorted list of distance and associated embedding data, sorted in ascending order of distance. + /// + /// A list of float values representing the embedding for which distances to all embeddings in the dataList need to be computed. + /// An optional integer parameter representing the power parameter of the Minkowski distance. Defaults to 2, implying Euclidean distance is calculated if not specified. + /// Returns a list of DistanceEmbedding objects, each representing the distance between the given embedding and an embedding from the dataList, along with the associated EmbeddingData. The list is sorted in ascending order of distance. private List GetDistances(List embedding, int p = 2) { List distances = new List(); @@ -492,59 +497,6 @@ public class SignPredictor : MonoBehaviour return distances; } - /* - /// - /// Coroutine which calls the sign predictor model - /// - /// - private IEnumerator SignRecognitionCoroutine() - { - while (true) - { - List> inputData = keypointManager.GetKeypoints(); - if (inputData != null && asyncPredictor.readyForPrediction) - { - // Getting the size of the input data - int framecount = inputData.Count; - int keypointsPerFrame = inputData[0].Count; - - // Creating ArrayFeature - int[] shape = { framecount, keypointsPerFrame }; - float[] input = new float[framecount * keypointsPerFrame]; - int i = 0; - inputData.ForEach((e) => e.ForEach((f) => input[i++] = f)); - MLArrayFeature feature = new MLArrayFeature(input, shape); - - // Predicting - Task> task = Task.Run(async () => await asyncPredictor.Predict(feature)); - yield return new WaitUntil(() => task.IsCompleted); - List result = task.Result; - if (0 < result.Count) - { - learnableProbabilities = new Dictionary(); - - for (int j = 0; j < result.Count; j++) - { - learnableProbabilities.Add(signs[j].ToUpper(), result[j]); - } - foreach (Listener listener in listeners) - { - yield return listener.ProcessIncomingCall(); - } - } - else - { - // Wait until next frame - yield return null; - } - } - - yield return null; - } - - } - */ - /// /// Coroutine which calls the sign predictor embedding model /// @@ -568,13 +520,10 @@ public class SignPredictor : MonoBehaviour int i = 0; inputData.ForEach((e) => e.ForEach((f) => f.ForEach((k) => input[i++] = k))); - MLArrayFeature feature = new MLArrayFeature(input, shape); // Predicting Task> task = Task.Run(async () => await asyncPredictor.Predict(feature)); - - yield return new WaitUntil(() => task.IsCompleted); List result = task.Result; @@ -604,17 +553,17 @@ public class SignPredictor : MonoBehaviour } } + //UnityEngine.Debug.Log(learnableProbabilities.Aggregate("", (t, d) => $"{t}{d}, ")); + foreach (Listener listener in listeners) { yield return listener.ProcessIncomingCall(); } } - } yield return null; } - } /// @@ -672,7 +621,10 @@ public class SignPredictor : MonoBehaviour } } - + /// + /// Let the class know which Model it should load for the chosen Game/Course + /// + /// public void SetModel(ModelIndex index) { this.modelList.SetCurrentModel(index); @@ -684,8 +636,6 @@ public class SignPredictor : MonoBehaviour public void SwapScreen(RawImage screen) { this.screen = screen; - //width = webcamTexture.width; - //height = webcamTexture.height; if (webcamTexture != null) { float webcamAspect = (float)webcamTexture.width / (float)webcamTexture.height; @@ -693,9 +643,4 @@ public class SignPredictor : MonoBehaviour this.screen.texture = webcamTexture; } } - - public void SetSignsList(List signs) - { - this.signs = signs; - } } diff --git a/Assets/Minigames/Scripts/AbstractMinigameController.cs b/Assets/Minigames/Scripts/AbstractMinigameController.cs index a1d3772..0367625 100644 --- a/Assets/Minigames/Scripts/AbstractMinigameController.cs +++ b/Assets/Minigames/Scripts/AbstractMinigameController.cs @@ -70,7 +70,6 @@ public abstract class AbstractMinigameController : AbstractFeedback // Prepare the signPredictor signPredictor.SetModel(signPredictorTheme.modelIndex); signPredictor.SwapScreen(webcamScreen); - signPredictor.SetSignsList(GetSignsList()); AddSelfAsListener(); } diff --git a/Assets/SpellingBee/Scenes/SpellingBeeGame.unity b/Assets/SpellingBee/Scenes/SpellingBeeGame.unity index f671cc7..dfe23c4 100644 --- a/Assets/SpellingBee/Scenes/SpellingBeeGame.unity +++ b/Assets/SpellingBee/Scenes/SpellingBeeGame.unity @@ -1334,7 +1334,7 @@ PrefabInstance: objectReference: {fileID: 0} - target: {fileID: 8299246693487308515, guid: 3bccdf365a4fbea4d8fa1aa461d3dc5c, type: 3} propertyPath: m_RootOrder - value: 8 + value: 9 objectReference: {fileID: 0} - target: {fileID: 8299246693487308515, guid: 3bccdf365a4fbea4d8fa1aa461d3dc5c, type: 3} propertyPath: m_AnchorMax.x @@ -1558,7 +1558,7 @@ RectTransform: - {fileID: 1913934361} - {fileID: 2112704851} m_Father: {fileID: 906197777} - m_RootOrder: 9 + m_RootOrder: 8 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 0} m_AnchorMax: {x: 1, y: 1} @@ -1976,8 +1976,8 @@ RectTransform: - {fileID: 1338727893} - {fileID: 1346005056} - {fileID: 967164044} - - {fileID: 667202413} - {fileID: 757133118} + - {fileID: 667202413} m_Father: {fileID: 1768150806} m_RootOrder: 0 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} diff --git a/Assets/SpellingBee/Tests/PlayMode/SpellingBeeControllerTests.cs b/Assets/SpellingBee/Tests/PlayMode/SpellingBeeControllerTests.cs index 1429eb8..7648ae3 100644 --- a/Assets/SpellingBee/Tests/PlayMode/SpellingBeeControllerTests.cs +++ b/Assets/SpellingBee/Tests/PlayMode/SpellingBeeControllerTests.cs @@ -1,6 +1,7 @@ using NUnit.Framework; using System.Collections; using System.IO; +using System.Linq; using UnityEditor; using UnityEngine; using UnityEngine.TestTools; @@ -17,7 +18,7 @@ public class SpellingBeeControllerTests public IEnumerator SetupFunction() { string path = $"{Application.persistentDataPath}/wesign_unit_test.json"; - string oneUser = $"{{\"version\":1027,\"users\":[{{\"entries\":[],\"username\":\"TEST\",\"avatarIndex\":0,\"playtime\":0.0,\"minigames\":[],\"courses\":[]}}],\"currentUser\":0,\"currentMinigame\":0,\"currentCourse\":0,\"currentTheme\":0}}"; + string oneUser = $"{{\"version\":1537,\"users\":[{{\"entries\":[],\"username\":\"TEST\",\"avatarIndex\":0,\"playtime\":0.0,\"minigames\":[],\"courses\":[]}}],\"currentUser\":0,\"currentMinigame\":0,\"currentCourse\":0,\"currentTheme\":0}}"; File.WriteAllText(path, oneUser); PersistentDataController.GetInstance().Load(); @@ -106,7 +107,7 @@ public class SpellingBeeControllerTests public IEnumerator CheckGoToNextWord() { SpellingBeeController spellingBeeController = GameObject.FindObjectOfType(); - string word = spellingBeeController.SkipToEnd(); + var letters = spellingBeeController.SkipToEnd().ToList().Where((c) => c != ' '); spellingBeeController.PredictSign(spellingBeeController.GetSign()); @@ -118,7 +119,7 @@ public class SpellingBeeControllerTests Assert.IsFalse(spellingBeeController.bonusTimeText.activeSelf); - for (int i = 1; i < word.Length; i++) + foreach (var _ in letters) { spellingBeeController.NextLetter(false); }