Clean up project, create Singleton

This commit is contained in:
2022-08-15 12:32:42 -07:00
parent 06d346f89b
commit b67ab71e2b
83 changed files with 61 additions and 3597 deletions

View File

@@ -9,9 +9,7 @@ namespace Scampz.GameJam
public class DialogueManager : MonoBehaviour
{
[SerializeField]
private TextMeshProUGUI nameText;
[SerializeField]
private TextMeshProUGUI dialogueText;
private TextMeshProUGUI dialogueTextGUI;
public float TextSpeed = 0.1f;
public static DialogueManager Instance { get; private set; }
@@ -31,8 +29,6 @@ namespace Scampz.GameJam
public void StartDialogue(Dialogue dialogue)
{
nameText.text = dialogue.name;
sentences.Clear();
foreach (var sentence in dialogue.sentences)
sentences.Enqueue(sentence);
@@ -53,10 +49,10 @@ namespace Scampz.GameJam
private IEnumerator TypeSentence(string sentence)
{
dialogueText.text = string.Empty;
dialogueTextGUI.text = string.Empty;
foreach (var letter in sentence.ToCharArray())
{
dialogueText.text += letter;
dialogueTextGUI.text += letter;
yield return null;
yield return new WaitForSecondsRealtime(TextSpeed);
}