/// <summary> /// This is invokes the DialogueNode to perform its action. /// It decides whether to print a single message, give an item to /// inventory, or display a QandA message based on variables set by the constructor. /// </summary> public void Run(Interactable caller) { if (ItemQuantity == 0 && QandA == null) { UIManager.Instance.RunDialogue(caller, message); } else if (ItemQuantity > 0) { Interactable.AddItem(caller, ItemName, ItemQuantity); GameManager.Instance.SetReceived(caller.GetType().ToString()); } else { UIManager.Instance.RunDialogue(caller, QandA); } }