체력바 추가

플레이어는 상시 표시, 나머지는 체력 변경 시 표시
This commit is contained in:
2026-02-25 15:15:29 +09:00
parent f3923079a4
commit 17b3cf6746
22 changed files with 369 additions and 147 deletions

View File

@@ -5,7 +5,7 @@ using Northbound.Data;
namespace Northbound
{
public class Building : NetworkBehaviour, IDamageable, IVisionProvider, ITeamMember
public class Building : NetworkBehaviour, IDamageable, IVisionProvider, ITeamMember, IHealthProvider
{
[Header("References")]
public TowerData buildingData;
@@ -63,7 +63,7 @@ namespace Northbound
public event Action OnDestroyed;
public event Action<TeamType> OnTeamChanged;
private BuildingHealthBar _healthBar;
private UnitHealthBar _healthBar;
private float _lastRegenTime;
public override void OnNetworkSpawn()
@@ -390,7 +390,7 @@ namespace Northbound
}
GameObject healthBarObj = Instantiate(healthBarPrefab, transform);
_healthBar = healthBarObj.GetComponent<BuildingHealthBar>();
_healthBar = healthBarObj.GetComponent<UnitHealthBar>();
if (_healthBar != null)
{