Add player sprite and simple animation system
This commit is contained in:
@@ -19,6 +19,9 @@ public class SpeechManager : Singleton<SpeechManager>
|
||||
|
||||
[CanBeNull] private string fulltext;
|
||||
private Coroutine ccoroutine;
|
||||
|
||||
|
||||
public string Status = "TALKING";
|
||||
|
||||
void Start()
|
||||
{
|
||||
@@ -50,6 +53,7 @@ public class SpeechManager : Singleton<SpeechManager>
|
||||
|
||||
public void StartText(KeyValuePair<string,string>[] buffer)
|
||||
{
|
||||
Status = "TALKING";
|
||||
gameObject.SetActive(true);
|
||||
foreach (var kvp in buffer)
|
||||
{
|
||||
@@ -109,6 +113,10 @@ public class SpeechManager : Singleton<SpeechManager>
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Status = fulltext.Length > 30 ? "DONELONG" : "DONE";
|
||||
|
||||
fulltext = null;
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
using UnityEngine;
|
||||
|
||||
public class SpeechVisualController : MonoBehaviour
|
||||
{
|
||||
private int status = 0;
|
||||
private Animator animator;
|
||||
|
||||
|
||||
void Start()
|
||||
{
|
||||
animator = GetComponent<Animator>();
|
||||
}
|
||||
|
||||
void Update()
|
||||
{
|
||||
if (SpeechManager.Instance.Status != "TALKING")
|
||||
{
|
||||
animator.SetInteger("SetTalkEnd", SpeechManager.Instance.Status == "DONELONG"?1:2);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 971accf797eb4079d985759eb11177e0
|
||||
Reference in New Issue
Block a user