Projext/Assets/Scripts/Obsession/DummyMonster.cs

21 lines
501 B
C#
Raw Normal View History

2026-02-22 13:37:34 +00:00
using UnityEngine;
public class DummyMonster : MonoBehaviour, IDamageable
{
[SerializeField] private float hp = 20f;
public void TakeDamage(float amount)
{
hp -= amount;
Debug.Log($"[DummyMonster] <20><><EFBFBD><EFBFBD>! -{amount}, <20><><EFBFBD><EFBFBD>HP={hp}");
if (hp <= 0)
{
Debug.Log("[DummyMonster] <20><><EFBFBD><EFBFBD>! +5 <20><>XP");
if (ObsessionSystem.instance != null)
ObsessionSystem.instance.AddRunXP(5);
Destroy(gameObject);
}
}
}