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] <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);
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
}
|