public void Talkwith() { if (scanObj == null) { return; } //else if (scanObj.layer == LayerMask.NameToLayer("Npc")) // { // dialog.Action(scanObj); // } else if (scanObj.tag == "npc" || scanObj.tag == "Item") { dialog.Action(scanObj); if (scanObj.tag == "Item") { inventory.GetComponent <InventoryController>().AddItem(scanObj.GetComponent <Item>()); } } return; }