Beispiel #1
0
 private void OnTriggerEnter(Collider other)
 {
     if (item != null)
     {
         GameController.Instance.inventory.Add(item);
         item = null;
         Debug.Log("collision!");
     }
 }
Beispiel #2
0
 void SetItem(RPGItems.Item _item)
 {
     item = _item;
     if (item == null)
     {
         draggable.gameObject.SetActive(false);
     }
     else
     {
         draggable.gameObject.SetActive(true);
         inventoryText.text = item.Name;
         if (itemImage != null)
         {
             itemImage.sprite         = item.Sprite;
             itemImage.preserveAspect = true;
         }
     }
 }
Beispiel #3
0
 // Use this for initialization
 void Start()
 {
     item = Instantiate(item);
 }