private void OnCollisionExit(Collision other) { if (other.gameObject.name == "PNJ") { WalkerPNJ pnj = other.collider.GetComponent <WalkerPNJ> (); pnj.finishTalk(); } }
private void OnCollisionEnter(Collision other) { if (other.gameObject.name == "PNJ") { WalkerPNJ pnj = other.collider.GetComponent <WalkerPNJ> (); pnj.talkTo(); } if (other.gameObject.tag == "Item") { Item otherItem = other.collider.GetComponent <Item> (); addItem(otherItem); Destroy(other.gameObject); } }