Ejemplo n.º 1
0
 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
     }
 }
Ejemplo n.º 2
0
 // Update is called once per frame
 void Update()
 {
     if (Input.GetKeyDown(KeyCode.E))
     {
         dialogueTalk.StartDialogue();
     }
 }
Ejemplo n.º 3
0
 public void Start()
 {
     dialogueTalk.StartDialogue();
 }