Add simple audio system

This commit is contained in:
WillJeynes
2026-08-25 17:22:12 +01:00
parent 4c3f94dba1
commit c92d5a633a
20 changed files with 346 additions and 23 deletions
+6 -1
View File
@@ -20,6 +20,8 @@ public class SpeechManager : Singleton<SpeechManager>
[CanBeNull] private string fulltext;
private Coroutine ccoroutine;
private string speaker;
public string Status = "TALKING";
@@ -67,10 +69,11 @@ public class SpeechManager : Singleton<SpeechManager>
private void NextText()
{
AudioManager.Instance.PlaySound("Select");
var item = textBuffer.Dequeue();
ccoroutine = StartCoroutine(TypeTextUncapped(item.Key));
var speaker = item.Value;
speaker = item.Value;
if (speaker == "PLAYER")
{
@@ -98,11 +101,13 @@ public class SpeechManager : Singleton<SpeechManager>
string textBuffer = null;
char[] chars = line.ToCharArray();
int i = 0;
while (i < chars.Length)
{
if (timer < Time.deltaTime)
{
AudioManager.Instance.PlaySpeechSound(speaker != "PLAYER");
textBuffer += chars[i];
mainText.text = textBuffer;
timer += interval;