24 lines
490 B
C#
24 lines
490 B
C#
|
|
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();
|
||
|
|
}
|
||
|
|
}
|