Exemplo n.º 1
0
 private void OnTriggerEnter(Collider other)
 {
     if (other.gameObject.tag == "HP")
     {
         if (playerHealth < MAX_HP)
         {
             IncreaseHealth();
             Destroy(other.gameObject);
         }
     }
     else
     {
         if (other.gameObject.tag == "Ammo")
         {
             ammoManager.IncreaseAmmo(other.gameObject, ammoGain, grenadeGain);
         }
         else
         {
             if (other.gameObject.tag == "Energy")
             {
                 if (totalPlayerEnergy < MAX_ENERGY)
                 {
                     IncreaseEnergy();
                     Destroy(other.gameObject);
                 }
             }
         }
     }
 }
Exemplo n.º 2
0
 private void OnTriggerEnter(Collider other)
 {
     if (other.GetComponent <PlayerController>() != null)
     {
         Debug.Log("Picked up Ammo");
         ammoManager.IncreaseAmmo(pointsToAdd);
         Destroy(gameObject);
     }
 }