Add simple audio system
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user