Ejemplo n.º 1
0
 void OnTriggerEnter(Collider other)
 {
     if (other.tag == "Player")
     {
         pickSfx.Play();
         foreach (SpriteRenderer renderer in transform.GetComponentsInChildren <SpriteRenderer>())
         {
             renderer.enabled = false;
         }
         inventory.AddToCargo(itemName);
         levelUi.UpdateLoot(itemName);
         Destroy(gameObject, pickSfx.clip.length);
     }
 }