Exemple #1
0
 private void OnCollisionExit(Collision other)
 {
     if (other.gameObject.name == "PNJ")
     {
         WalkerPNJ pnj = other.collider.GetComponent <WalkerPNJ> ();
         pnj.finishTalk();
     }
 }
Exemple #2
0
 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);
     }
 }