//////////////////////////////////////////////////////////// public void UpdateText(NPC_Voiceline _voiceline) { npcName.text = npc.npcName; npcText.text = _voiceline.dialogue; choice1Text.text = _voiceline.choice1Text; choice2Text.text = _voiceline.choice2Text; previousVoiceLine = _voiceline; }
//////////////////////////////////////////////////////////// public void EnterDialogue(TavernPerson _npc, NPC_Voiceline _voiceline) { npc = _npc; Cursor.visible = true; Cursor.lockState = CursorLockMode.None; UpdateText(_voiceline); windowParent.SetActive(true); useTextObj.SetActive(false); inDialogue = true; }
//////////////////////////////////////////////////////////// public void TalkWithNPC(int choice) { if (previousVoiceLine != null) { if (previousVoiceLine.QuestID != "null" && choice == 1) { dataManager.AddQuest(previousVoiceLine.QuestID); } if (previousVoiceLine.Choice1ID == 0 && choice == 1) { previousVoiceLine = null; } else if (previousVoiceLine.Choice2ID == 0 && choice == 0) { previousVoiceLine = null; } } npc.TalkWith(previousVoiceLine, choice); }