Attack까지 완성..?
This commit is contained in:
23
Assets/Scripts/LivingEntity.cs
Normal file
23
Assets/Scripts/LivingEntity.cs
Normal file
@@ -0,0 +1,23 @@
|
||||
using UnityEngine;
|
||||
|
||||
public partial class LivingEntity : MonoBehaviour
|
||||
{
|
||||
public float health = 20.0f;
|
||||
|
||||
public void Damage(float damage, Collider2D cause)
|
||||
{
|
||||
health -= damage;
|
||||
OnDamaged(damage, cause);
|
||||
if (health <= 0.0f) OnDeath();
|
||||
}
|
||||
|
||||
private void OnDamaged(float damage, Collider2D cause)
|
||||
{
|
||||
throw new System.NotImplementedException();
|
||||
}
|
||||
|
||||
private void OnDeath()
|
||||
{
|
||||
throw new System.NotImplementedException();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user