esc(Cancel)로 건설모드 취소

This commit is contained in:
2026-02-04 13:39:53 +09:00
parent c74d6d2ebd
commit 47cd76aebc
2 changed files with 21 additions and 3 deletions

View File

@@ -29,6 +29,7 @@ namespace Northbound
private List<BuildingSlotButton> slotButtons = new List<BuildingSlotButton>();
private BuildingPlacement buildingPlacement;
private int currentSelectedIndex = -1;
private int lastSelectedIndex = 0;
private PlayerInputActions _inputActions;
private InputAction[] _quickslotActions;
@@ -234,8 +235,12 @@ namespace Northbound
// 퀵슬롯 입력 활성화
EnableQuickslotActions(true);
// 기본 선택 (첫 번째 건물)
if (slotButtons.Count > 0)
// 마지막으로 선택된 건물 선택
if (slotButtons.Count > 0 && lastSelectedIndex >= 0 && lastSelectedIndex < slotButtons.Count)
{
SelectBuilding(lastSelectedIndex);
}
else if (slotButtons.Count > 0)
{
SelectBuilding(0);
}
@@ -286,6 +291,7 @@ namespace Northbound
// 새로운 선택
currentSelectedIndex = index;
lastSelectedIndex = index;
slotButtons[index].SetSelected(true);
// BuildingPlacement에 알림