fix upgrades
This commit is contained in:
parent
d8c49317a3
commit
5dcbd3c313
17 changed files with 477 additions and 83 deletions
|
|
@ -9,6 +9,8 @@ public class Marisa : Entity
|
|||
public Vector2 mouseWorldPos;
|
||||
public Transform firingPointBase;
|
||||
public Transform firingPoint;
|
||||
[Header("UI")]
|
||||
[SerializeField] private Transform hpBarUI;
|
||||
private void Update()
|
||||
{
|
||||
mouseWorldPos = cam.ScreenToWorldPoint(Input.mousePosition);
|
||||
|
|
@ -20,4 +22,15 @@ public class Marisa : Entity
|
|||
moveDirection = new Vector2(Input.GetAxis("Horizontal"), Input.GetAxis("Vertical"));
|
||||
base.FixedUpdate();
|
||||
}
|
||||
|
||||
public override void TakeDamage(float damage)
|
||||
{
|
||||
base.TakeDamage(damage);
|
||||
UpdateHealthUI();
|
||||
}
|
||||
|
||||
private void UpdateHealthUI()
|
||||
{
|
||||
hpBarUI.localScale = new Vector3(Math.Clamp(health/maxHealth,0,maxHealth), 1,1);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue