public void AddDialogue2(string _speaker, string _text) { GameObject obj = Instantiate(dialogue2_prefab, transform); Dialogue2 dialogue2 = obj.GetComponent <Dialogue2>(); dialogue2.Init(this); dialogue2.SetSpeaker(_speaker); dialogue2.SetText(_text); obj.SetActive(false); object_pool.Enqueue(obj); }
public void StartDialogue(Dialogue2 dialogue) { // animator.SetBool("IsOpen", true); nameText.text = dialogue.name; sentences.Clear(); foreach (string sentence in dialogue.sentences) { sentences.Enqueue(sentence); } DisplayNextSentence(); }