Ejemplo n.º 1
0
 void OnTriggerEnter(Collider other)
 {
     Debug.Log(gameObject + " Collide with " + other.name);
     if(other.CompareTag("Player")){
         bulletstats = GetComponent<BulletStats>();
         shipstats = other.collider.GetComponent<PlayerShipStats>();
         shipstats.decreaseHealth(bulletstats.getDamage() * (1 - (shipstats.getArmor() - bulletstats.getArmorPen())));
         Destroy(gameObject);
     }
 }