Exemplo n.º 1
0
 // When player is within the bounds of the item
 private void OnTriggerEnter(Collider other)
 {
     if (other.tag.Equals("Player"))
     {
         PlayerMovement movement = other.gameObject.GetComponent <PlayerMovement>();
         if (movement != null)
         {
             // Tell the PlayerMovement script that there is an item that can be picked up
             movement.AddItem(this);
             itemUI.SetActive(true);
         }
     }
 }