diff --git a/Assembly-CSharp-Editor.csproj b/Assembly-CSharp-Editor.csproj
index 97aa760..6ae8295 100644
--- a/Assembly-CSharp-Editor.csproj
+++ b/Assembly-CSharp-Editor.csproj
@@ -1370,14 +1370,14 @@
Library\ScriptAssemblies\Unity.2D.Tilemap.Editor.dll
False
-
- Library\ScriptAssemblies\Unity.InputSystem.ForUI.dll
- False
-
Library\ScriptAssemblies\Unity.Profiling.Core.dll
False
+
+ Library\ScriptAssemblies\Unity.InputSystem.ForUI.dll
+ False
+
Library\ScriptAssemblies\Unity.RenderPipelines.GPUDriven.Runtime.dll
False
diff --git a/Assembly-CSharp.csproj b/Assembly-CSharp.csproj
index a11ef8e..0db9a79 100644
--- a/Assembly-CSharp.csproj
+++ b/Assembly-CSharp.csproj
@@ -78,6 +78,7 @@
+
@@ -88,6 +89,7 @@
+
@@ -1416,14 +1418,14 @@
Library\ScriptAssemblies\Unity.2D.Tilemap.Editor.dll
False
-
- Library\ScriptAssemblies\Unity.InputSystem.ForUI.dll
- False
-
Library\ScriptAssemblies\Unity.Profiling.Core.dll
False
+
+ Library\ScriptAssemblies\Unity.InputSystem.ForUI.dll
+ False
+
Library\ScriptAssemblies\Unity.RenderPipelines.GPUDriven.Runtime.dll
False
diff --git a/Assets/Data/Templates/CreepTemplate.prefab b/Assets/Data/Templates/CreepTemplate.prefab
index 6b5f33d..e53304d 100644
--- a/Assets/Data/Templates/CreepTemplate.prefab
+++ b/Assets/Data/Templates/CreepTemplate.prefab
@@ -106,6 +106,8 @@ MonoBehaviour:
maxHealth: 100
damageEffectPrefab: {fileID: 4021103657954561961, guid: 5c755f9bc5253ea418e919994537dcc7, type: 3}
destroyEffectPrefab: {fileID: 141433446842962269, guid: 9fe8f8b3288e45a44af36ff8aa04486e, type: 3}
+ showHealthBar: 1
+ healthBarPrefab: {fileID: 100000, guid: 8e7a5b12c9f8a4a5ba3c8d1f2e5a7b9c, type: 3}
--- !u!195 &4485945348237935463
NavMeshAgent:
m_ObjectHideFlags: 0
diff --git a/Assets/Data/Templates/MonsterTemplate.prefab b/Assets/Data/Templates/MonsterTemplate.prefab
index 3d827c0..0b03d63 100644
--- a/Assets/Data/Templates/MonsterTemplate.prefab
+++ b/Assets/Data/Templates/MonsterTemplate.prefab
@@ -106,6 +106,8 @@ MonoBehaviour:
maxHealth: 100
damageEffectPrefab: {fileID: 4021103657954561961, guid: 5c755f9bc5253ea418e919994537dcc7, type: 3}
destroyEffectPrefab: {fileID: 141433446842962269, guid: 9fe8f8b3288e45a44af36ff8aa04486e, type: 3}
+ showHealthBar: 1
+ healthBarPrefab: {fileID: 100000, guid: 8e7a5b12c9f8a4a5ba3c8d1f2e5a7b9c, type: 3}
--- !u!195 &4485945348237935463
NavMeshAgent:
m_ObjectHideFlags: 0
diff --git a/Assets/Prefabs/Creep/Creep1.prefab b/Assets/Prefabs/Creep/Creep1.prefab
index d2e5ce7..c617959 100644
--- a/Assets/Prefabs/Creep/Creep1.prefab
+++ b/Assets/Prefabs/Creep/Creep1.prefab
@@ -983,6 +983,8 @@ MonoBehaviour:
maxHealth: 20
damageEffectPrefab: {fileID: 4021103657954561961, guid: 5c755f9bc5253ea418e919994537dcc7, type: 3}
destroyEffectPrefab: {fileID: 141433446842962269, guid: 9fe8f8b3288e45a44af36ff8aa04486e, type: 3}
+ showHealthBar: 1
+ healthBarPrefab: {fileID: 100000, guid: 8e7a5b12c9f8a4a5ba3c8d1f2e5a7b9c, type: 3}
--- !u!195 &2894690479083926678
NavMeshAgent:
m_ObjectHideFlags: 0
diff --git a/Assets/Prefabs/Monster/Monster101.prefab b/Assets/Prefabs/Monster/Monster101.prefab
index 9d977ee..7b9bb52 100644
--- a/Assets/Prefabs/Monster/Monster101.prefab
+++ b/Assets/Prefabs/Monster/Monster101.prefab
@@ -1317,6 +1317,8 @@ MonoBehaviour:
maxHealth: 75
damageEffectPrefab: {fileID: 4021103657954561961, guid: 5c755f9bc5253ea418e919994537dcc7, type: 3}
destroyEffectPrefab: {fileID: 141433446842962269, guid: 9fe8f8b3288e45a44af36ff8aa04486e, type: 3}
+ showHealthBar: 1
+ healthBarPrefab: {fileID: 100000, guid: 8e7a5b12c9f8a4a5ba3c8d1f2e5a7b9c, type: 3}
--- !u!195 &3634736894319727576
NavMeshAgent:
m_ObjectHideFlags: 0
diff --git a/Assets/Prefabs/Monster/Monster102.prefab b/Assets/Prefabs/Monster/Monster102.prefab
index dd9339e..6b525eb 100644
--- a/Assets/Prefabs/Monster/Monster102.prefab
+++ b/Assets/Prefabs/Monster/Monster102.prefab
@@ -1741,6 +1741,8 @@ MonoBehaviour:
maxHealth: 125
damageEffectPrefab: {fileID: 4021103657954561961, guid: 5c755f9bc5253ea418e919994537dcc7, type: 3}
destroyEffectPrefab: {fileID: 141433446842962269, guid: 9fe8f8b3288e45a44af36ff8aa04486e, type: 3}
+ showHealthBar: 1
+ healthBarPrefab: {fileID: 100000, guid: 8e7a5b12c9f8a4a5ba3c8d1f2e5a7b9c, type: 3}
--- !u!195 &2580823509700602203
NavMeshAgent:
m_ObjectHideFlags: 0
diff --git a/Assets/Prefabs/Monster/Monster103.prefab b/Assets/Prefabs/Monster/Monster103.prefab
index 2d6f4b1..78cd5ee 100644
--- a/Assets/Prefabs/Monster/Monster103.prefab
+++ b/Assets/Prefabs/Monster/Monster103.prefab
@@ -663,6 +663,8 @@ MonoBehaviour:
maxHealth: 65
damageEffectPrefab: {fileID: 4021103657954561961, guid: 5c755f9bc5253ea418e919994537dcc7, type: 3}
destroyEffectPrefab: {fileID: 141433446842962269, guid: 9fe8f8b3288e45a44af36ff8aa04486e, type: 3}
+ showHealthBar: 1
+ healthBarPrefab: {fileID: 100000, guid: 8e7a5b12c9f8a4a5ba3c8d1f2e5a7b9c, type: 3}
--- !u!195 &7475699343328683952
NavMeshAgent:
m_ObjectHideFlags: 0
diff --git a/Assets/Prefabs/Monster/Monster104.prefab b/Assets/Prefabs/Monster/Monster104.prefab
index ab25260..e530410 100644
--- a/Assets/Prefabs/Monster/Monster104.prefab
+++ b/Assets/Prefabs/Monster/Monster104.prefab
@@ -1096,6 +1096,8 @@ MonoBehaviour:
maxHealth: 45
damageEffectPrefab: {fileID: 4021103657954561961, guid: 5c755f9bc5253ea418e919994537dcc7, type: 3}
destroyEffectPrefab: {fileID: 141433446842962269, guid: 9fe8f8b3288e45a44af36ff8aa04486e, type: 3}
+ showHealthBar: 1
+ healthBarPrefab: {fileID: 100000, guid: 8e7a5b12c9f8a4a5ba3c8d1f2e5a7b9c, type: 3}
--- !u!195 &5366269420367463183
NavMeshAgent:
m_ObjectHideFlags: 0
diff --git a/Assets/Prefabs/Monster/Monster105.prefab b/Assets/Prefabs/Monster/Monster105.prefab
index 2e95c47..21c677f 100644
--- a/Assets/Prefabs/Monster/Monster105.prefab
+++ b/Assets/Prefabs/Monster/Monster105.prefab
@@ -1341,6 +1341,8 @@ MonoBehaviour:
maxHealth: 100
damageEffectPrefab: {fileID: 4021103657954561961, guid: 5c755f9bc5253ea418e919994537dcc7, type: 3}
destroyEffectPrefab: {fileID: 141433446842962269, guid: 9fe8f8b3288e45a44af36ff8aa04486e, type: 3}
+ showHealthBar: 1
+ healthBarPrefab: {fileID: 100000, guid: 8e7a5b12c9f8a4a5ba3c8d1f2e5a7b9c, type: 3}
--- !u!195 &1255224548206942124
NavMeshAgent:
m_ObjectHideFlags: 0
diff --git a/Assets/Prefabs/Player/Player.prefab b/Assets/Prefabs/Player/Player.prefab
index fd5198c..9623284 100644
--- a/Assets/Prefabs/Player/Player.prefab
+++ b/Assets/Prefabs/Player/Player.prefab
@@ -93,6 +93,8 @@ MonoBehaviour:
deathEffectPrefab: {fileID: 5642766282230003982, guid: b5c8ca7ed10b61e499cce8ec3b6e2e4c, type: 3}
resourcePickupPrefab: {fileID: 1627676033990080135, guid: 8c45964a69bf8fa4ba461ed217bc052f, type: 3}
respawnDelay: 10
+ showHealthBar: 1
+ healthBarPrefab: {fileID: 100000, guid: 8e7a5b12c9f8a4a5ba3c8d1f2e5a7b9c, type: 3}
--- !u!143 &3007098678582223509
CharacterController:
m_ObjectHideFlags: 0
diff --git a/Assets/Scenes/GameMain.unity b/Assets/Scenes/GameMain.unity
index ee95fdd..a86c41d 100644
--- a/Assets/Scenes/GameMain.unity
+++ b/Assets/Scenes/GameMain.unity
@@ -727,8 +727,8 @@ Transform:
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 519420028}
serializedVersion: 2
- m_LocalRotation: {x: 0.38268346, y: -0.00000022436977, z: 0.000000092937015, w: 0.92387956}
- m_LocalPosition: {x: -16.14601, y: 18.99998, z: 514.7231}
+ m_LocalRotation: {x: 0.60876137, y: 0, z: 0, w: 0.7933534}
+ m_LocalPosition: {x: -16.14601, y: 18.99998, z: 529.7231}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []
@@ -2100,13 +2100,13 @@ Transform:
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1290143989}
serializedVersion: 2
- m_LocalRotation: {x: 0.38268343, y: -0.00000022436976, z: 0.00000009293699, w: 0.92387956}
- m_LocalPosition: {x: -16.14601, y: 18.99998, z: 514.7231}
+ m_LocalRotation: {x: 0.60876137, y: 0, z: 0, w: 0.7933534}
+ m_LocalPosition: {x: -16.14601, y: 18.99998, z: 529.7231}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 61373299}
- m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
+ m_LocalEulerAnglesHint: {x: 75, y: 0, z: 0}
--- !u!114 &1290143992
MonoBehaviour:
m_ObjectHideFlags: 0
@@ -2125,7 +2125,7 @@ MonoBehaviour:
AngularDampingMode: 0
RotationDamping: {x: 1, y: 1, z: 1}
QuaternionDamping: 1
- FollowOffset: {x: 0, y: 18, z: -18}
+ FollowOffset: {x: 0, y: 18, z: -3}
--- !u!114 &1290143993
MonoBehaviour:
m_ObjectHideFlags: 0
diff --git a/Assets/Scripts/Building.cs b/Assets/Scripts/Building.cs
index 3efa480..eab42ac 100644
--- a/Assets/Scripts/Building.cs
+++ b/Assets/Scripts/Building.cs
@@ -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 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();
+ _healthBar = healthBarObj.GetComponent();
if (_healthBar != null)
{
diff --git a/Assets/Scripts/BuildingHealthBar.cs b/Assets/Scripts/BuildingHealthBar.cs
index 8a5ddd8..aac5efc 100644
--- a/Assets/Scripts/BuildingHealthBar.cs
+++ b/Assets/Scripts/BuildingHealthBar.cs
@@ -6,133 +6,11 @@ namespace Northbound
{
///
/// 건물 위에 표시되는 체력바
+ /// UnitHealthBar의 별칭 (하위 호환성 유지)
///
- public class BuildingHealthBar : MonoBehaviour
+ [System.Obsolete("Use UnitHealthBar instead. This class is kept for backward compatibility with existing prefabs.")]
+ public class BuildingHealthBar : UnitHealthBar
{
- [Header("UI References")]
- public Image fillImage;
- public TextMeshProUGUI healthText;
- public GameObject barContainer;
-
- [Header("Settings")]
- public float heightOffset = 3f;
- public bool hideWhenFull = true;
- public float hideDelay = 3f;
- public float initialShowDuration = 2f; // 건설 완료 시 체력바 표시 시간
-
- [Header("Colors")]
- public Color fullHealthColor = Color.green;
- public Color mediumHealthColor = Color.yellow;
- public Color lowHealthColor = Color.red;
- public float mediumHealthThreshold = 0.6f;
- public float lowHealthThreshold = 0.3f;
-
- private Building _building;
- private Camera _mainCamera;
- private float _lastShowTime;
- private Canvas _canvas;
- private bool _initialized = false;
-
- private void Awake()
- {
- // Canvas 설정
- _canvas = GetComponent