diff --git a/3d-generation-pipeline/README.md b/3d-generation-pipeline/README.md index ce7279dc..590f68d5 100644 --- a/3d-generation-pipeline/README.md +++ b/3d-generation-pipeline/README.md @@ -1,6 +1,7 @@ ### TODO * teha build kus archery range'is spawnitud objektid * FMOD ChannelControl errorid +* glTF-StableFramerate, Parent-GeneratedModel eemaldada? * speech-to-text: * uurida miks buildis Whisper halvemini töötab * proovida suuremat Whisperi mudelit, äkki töötab mürases keskkonnas paremini diff --git a/Assets/_PROJECT/Fonts/Handlee-Regular SDF.asset b/Assets/_PROJECT/Fonts/Handlee-Regular SDF.asset index d31e2863..7d32ed85 100644 --- a/Assets/_PROJECT/Fonts/Handlee-Regular SDF.asset +++ b/Assets/_PROJECT/Fonts/Handlee-Regular SDF.asset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:62cd8b916dc91785e504a441f57a062cd24a0e6e1e072756533018f462288028 -size 2702041 +oid sha256:1d787e74678615ed7cb7baab5648f5d9189a2f315ed68c39bef46d5ff8722c37 +size 2719829 diff --git a/Assets/_PROJECT/Fonts/Quantico-Regular SDF.asset b/Assets/_PROJECT/Fonts/Quantico-Regular SDF.asset index 67c42292..c040079b 100644 --- a/Assets/_PROJECT/Fonts/Quantico-Regular SDF.asset +++ b/Assets/_PROJECT/Fonts/Quantico-Regular SDF.asset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:e7b93b54901e7d731e6e381bae63b627626f44e22fbead4f41ce56cedaf44603 -size 2120747 +oid sha256:c6da6e2a1bfa3436e631a0c7bd3afef35852fabae8e08e7e277af3f0e8e952dd +size 2131946 diff --git a/Assets/_PROJECT/Scenes/DeltaBuilding_base.unity b/Assets/_PROJECT/Scenes/DeltaBuilding_base.unity index f69f749a..a6c19ff1 100644 --- a/Assets/_PROJECT/Scenes/DeltaBuilding_base.unity +++ b/Assets/_PROJECT/Scenes/DeltaBuilding_base.unity @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:5b5911b77edd83d6937e890b9b8b3c8c548646c0930acf1030c1850beb7a477a -size 68721711 +oid sha256:e2dc87cbfcdd665c84a3eb9d040430c5fea2b67627accacbe9ae92bbf44f952c +size 68721707 diff --git a/Assets/_PROJECT/Scripts/ModeGeneration/ShapeDetection/ShapeScanner.cs b/Assets/_PROJECT/Scripts/ModeGeneration/ShapeDetection/ShapeScanner.cs index d809b4a4..7575c04b 100644 --- a/Assets/_PROJECT/Scripts/ModeGeneration/ShapeDetection/ShapeScanner.cs +++ b/Assets/_PROJECT/Scripts/ModeGeneration/ShapeDetection/ShapeScanner.cs @@ -1,7 +1,7 @@ using System; using System.Collections.Generic; -using System.Data; using System.Linq; +using System.Threading.Tasks; using TMPro; using UnityEngine; using UnityEngine.XR.Interaction.Toolkit; @@ -99,13 +99,7 @@ public class ShapeScanner : MonoBehaviour private void InitializeConfiguration(ShapeScannerConfiguration configuration) { - // Recreate all existing rays - foreach (ShapeScannerRay ray in existingRays) - { - Destroy(ray.gameObject); - } - existingRays.Clear(); - + // Create rays int rayRowCount = configuration.rows.Count; for (int i = 0; i < rayRowCount; i++) { @@ -133,13 +127,14 @@ public class ShapeScanner : MonoBehaviour totalRayCount = configuration.rows.SelectMany(row => row.cells).Count(); correctRayCount = configuration.rows.SelectMany(row => row.cells).Count(cell => !cell); - float percentage = calculateCorrectPercentage(); + float percentage = CalculateCorrectPercentage(); UpdateDisplay(percentage); } private void OnConfigurationComplete() { - HashSet allCollidingObjects = new HashSet(); + // Destroy colliding scannable objects + HashSet allCollidingObjects = new(); foreach (ShapeScannerRay ray in existingRays) { allCollidingObjects.UnionWith(ray.GetCollidingObjects()); @@ -161,20 +156,28 @@ public class ShapeScanner : MonoBehaviour Destroy(collidingObject); } + // Destroy all existing rays + foreach (ShapeScannerRay ray in existingRays) + { + Destroy(ray.gameObject); + } + existingRays.Clear(); + + // Play sound effect and emit particles AudioManager.Instance.PlayAttachedInstance(FMODEvents.Instance.ShapeScannerSuccess, gameObject); if (!particles.isPlaying) particles.Play(); particles.Emit(100); } - private float calculateCorrectPercentage() + private float CalculateCorrectPercentage() { return (float) correctRayCount / totalRayCount * 100; } - public void IncrementCorrectRayCount() + public async void IncrementCorrectRayCount() { correctRayCount++; - float correctPercentage = calculateCorrectPercentage(); + float correctPercentage = CalculateCorrectPercentage(); UpdateDisplay(correctPercentage); if (isCompleted) { @@ -183,6 +186,8 @@ public class ShapeScanner : MonoBehaviour if (correctPercentage >= configurations[currentConfiguration].requiredCorrectPercentage) { OnConfigurationComplete(); + await Task.Delay(1000); + UpdateCurrentConfigurationDisplay(currentConfiguration + 1); if (currentConfiguration + 1 < configurations.Count) { @@ -202,12 +207,11 @@ public class ShapeScanner : MonoBehaviour public void DecrementCorrectRayCount() { correctRayCount--; - UpdateDisplay(calculateCorrectPercentage()); + UpdateDisplay(CalculateCorrectPercentage()); } private void UpdateDisplay(float percentage) { - Debug.Log("updating display to: " + percentage); correctPercentageDisplay.text = Mathf.Round(percentage).ToString() + " %"; } diff --git a/highscores.json b/highscores.json index 5802764c..9ff09121 100644 --- a/highscores.json +++ b/highscores.json @@ -4,6 +4,10 @@ "name": "Perfoon", "score": 416.0 }, + { + "name": "jjkujkkg", + "score": 194.0 + }, { "name": "h", "score": 138.0 @@ -11,6 +15,18 @@ { "name": "raimps", "score": 115.0 + }, + { + "name": "k", + "score": 58.0 + }, + { + "name": "kr", + "score": 53.0 + }, + { + "name": "krr", + "score": 34.0 } ] } \ No newline at end of file