임시 건설 UI 생성
기타 불필요 디버깅 로그 제거
This commit is contained in:
@@ -16,8 +16,12 @@ namespace Northbound
|
||||
|
||||
[Header("UI References")]
|
||||
[SerializeField] private GameObject quickslotPanel;
|
||||
[SerializeField] private GameObject descriptionPanel;
|
||||
[SerializeField] private Transform slotContainer;
|
||||
[SerializeField] private GameObject slotButtonPrefab;
|
||||
[SerializeField] private TextMeshProUGUI buildingNameText;
|
||||
[SerializeField] private TextMeshProUGUI buildingDescriptionText;
|
||||
[SerializeField] private TextMeshProUGUI buildingCostText;
|
||||
|
||||
[Header("Settings")]
|
||||
[SerializeField] private int maxSlots = 8;
|
||||
@@ -65,30 +69,15 @@ namespace Northbound
|
||||
quickslotPanel.SetActive(false);
|
||||
}
|
||||
|
||||
if (descriptionPanel != null)
|
||||
{
|
||||
descriptionPanel.SetActive(false);
|
||||
}
|
||||
|
||||
InitializeSlots();
|
||||
}
|
||||
|
||||
private void Update()
|
||||
{
|
||||
if (quickslotPanel != null && quickslotPanel.activeSelf)
|
||||
{
|
||||
UpdateCostDisplays();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 모든 슬롯의 비용 표시 업데이트
|
||||
/// </summary>
|
||||
public void UpdateCostDisplays()
|
||||
{
|
||||
foreach (var slot in slotButtons)
|
||||
{
|
||||
if (slot != null)
|
||||
{
|
||||
slot.UpdateCostDisplay();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 퀵슬롯 Input Actions 초기화 및 구독 (직접 참조)
|
||||
@@ -246,6 +235,11 @@ namespace Northbound
|
||||
quickslotPanel.SetActive(true);
|
||||
}
|
||||
|
||||
if (descriptionPanel != null)
|
||||
{
|
||||
descriptionPanel.SetActive(true);
|
||||
}
|
||||
|
||||
// 퀵슬롯 입력 활성화
|
||||
EnableQuickslotActions(true);
|
||||
|
||||
@@ -268,6 +262,11 @@ namespace Northbound
|
||||
quickslotPanel.SetActive(false);
|
||||
}
|
||||
|
||||
if (descriptionPanel != null)
|
||||
{
|
||||
descriptionPanel.SetActive(false);
|
||||
}
|
||||
|
||||
// 퀵슬롯 입력 비활성화
|
||||
DisableQuickslotActions();
|
||||
|
||||
@@ -308,9 +307,45 @@ namespace Northbound
|
||||
buildingPlacement.SetSelectedBuilding(index);
|
||||
}
|
||||
|
||||
// Description Panel 업데이트
|
||||
UpdateDescriptionPanel();
|
||||
|
||||
Debug.Log($"[BuildingQuickslotUI] 건물 선택됨: {slotButtons[index].GetBuildingName()} (인덱스: {index})");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Description Panel 업데이트
|
||||
/// </summary>
|
||||
private void UpdateDescriptionPanel()
|
||||
{
|
||||
if (currentSelectedIndex < 0 || currentSelectedIndex >= slotButtons.Count)
|
||||
return;
|
||||
|
||||
var selectedSlot = slotButtons[currentSelectedIndex];
|
||||
if (selectedSlot == null || selectedSlot.BuildingData == null)
|
||||
return;
|
||||
|
||||
var buildingData = selectedSlot.BuildingData;
|
||||
|
||||
if (buildingNameText != null)
|
||||
{
|
||||
buildingNameText.text = buildingData.buildingName;
|
||||
}
|
||||
|
||||
if (buildingDescriptionText != null)
|
||||
{
|
||||
buildingDescriptionText.text = buildingData.memo;
|
||||
}
|
||||
|
||||
if (buildingCostText != null)
|
||||
{
|
||||
var coreResourceManager = CoreResourceManager.Instance;
|
||||
bool canAfford = coreResourceManager != null && coreResourceManager.CanAfford(buildingData.mana);
|
||||
string costTextT = canAfford ? $"{buildingData.mana}" : $"<color=red>{buildingData.mana}</color>";
|
||||
buildingCostText.text = $"{costTextT}";
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 현재 선택된 건물 인덱스
|
||||
/// </summary>
|
||||
|
||||
Reference in New Issue
Block a user