protected override void React(Collider other)
    {
        IDamageable target = other.GetComponent <IDamageable>();

        Assert.IsNotNull(target, $"{other.gameObject.name} doesn't implement IDamageable interface");

        dealDamageBehaviour.DealDamage(target);
    }
Example #2
0
    private void OnTriggerEnter(Collider other)
    {
        if (Utilities.ContainsLayer(triggerMask, other.gameObject.layer))
        {
            HealthBehaviour healthBehaviour = other.GetComponent <HealthBehaviour>();

            if (healthBehaviour != null)
            {
                dealDamageBehaviour.DealDamage(healthBehaviour);
            }
        }
    }