using System; using UnityEngine; public class HealthItem : MonoBehaviour, IItem { public int healAmount = 1; // Amount of health this item restores public static event Action OnHealthItemCollected; public void Collect() { OnHealthItemCollected.Invoke(healAmount); SoundEffectManager.Play("Gem"); Destroy(gameObject); } }