diff --git a/3d-generation-pipeline/README.md b/3d-generation-pipeline/README.md index b3446b1c..756ecc74 100644 --- a/3d-generation-pipeline/README.md +++ b/3d-generation-pipeline/README.md @@ -5,7 +5,6 @@ * uurida miks buildis Whisper halvemini töötab * proovida suuremat Whisperi mudelit, äkki töötab mürases keskkonnas paremini * npc character: - * suu animatsioon jääb seisma, kui uus voiceline algab kui eelmine veel mängib * klaas on näha temast eespool * shape detection: * peab mängijale kuidagi selgitama, kuidas scale'ida prinditud objekte diff --git a/Assets/_PROJECT/Fonts/Handlee-Regular SDF.asset b/Assets/_PROJECT/Fonts/Handlee-Regular SDF.asset index 95596594..00d5150a 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:735ad5cb8de6d486c03aa01470806010637625d76fa25d52caa3bebfccf32ed1 -size 2754250 +oid sha256:18d1fab76a91c4e77208c800c47246dee2cc7f6eeba42b7462c66193acac1615 +size 2765693 diff --git a/Assets/_PROJECT/Scripts/ModeGeneration/NPCs/NPCController.cs b/Assets/_PROJECT/Scripts/ModeGeneration/NPCs/NPCController.cs index 3e7b3647..722ac634 100644 --- a/Assets/_PROJECT/Scripts/ModeGeneration/NPCs/NPCController.cs +++ b/Assets/_PROJECT/Scripts/ModeGeneration/NPCs/NPCController.cs @@ -26,25 +26,13 @@ public abstract class NPCController : MonoBehaviour private float[] rmsCurve; private EventInstance currentVoicelineEvent; - private bool isSpeaking; private float smoothed; // If you change RMS window in Python, update this private const float FRAME_DURATION = 0.02f; - private float sampleRate = 1f / FRAME_DURATION; // RMS samples per second (20ms windows) + private readonly float sampleRate = 1f / FRAME_DURATION; // RMS samples per second (20ms windows) - // Start is called before the first frame update - void Awake() - { - - } - - void Start() - { - - } - // Update is called once per frame void Update() { @@ -65,7 +53,7 @@ public abstract class NPCController : MonoBehaviour } } - if (isSpeaking && rmsCurve != null && currentVoicelineEvent.isValid()) + if (rmsCurve != null && currentVoicelineEvent.isValid()) { AnimateMouth(); } @@ -105,22 +93,6 @@ public abstract class NPCController : MonoBehaviour mouth.localScale = s; } - - private void StopSpeaking() - { - isSpeaking = false; - smoothed = inverted ? maxScaleY : minScaleY; - - if (mouth != null) - { - var scale = mouth.localScale; - scale.y = smoothed; - mouth.localScale = scale; - } - - currentVoicelineEvent.release(); - } - public void PlayerApproach() { OnPlayerApproach(); @@ -168,21 +140,15 @@ public abstract class NPCController : MonoBehaviour LoadCurve(key); // load RMS data - emitter = emitter ?? gameObject; + emitter = emitter != null ? emitter : gameObject; currentVoicelineEvent = AudioManager.Instance.PlayDialogue(characterSpecificFolder + "/" + key, emitter, radioAmount); if (!currentVoicelineEvent.isValid()) { Debug.LogError("Failed to start dialogue event."); return; } - isSpeaking = true; - - // Stop mouth on end - float voicelineDuration = rmsCurve.Length * FRAME_DURATION; - Invoke(nameof(StopSpeaking), voicelineDuration + 0.1f); } - // --------------------------- // Load RMS Timeline (.txt) // ---------------------------