HandleMovement + Basic NavMesh

This commit is contained in:
Crizomb 2024-12-23 01:32:01 +01:00
parent d4a32d9593
commit 47a59a5440
18 changed files with 3104 additions and 52 deletions

View file

@ -1,10 +1,18 @@
using UnityEngine;
[RequireComponent(typeof(Unit))]
public class HealthHandler : MonoBehaviour
{
[SerializeField] private float maxHealth;
[SerializeField] private float currentHealth;
[SerializeField] private float armor;
private Unit _unit;
public void Awake()
{
_unit = GetComponent<Unit>();
}
public void TakeDamage(float damage)
{
@ -39,6 +47,14 @@ public class HealthHandler : MonoBehaviour
public void Death()
{
print("you dead");
if (_unit.IsTeamA)
{
GlobalsVariable.AliveUnitsTeamA.Remove(_unit);
}
else
{
GlobalsVariable.AliveUnitsTeamB.Remove(_unit);
}
}
}