Exemplo n.º 1
0
 private void OnTriggerEnter(Collider other)
 {
     if (other.CompareTag("Cover"))
     {
         BeansCover = other.gameObject;
     }
     else
     {
         if (isServer)
         {
             PickUp pick = other.gameObject.GetComponent <PickUp>();
             if (pick)
             {
                 HP += pick.GetHeal();
                 if (HP > MaxHP)
                 {
                     HP = MaxHP;
                 }
                 Energy += pick.GetEnergy();
                 Invuln += pick.GetInvuln();
                 Quad   += pick.GetQuad();
                 Destroy(other.gameObject);
             }
         }
     }
 }