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(); } }
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(); } } }
public override void ContactBehaviour(Vector3 posOfContact, IProjectile projectile) { projectile.Die(); }