21 lines
501 B
C#
21 lines
501 B
C#
using UnityEngine;
|
|
|
|
public class DummyMonster : MonoBehaviour, IDamageable
|
|
{
|
|
[SerializeField] private float hp = 20f;
|
|
|
|
public void TakeDamage(float amount)
|
|
{
|
|
hp -= amount;
|
|
Debug.Log($"[DummyMonster] 맞음! -{amount}, 남은HP={hp}");
|
|
|
|
if (hp <= 0)
|
|
{
|
|
Debug.Log("[DummyMonster] 사망! +5 런XP");
|
|
if (ObsessionSystem.instance != null)
|
|
ObsessionSystem.instance.AddRunXP(5);
|
|
|
|
Destroy(gameObject);
|
|
}
|
|
}
|
|
} |