protected override void Apply(Transform other)
    {
        if (GameTime.Instance.GameSpeed <= 0)
        {
            return;
        }

        Transform target = (applyOnOther? other : TargetTransform);

        TimedHealth health = target.GetComponent <TimedHealth>();

        if (health == null)
        {
            ApplyDamageOnCollision collision = target.GetComponent <ApplyDamageOnCollision>();
            if (collision == null)
            {
                return;
            }
            health = collision.TargetTransform.GetComponent <TimedHealth>();
        }

        if (health != null)
        {
            health.SetHealthDelta(-damage);
        }
    }
Exemple #2
0
    protected override void Apply(Transform Transform)
    {
        TimedHealth health = Transform.GetComponent <TimedHealth>();

        health.SetHealthDelta(health.CurrentMaxHealth * percentageToFill);
    }