Пример #1
0
 private void OnTrigger(CollisionTag tag, Entity otherEntity)
 {
     if (tag == CollisionTag.Bullet)
     {
         _health.ChangeHealth(-1);
     }
 }
Пример #2
0
        private void OnTrigger(CollisionTag tag, Entity otherEntity)
        {
            if (tag == CollisionTag.Bullet)
            {
                var bullet = otherEntity.GetModule <BulletModule>(ModuleType.Bullet);
                if (bullet != null && bullet.Team != _team)
                {
                    _health.ChangeHealth(-1);
                }

                otherEntity.Destroy();
            }
        }