Exemple #1
0
    /// <summary>
    /// When a bullet hit is detected, check whether the damagable is detecting the bullet type and act accordingly
    /// </summary>
    /// <param name="other"></param>
    private void BulletHitDetected(Collider other)
    {
        IBullet bullet = other.gameObject.GetComponent <IBullet>();

        if (bullet.BulletType == damagable.AffectedBulletType)
        {
            bullet.Explode();
            damagable.TakeDamage();
        }
    }