using UnityEngine;
using UnityEngine.UI;
using TMPro;
namespace Northbound
{
///
/// 건물 위에 표시되는 체력바
///
public class BuildingHealthBar : MonoBehaviour
{
[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