feat: 플레이어 역할별 스킬 프리셋 적용 경로 추가
- 탱커, 지원, 딜러 기본 슬롯 프리셋을 로컬 플레이어에 즉시 적용하는 디버그 메뉴를 추가 - PlayerSkillInput에 7칸 슬롯 자동 보정과 일괄 갱신 API를 넣어 기존 프리팹 직렬화와 호환되도록 정리 - SkillQuickSlotUI가 스킬 슬롯 변경 이벤트를 구독해 프리셋 적용 시 액션바가 즉시 갱신되도록 보강 - 플레이 검증에서 탱커, 지원, 딜러 프리셋이 모두 기대한 슬롯 순서와 Ctrl 회피 슬롯까지 정상 적용되는 것을 확인
This commit is contained in:
@@ -44,6 +44,14 @@ namespace Colosseum.UI
|
||||
FindLocalPlayer();
|
||||
}
|
||||
|
||||
private void OnDestroy()
|
||||
{
|
||||
if (playerSkillInput != null)
|
||||
{
|
||||
playerSkillInput.OnSkillSlotsChanged -= HandleSkillSlotsChanged;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 자식 슬롯을 자동 수집해 프리팹 중첩 구조 변경에도 참조가 유지되도록 합니다.
|
||||
/// </summary>
|
||||
@@ -212,10 +220,9 @@ namespace Colosseum.UI
|
||||
{
|
||||
if (player.IsOwner)
|
||||
{
|
||||
playerSkillInput = player;
|
||||
SetPlayer(player);
|
||||
networkController = player.GetComponent<PlayerNetworkController>();
|
||||
Debug.Log($"[SkillQuickSlotUI] Found local player: {player.name}");
|
||||
InitializeSlots();
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -294,8 +301,19 @@ namespace Colosseum.UI
|
||||
/// </summary>
|
||||
public void SetPlayer(PlayerSkillInput player)
|
||||
{
|
||||
if (playerSkillInput != null)
|
||||
{
|
||||
playerSkillInput.OnSkillSlotsChanged -= HandleSkillSlotsChanged;
|
||||
}
|
||||
|
||||
playerSkillInput = player;
|
||||
networkController = player?.GetComponent<PlayerNetworkController>();
|
||||
|
||||
if (playerSkillInput != null)
|
||||
{
|
||||
playerSkillInput.OnSkillSlotsChanged += HandleSkillSlotsChanged;
|
||||
}
|
||||
|
||||
InitializeSlots();
|
||||
}
|
||||
|
||||
@@ -312,5 +330,10 @@ namespace Colosseum.UI
|
||||
string keyLabel = displayIndex < keyLabels.Length ? keyLabels[displayIndex] : (displayIndex + 1).ToString();
|
||||
skillSlots[displayIndex].Initialize(slotIndex, skill, keyLabel);
|
||||
}
|
||||
|
||||
private void HandleSkillSlotsChanged()
|
||||
{
|
||||
InitializeSlots();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user