Beispiel #1
0
 public void OnTriggerEnter2D(Collider2D cl)
 {
     if (cl.gameObject.tag == "Player")
     {
         sc.AddItem(the_item);
         Destroy(gameObject);
     }
 }
Beispiel #2
0
 public void Trade()
 {
     // Give item to player
     //sc.AddItem(itemTrades[0]);
     // Take gold from player
     //sc.DeleteItem(itemTrades[1]);
     foreach (InventoryItem iterator_item in itemNeeded)
     {
         sc.DeleteItem(iterator_item);
     }
     foreach (InventoryItem it in itemToGive)
     {
         sc.AddItem(it);
     }
 }