fix upgrades
This commit is contained in:
parent
d8c49317a3
commit
5dcbd3c313
17 changed files with 477 additions and 83 deletions
|
|
@ -1,3 +1,4 @@
|
|||
using System;
|
||||
using UnityEngine;
|
||||
|
||||
public class Entity : MonoBehaviour
|
||||
|
|
@ -11,6 +12,7 @@ public class Entity : MonoBehaviour
|
|||
[Header("Stats")]
|
||||
public float health;
|
||||
public float maxHealth;
|
||||
|
||||
[Header("Movement")]
|
||||
[SerializeField] private bool isFacingRight;
|
||||
[SerializeField] protected Rigidbody2D rb;
|
||||
|
|
@ -37,7 +39,7 @@ public class Entity : MonoBehaviour
|
|||
rb.linearVelocity = moveDirection * speed;
|
||||
}
|
||||
}
|
||||
public void TakeDamage(float damage)
|
||||
public virtual void TakeDamage(float damage)
|
||||
{
|
||||
health -= damage;
|
||||
if (health < 0)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue