Skip to content

Commit

Permalink
Added sub namespaces
Browse files Browse the repository at this point in the history
  • Loading branch information
framacia committed Oct 10, 2024
1 parent 37b0861 commit 42dee50
Show file tree
Hide file tree
Showing 76 changed files with 313 additions and 354 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,12 @@
using TMPro;
using UnityEngine;
using UnityEngine.Events;
using ARML;
using ARML.Language;
using ARML.Voice;
using ARML.Interaction;
using ARML.DebugTools;
using ARML.SceneManagement;
using ARML.UI;

namespace DS
{
Expand Down Expand Up @@ -287,19 +292,19 @@ private IEnumerator PlayAudioCurrentDialogue()
//Check if current dialogue has audio for current language
switch (LanguageController.Instance.currentLanguage)
{
case Language.EN:
case Languages.EN:
if (dialogue.AudioClipEN == null)
yield break;
else
audioSource.clip = dialogue.AudioClipEN;
break;
case Language.ES:
case Languages.ES:
if (dialogue.AudioClipES == null)
yield break;
else
audioSource.clip = dialogue.AudioClipES;
break;
case Language.CA:
case Languages.CA:
if (dialogue.AudioClipCA == null)
yield break;
else
Expand Down Expand Up @@ -366,7 +371,7 @@ private void SetUpVoiceKeyPhrases()
{
switch (LanguageController.Instance.currentLanguage)
{
case Language.EN:
case Languages.EN:
//Create array of formatted choices parsing commas
List<string> parsedChoicesEN = choice.TextEN.Split('/').ToList();
foreach (string choiceValue in parsedChoicesEN)
Expand All @@ -375,15 +380,15 @@ private void SetUpVoiceKeyPhrases()
voskSTT.KeyPhrasesEN.Add(choiceValue);
}
break;
case Language.ES:
case Languages.ES:
List<string> parsedChoicesES = choice.TextES.Split('/').ToList();
foreach (string choiceValue in parsedChoicesES)
{
if (!string.IsNullOrEmpty(choiceValue))
voskSTT.KeyPhrasesES.Add(choiceValue);
}
break;
case Language.CA:
case Languages.CA:
voskSTT.KeyPhrasesES.Add(choice.TextCA);
break;
}
Expand All @@ -392,13 +397,13 @@ private void SetUpVoiceKeyPhrases()
//Set current Keyphrases based on language
switch (LanguageController.Instance.currentLanguage)
{
case Language.EN:
case Languages.EN:
voskSTT.KeyPhrases = voskSTT.KeyPhrasesEN;
break;
case Language.ES:
case Languages.ES:
voskSTT.KeyPhrases = voskSTT.KeyPhrasesES;
break;
case Language.CA:
case Languages.CA:
voskSTT.KeyPhrases = voskSTT.KeyPhrasesES;
break;
}
Expand All @@ -416,13 +421,13 @@ private void DisplayTextCurrentDialogue()
{
switch (LanguageController.Instance.currentLanguage)
{
case Language.EN:
case Languages.EN:
dialogueDisplayText.text = dialogue.TextEN;
break;
case Language.ES:
case Languages.ES:
dialogueDisplayText.text = dialogue.TextES;
break;
case Language.CA:
case Languages.CA:
dialogueDisplayText.text = dialogue.TextCA;
break;
}
Expand All @@ -436,13 +441,13 @@ private void DisplayTextCurrentDialogue()
choiceDisplayTexts[i].gameObject.SetActive(true);
switch (LanguageController.Instance.currentLanguage)
{
case Language.EN:
case Languages.EN:
choiceDisplayTexts[i].text = dialogue.Choices[i].TextEN;
break;
case Language.ES:
case Languages.ES:
choiceDisplayTexts[i].text = dialogue.Choices[i].TextES;
break;
case Language.CA:
case Languages.CA:
choiceDisplayTexts[i].text = dialogue.Choices[i].TextCA;
break;
}
Expand Down Expand Up @@ -562,13 +567,13 @@ public void CheckTranscriptionResult(string result, bool isDictation)
//Remove accents from choices!
switch (LanguageController.Instance.currentLanguage)
{
case Language.EN:
case Languages.EN:
formattedChoiceText = RemoveDiacritics(dialogue.Choices[i].TextEN);
break;
case Language.ES:
case Languages.ES:
formattedChoiceText = RemoveDiacritics(dialogue.Choices[i].TextES);
break;
case Language.CA:
case Languages.CA:
formattedChoiceText = RemoveDiacritics(dialogue.Choices[i].TextCA);
break;
}
Expand Down Expand Up @@ -644,15 +649,15 @@ private IEnumerator DisplayDefaultAnswer(int defaultAnswerIndex)
{
case 0:
//defaultAnswerClip = didNotHearClip;
defaultAnswerClip = (LanguageController.Instance.currentLanguage == Language.EN) ? didNotHearClipEN : didNotHearClipES;
defaultAnswerClip = (LanguageController.Instance.currentLanguage == Languages.EN) ? didNotHearClipEN : didNotHearClipES;
defaultAnswerText = "Perdona, no te he oído, ¿puedes volver a hablar?";
break;
case 1:
defaultAnswerClip = (LanguageController.Instance.currentLanguage == Language.EN) ? didNotUnderstandClipEN : didNotUnderstandClipES;
defaultAnswerClip = (LanguageController.Instance.currentLanguage == Languages.EN) ? didNotUnderstandClipEN : didNotUnderstandClipES;
defaultAnswerText = "Disculpa, no te he entendido, ¿puedes responder de nuevo?";
break;
default:
defaultAnswerClip = (LanguageController.Instance.currentLanguage == Language.EN) ? didNotUnderstandClipEN : didNotUnderstandClipES;
defaultAnswerClip = (LanguageController.Instance.currentLanguage == Languages.EN) ? didNotUnderstandClipEN : didNotUnderstandClipES;
defaultAnswerText = "Disculpa, no te he entendido, ¿puedes responder de nuevo?";
break;
}
Expand Down Expand Up @@ -694,7 +699,7 @@ private IEnumerator DisplayDefaultAnswer(int defaultAnswerIndex)
/// </summary>
/// <param name="audioClip">Audio to be played</param>
/// <param name="audioText">Text to be displayed</param>
public void PlayAudioOutsideOfSystem(Language language, AudioClip audioClip, string audioText = "")
public void PlayAudioOutsideOfSystem(Languages language, AudioClip audioClip, string audioText = "")
{
if (LanguageController.Instance.currentLanguage == language)
{
Expand All @@ -705,7 +710,7 @@ public void PlayAudioOutsideOfSystem(Language language, AudioClip audioClip, str
}
}

public void PlayAudioOutsideOfSystem(Language language, AudioClip audioClip, string audioText = "", bool chainedInteractionDialogue = false)
public void PlayAudioOutsideOfSystem(Languages language, AudioClip audioClip, string audioText = "", bool chainedInteractionDialogue = false)
{
if (LanguageController.Instance.currentLanguage == language)
{
Expand All @@ -716,7 +721,7 @@ public void PlayAudioOutsideOfSystem(Language language, AudioClip audioClip, str
}
}

public void PlayAudioOutsideOfSystem(Language language, AudioClip audioClip, string audioText = "", bool chainedInteractionDialogue = false, bool autoAdvanceCurrentLevel = false)
public void PlayAudioOutsideOfSystem(Languages language, AudioClip audioClip, string audioText = "", bool chainedInteractionDialogue = false, bool autoAdvanceCurrentLevel = false)
{
if (LanguageController.Instance.currentLanguage == language)
{
Expand All @@ -727,7 +732,7 @@ public void PlayAudioOutsideOfSystem(Language language, AudioClip audioClip, str
}
}

public void SetAudioForTalkingInteraction(Language language, AudioClip audioClip, string audioText = "", bool autoAdvanceCurrentLevel = false)
public void SetAudioForTalkingInteraction(Languages language, AudioClip audioClip, string audioText = "", bool autoAdvanceCurrentLevel = false)
{
if (LanguageController.Instance.currentLanguage == language)
{
Expand Down
32 changes: 23 additions & 9 deletions arml-unity/Assets/ARML/ARMLCore/Scenes/Logic.unity
Original file line number Diff line number Diff line change
Expand Up @@ -635,9 +635,6 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: 9bb442334999fb84487442a2b692a37f, type: 3}
m_Name:
m_EditorClassIdentifier:
q: {x: 0, y: 0, z: 0, w: 0}
manual: 0
offset: {x: 0, y: 0, z: 0}
--- !u!65 &548076146
BoxCollider:
m_ObjectHideFlags: 0
Expand Down Expand Up @@ -1495,6 +1492,11 @@ PrefabInstance:
propertyPath: m_Name
value: VIO
objectReference: {fileID: 0}
- target: {fileID: 3130052147172006343, guid: 924cf4db97b421f4daecbd835f0a5c9c,
type: 3}
propertyPath: m_IsActive
value: 0
objectReference: {fileID: 0}
m_RemovedComponents: []
m_RemovedGameObjects: []
m_AddedGameObjects: []
Expand Down Expand Up @@ -1656,9 +1658,6 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: 9bb442334999fb84487442a2b692a37f, type: 3}
m_Name:
m_EditorClassIdentifier:
q: {x: 0, y: 0, z: 0, w: 0}
manual: 0
offset: {x: 0, y: 0, z: 0}
--- !u!65 &1798480065
BoxCollider:
m_ObjectHideFlags: 0
Expand Down Expand Up @@ -2180,6 +2179,21 @@ PrefabInstance:
propertyPath: m_AnchoredPosition.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 6671237534119171511, guid: 79cecb298a5e3bf40a2048ff98890029,
type: 3}
propertyPath: m_OnClick.m_PersistentCalls.m_Calls.Array.data[0].m_Target
value:
objectReference: {fileID: 2464372682278860805}
- target: {fileID: 6671237534119171511, guid: 79cecb298a5e3bf40a2048ff98890029,
type: 3}
propertyPath: m_OnClick.m_PersistentCalls.m_Calls.Array.data[0].m_MethodName
value: LoadGame
objectReference: {fileID: 0}
- target: {fileID: 6671237534119171511, guid: 79cecb298a5e3bf40a2048ff98890029,
type: 3}
propertyPath: m_OnClick.m_PersistentCalls.m_Calls.Array.data[0].m_TargetAssemblyTypeName
value: ARML.SceneManagement.GameController, ARMLCore
objectReference: {fileID: 0}
- target: {fileID: 6680929189398986839, guid: 79cecb298a5e3bf40a2048ff98890029,
type: 3}
propertyPath: m_fontColor.b
Expand Down Expand Up @@ -2357,8 +2371,8 @@ MonoBehaviour:
m_Name:
m_EditorClassIdentifier:
gameSceneToLoad:
m_SceneAsset: {fileID: 0}
m_SceneName:
m_SceneAsset: {fileID: 102900000, guid: b890eeeb8dc612648b8316ef0cbc885d, type: 3}
m_SceneName: WallGame
loadOnStart: 0
loadLauncherSettings: 0
debugCanvasController: {fileID: 1521654317}
Expand Down Expand Up @@ -3108,7 +3122,7 @@ GameObject:
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
m_IsActive: 0
--- !u!4 &8444681710732414053
Transform:
m_ObjectHideFlags: 0
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using UnityEngine;

namespace ARML
namespace ARML.Animation
{
/// <summary>
/// Provides utility functions for manipulating Animator parameters.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using UnityEngine;

namespace ARML
namespace ARML.Arduino
{
/// <summary>
/// ScriptableObject representing an Arduino animation configuration.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,9 @@
using System.Threading;
using UnityEditor;
using UnityEngine;
using ARML.Voice;

namespace ARML
namespace ARML.Arduino
{
/// <summary>
/// The ArduinoController class is responsible for managing communication between Unity and an Arduino device.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using TMPro;
using UnityEngine;

namespace ARML
namespace ARML.Voice
{
/// <summary>
/// The MicInput class handles microphone input in Unity, providing functionality to capture the microphone's loudness
Expand Down
32 changes: 2 additions & 30 deletions arml-unity/Assets/ARML/ARMLCore/Scripts/Audio/STTMicController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
using ARML.UI;

namespace ARML
namespace ARML.Voice
{
/// <summary>
/// Controls the speech-to-text (STT) microphone functionality, managing voice command recognition and processing, as well as character conversation.
Expand Down Expand Up @@ -229,35 +230,6 @@ private void ProcessVoiceCommands(string result)
}

OnVoiceCommandAction?.Invoke(result);

//TODO - WORK IN PROGRESS

List<int> possibleMatchesIndexes = new List<int>();

//Loop through all choice texts to find matches
//for (int i = 0; i < dialogue.Choices.Count; i++)
//{
// //Remove accents!
// if (RemoveDiacritics(result).Contains(RemoveDiacritics(dialogue.Choices[i].Text), StringComparison.InvariantCultureIgnoreCase))
// {
// //Success! Add to match list
// possibleMatchesIndexes.Add(i);
// }
//}

////If more than one match, or none, ask again
//if (possibleMatchesIndexes.Count != 1 && !isDictation)
//{
// //Ask again, say the answer was not clear
// StartCoroutine(DisplayDefaultAnswer(1));
// sttMicController.ResetDictationMode();
// return;
//}
//else if (possibleMatchesIndexes.Count == 1) //If one match exactly, answer accepted, immediately even if dictation
//{
// GoToNextDialogue(possibleMatchesIndexes[0]);
// sttMicController.ForceRecordingOff();
//}
}

/// <summary>
Expand Down
2 changes: 1 addition & 1 deletion arml-unity/Assets/ARML/ARMLCore/Scripts/Debug/CSVExport.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
using System.IO;
using UnityEngine;

namespace ARML
namespace ARML.DebugTools
{
/// <summary>
/// CSVExport is responsible for recording and exporting data to CSV files.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
using AClockworkBerry;
using UnityEngine;
using UnityEngine.EventSystems;
using ARML.Interaction;

namespace ARML
namespace ARML.DebugTools
{
/// <summary>
/// Manages the visibility of debug elements on the canvas, allowing them to be toggled on and off.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using TMPro;
using UnityEngine;

namespace ARML
namespace ARML.DebugTools
{
/// <summary>
/// Displays the position or rotation vector of a target transform as text using TextMeshPro.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using TMPro;
using UnityEngine;

namespace ARML
namespace ARML.DebugTools
{
/// <summary>
/// Calculates and displays the distance between two objects, with an optional offset, using TextMeshPro.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
using System.IO;
using UnityEngine;

namespace ARML
namespace ARML.DebugTools
{
/// <summary>
/// Records and plays back position and rotation data for a GameObject.
Expand Down
2 changes: 1 addition & 1 deletion arml-unity/Assets/ARML/ARMLCore/Scripts/Debug/FOVSlider.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using TMPro;
using UnityEngine;

namespace ARML
namespace ARML.DebugTools
{
/// <summary>
/// Controls the field of view (FOV) of the main camera and updates the corresponding UI text element.
Expand Down
Loading

0 comments on commit 42dee50

Please sign in to comment.