Projext/Assets/5.TestScript/HealthPotion.cs
hydrozen1178 6e02e36997 기능 수정 본
회복 기능,적 아이템 드랍,등등
2026-01-30 01:11:10 +09:00

18 lines
479 B
C#

using UnityEngine;
public class HealthPotion : MonoBehaviour
{
[Header("--- 포션 설정 ---")]
[SerializeField] private float healAmount = 30f; // 회복량
// PlayerInteraction에서 호출할 함수
public void Use(PlayerHealth target)
{
if (target == null) return;
target.Heal(healAmount); // 플레이어 체력 회복
Debug.Log($"<color=green>[Potion]</color> 체력 {healAmount} 회복!");
Destroy(gameObject); // 사용 후 아이템 삭제
}
}