Esempio n. 1
0
    public override void DealDamage(HealthHandler healthHandler, InteractionType interactionType)
    {
        switch (interactionType)
        {
        case InteractionType.INTERACTION_TRIGGER_STAY:
            if (!m_PreviousInteractors.Contains(healthHandler))
            {
                m_PreviousInteractors.Add(healthHandler);
                healthHandler.Damage(m_DamageAmount);
                PlayDamageSound?.Invoke();
            }
            break;

        default:
            break;
        }
    }
Esempio n. 2
0
    public override void DealDamage(HealthHandler healthHandler, InteractionType interactionType)
    {
        switch (interactionType)
        {
        case InteractionType.INTERACTION_TRIGGER_STAY:
            if (Time.time >= m_TimeLastDamaged + m_DamageInterval)
            {
                healthHandler.Damage(m_DamageAmount);
                m_TimeLastDamaged = Time.time;
                PlayDamageSound?.Invoke();
            }
            break;

        default:
            break;
        }
    }