체력바 추가
플레이어는 상시 표시, 나머지는 체력 변경 시 표시
This commit is contained in:
@@ -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)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user