projectEli/Assets/NeoFPS/Core/Damage/HealZone.cs
2022-11-06 20:28:33 -05:00

20 lines
608 B
C#

using UnityEngine;
namespace NeoFPS
{
[HelpURL("https://docs.neofps.com/manual/healthref-mb-healzone.html")]
public class HealZone : CharacterTriggerZonePersistant
{
[SerializeField, Tooltip("The amount of health to apply to the player character per second")]
private float m_HealthPerSecond = 10f;
protected override void OnCharacterStay(ICharacter c)
{
var hm = c.GetComponent<IHealthManager>();
if (hm != null)
hm.AddHealth(m_HealthPerSecond * Time.deltaTime);
base.OnCharacterStay(c);
}
}
}