projectEli/Assets/NeoFPS/Core/Damage/HealZone.cs

20 lines
608 B
C#
Raw Normal View History

2022-11-07 01:28:33 +00:00
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);
}
}
}