public void Colide(Hostile target) { if (hitSound != null) { hitSound.Play(); } target.DealDamage(source, sourceDamage, strength); Kill(); }
private static void UpdateMineCollision(GameObject gameObject, GameObject colidedWith) { //mine and hostile Hostile hostile = colidedWith as Hostile; if (hostile != null) { Mine mine = gameObject as Mine; if (CollisionManager.GameObjectCollision(hostile, mine, false) && hostile != mine.source) { hostile.DealDamage(mine.source, false, mine.strength); mine.Kill(); } } }