IEnumerator TypeTheSentence(string sentence) { displayText.text = ""; myAudio.Play(); foreach (char letter in sentence.ToCharArray()) { ObjectInteraction.ShowDialog(true); displayText.text += letter; yield return(new WaitForSeconds(typingSpeed)); } ShowOptions(); }
void OnTriggerEnter(Collider other) { if (!chatting && other.CompareTag("Player")) { chatting = true; player = other.gameObject; ObjectInteraction.ShowIcon(true); ObjectInteraction.ShowDialog(true); npcName.text = npc.name; string url = "Sprites/" + npc.icon; npcImage.sprite = Resources.Load <Sprite>(url); StartDialogue(); } }
private void ClosePanel() { ObjectInteraction.ShowDialog(false); optionsPanel.SetActive(false); }