public override void Interact() // Overwritable void running when player interacts with npc { // If statement responsible for running right dialogue from the list // Last dialogue on the list will run constantly after earlier dialogues were finished if (interactionCounter >= NPCDialogues.Count) { dialogueTalk.StartDialogue(NPCDialogues.Last()); // Running last dialogue if earlier dialogues were finished or theres only one } else { dialogueTalk.StartDialogue(NPCDialogues[interactionCounter]); // Running dialogue with index of interactionCounter interactionCounter++; // Adding up to interaction counter after running dialogue } }
// Update is called once per frame void Update() { if (Input.GetKeyDown(KeyCode.E)) { dialogueTalk.StartDialogue(); } }
public void Start() { dialogueTalk.StartDialogue(); }