Пример #1
0
 public void Colide(Hostile target)
 {
     if (hitSound != null)
     {
         hitSound.Play();
     }
     target.DealDamage(source, sourceDamage, strength);
     Kill();
 }
Пример #2
0
        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();
                }
            }
        }