16 lines
430 B
C#
16 lines
430 B
C#
using UnityEngine;
|
|
|
|
namespace Code.Gameplay.Character.Stats
|
|
{
|
|
public class HealthBuff : MonoBehaviour
|
|
{
|
|
[SerializeField] private int healthBuff = 50;
|
|
private void OnTriggerEnter(Collider other)
|
|
{
|
|
if (!other.CompareTag("Player")) return;
|
|
var health = other.GetComponent<HealthSystem>();
|
|
health?.Heal(healthBuff);
|
|
Destroy(gameObject);
|
|
}
|
|
}
|
|
} |