Exemple #1
0
 public override void ContactBehaviour(Vector3 posOfContact, IProjectile projectile)
 {
     collisionsHad++;
     if (collisionsHad >= numberOfCollisions)
     {
         projectile.Die();
     }
 }
    public void OnCollisionEnter(Collision collision)
    {
        //If hit by a projectile
        IProjectile projectile = collision.gameObject.GetComponent <IProjectile>();

        if (projectile != null)
        {
            curHP -= projectile.GetDamage();
            projectile.Die();
        }
    }
Exemple #3
0
 public ProjectileProjectileCollisionResponse(IProjectile p1, IProjectile p2, CollisionSide type)
 {
     if (p1 is FireballProjectile && p2 is ShellProjectile)
     {
         if (type != CollisionSide.None)
         {
             p2.Die();
         }
     }
     if (p2 is FireballProjectile && p1 is ShellProjectile)
     {
         if (type != CollisionSide.None)
         {
             p1.Die();
         }
     }
 }
Exemple #4
0
 public override void ContactBehaviour(Vector3 posOfContact, IProjectile projectile)
 {
     projectile.Die();
 }