[UI] UI 컴포넌트 디버그 로그 제거
AbnormalityListUI, AbnormalitySlotUI, PlayerHUD, SkillSlotUI에서 불필요한 디버그 로그 제거 Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
This commit is contained in:
@@ -42,8 +42,6 @@ namespace Colosseum.UI
|
||||
|
||||
private void Start()
|
||||
{
|
||||
Debug.Log("[AbnormalityListUI] Start() called");
|
||||
|
||||
if (autoFindPlayer)
|
||||
{
|
||||
// 로컬 플레이어 찾기
|
||||
@@ -52,10 +50,6 @@ namespace Colosseum.UI
|
||||
|
||||
// 슬롯 풀 초기화
|
||||
InitializeSlotPool();
|
||||
|
||||
Debug.Log($"[AbnormalityListUI] slotPrefab: {(slotPrefab != null ? slotPrefab.name : "NULL")}");
|
||||
Debug.Log($"[AbnormalityListUI] buffContainer: {(buffContainer != null ? buffContainer.name : "NULL")}");
|
||||
Debug.Log($"[AbnormalityListUI] debuffContainer: {(debuffContainer != null ? debuffContainer.name : "NULL")}");
|
||||
}
|
||||
|
||||
private void OnDestroy()
|
||||
@@ -90,17 +84,14 @@ namespace Colosseum.UI
|
||||
private void FindLocalPlayer()
|
||||
{
|
||||
var playerObjects = FindObjectsByType<AbnormalityManager>(FindObjectsSortMode.None);
|
||||
Debug.Log($"[AbnormalityListUI] Found {playerObjects.Length} AbnormalityManager(s)");
|
||||
|
||||
foreach (var manager in playerObjects)
|
||||
{
|
||||
// 네트워크 오브젝트인 경우 로컬 플레이어 확인
|
||||
if (manager.TryGetComponent<Unity.Netcode.NetworkObject>(out var netObj))
|
||||
{
|
||||
Debug.Log($"[AbnormalityListUI] Checking {manager.gameObject.name}, IsOwner: {netObj.IsOwner}");
|
||||
if (netObj.IsOwner)
|
||||
{
|
||||
Debug.Log($"[AbnormalityListUI] Setting target to local player: {manager.gameObject.name}");
|
||||
SetTarget(manager);
|
||||
return;
|
||||
}
|
||||
@@ -111,13 +102,8 @@ namespace Colosseum.UI
|
||||
// 첫 번째 플레이어 사용 (싱글플레이어용)
|
||||
if (playerObjects.Length > 0)
|
||||
{
|
||||
Debug.Log($"[AbnormalityListUI] No local player found, using first manager: {playerObjects[0].gameObject.name}");
|
||||
SetTarget(playerObjects[0]);
|
||||
}
|
||||
else
|
||||
{
|
||||
Debug.LogWarning("[AbnormalityListUI] No AbnormalityManager found!");
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -126,8 +112,6 @@ namespace Colosseum.UI
|
||||
/// <param name="manager">추적할 AbnormalityManager</param>
|
||||
public void SetTarget(AbnormalityManager manager)
|
||||
{
|
||||
Debug.Log($"[AbnormalityListUI] SetTarget called with: {(manager != null ? manager.gameObject.name : "null")}");
|
||||
|
||||
// 기존 구독 해제
|
||||
if (targetManager != null)
|
||||
{
|
||||
@@ -144,7 +128,6 @@ namespace Colosseum.UI
|
||||
targetManager.OnAbnormalityAdded += OnAbnormalityAdded;
|
||||
targetManager.OnAbnormalityRemoved += OnAbnormalityRemoved;
|
||||
targetManager.OnAbnormalitiesChanged += OnAbnormalitiesChanged;
|
||||
Debug.Log("[AbnormalityListUI] Events subscribed successfully");
|
||||
}
|
||||
|
||||
// 즉시 UI 갱신
|
||||
@@ -156,11 +139,7 @@ namespace Colosseum.UI
|
||||
/// </summary>
|
||||
private void InitializeSlotPool()
|
||||
{
|
||||
if (slotPrefab == null)
|
||||
{
|
||||
Debug.LogWarning("[AbnormalityListUI] Slot prefab is not assigned");
|
||||
return;
|
||||
}
|
||||
if (slotPrefab == null) return;
|
||||
|
||||
// 필요한 만큼 슬롯 미리 생성
|
||||
for (int i = 0; i < maxSlots; i++)
|
||||
@@ -219,7 +198,6 @@ namespace Colosseum.UI
|
||||
/// </summary>
|
||||
private void OnAbnormalityAdded(ActiveAbnormality abnormality)
|
||||
{
|
||||
Debug.Log($"[AbnormalityListUI] OnAbnormalityAdded event received: {abnormality.Data.abnormalityName}");
|
||||
ForceRefreshUI();
|
||||
}
|
||||
|
||||
@@ -228,7 +206,6 @@ namespace Colosseum.UI
|
||||
/// </summary>
|
||||
private void OnAbnormalityRemoved(ActiveAbnormality abnormality)
|
||||
{
|
||||
Debug.Log($"[AbnormalityListUI] OnAbnormalityRemoved event received: {abnormality.Data.abnormalityName}");
|
||||
ForceRefreshUI();
|
||||
}
|
||||
|
||||
@@ -237,7 +214,6 @@ namespace Colosseum.UI
|
||||
/// </summary>
|
||||
private void OnAbnormalitiesChanged()
|
||||
{
|
||||
Debug.Log("[AbnormalityListUI] OnAbnormalitiesChanged event received");
|
||||
ForceRefreshUI();
|
||||
}
|
||||
|
||||
@@ -246,11 +222,7 @@ namespace Colosseum.UI
|
||||
/// </summary>
|
||||
public void ForceRefreshUI()
|
||||
{
|
||||
if (targetManager == null)
|
||||
{
|
||||
Debug.LogWarning("[AbnormalityListUI] ForceRefreshUI called but targetManager is null");
|
||||
return;
|
||||
}
|
||||
if (targetManager == null) return;
|
||||
|
||||
// 모든 슬롯 반환
|
||||
foreach (var slot in activeSlots.ToArray())
|
||||
@@ -262,23 +234,16 @@ namespace Colosseum.UI
|
||||
|
||||
// 활성화된 이상 상태 표시
|
||||
var abnormalities = targetManager.ActiveAbnormalities;
|
||||
Debug.Log($"[AbnormalityListUI] ForceRefreshUI: {abnormalities.Count} abnormalities found");
|
||||
|
||||
foreach (var abnormality in abnormalities)
|
||||
{
|
||||
var slot = GetSlot();
|
||||
if (slot == null)
|
||||
{
|
||||
Debug.LogWarning("[AbnormalityListUI] Could not get slot from pool");
|
||||
continue;
|
||||
}
|
||||
if (slot == null) continue;
|
||||
|
||||
// 버프/디버프에 따라 적절한 컨테이너에 배치
|
||||
Transform container = abnormality.Data.isDebuff ? debuffContainer : buffContainer;
|
||||
if (container == null) container = transform;
|
||||
|
||||
Debug.Log($"[AbnormalityListUI] Adding slot for: {abnormality.Data.abnormalityName}, isDebuff: {abnormality.Data.isDebuff}, container: {container.name}");
|
||||
|
||||
slot.transform.SetParent(container, false);
|
||||
slot.Initialize(abnormality);
|
||||
slot.gameObject.SetActive(true);
|
||||
|
||||
@@ -49,14 +49,7 @@ namespace Colosseum.UI
|
||||
{
|
||||
trackedAbnormality = abnormality;
|
||||
|
||||
if (abnormality?.Data == null)
|
||||
{
|
||||
Debug.LogWarning("[AbnormalitySlotUI] Initialize called with null abnormality or data");
|
||||
return;
|
||||
}
|
||||
|
||||
Debug.Log($"[AbnormalitySlotUI] Initialize: {abnormality.Data.abnormalityName}, icon: {abnormality.Data.icon?.name ?? "null"}");
|
||||
Debug.Log($"[AbnormalitySlotUI] UI References - iconImage: {(iconImage != null ? "OK" : "NULL")}, durationFill: {(durationFill != null ? "OK" : "NULL")}, durationText: {(durationText != null ? "OK" : "NULL")}, backgroundImage: {(backgroundImage != null ? "OK" : "NULL")}");
|
||||
if (abnormality?.Data == null) return;
|
||||
|
||||
// Cooltime 요소 활성화 (부모 게임오브젝트들이 비활성화되어 있을 수 있음)
|
||||
EnableDurationElements();
|
||||
@@ -74,11 +67,6 @@ namespace Colosseum.UI
|
||||
effectNameText.text = abnormality.Data.abnormalityName;
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
Debug.LogWarning("[AbnormalitySlotUI] effectNameText is null");
|
||||
}
|
||||
|
||||
// 배경 색상 설정 (버프/디버프 구분)
|
||||
if (backgroundImage != null)
|
||||
{
|
||||
|
||||
@@ -44,11 +44,8 @@ namespace Colosseum.UI
|
||||
|
||||
private void FindLocalPlayer()
|
||||
{
|
||||
var players = FindObjectsByType<PlayerNetworkController>(FindObjectsSortMode.None);
|
||||
Debug.Log($"[PlayerHUD] Finding player... found {players.Length} players");
|
||||
foreach (var player in players)
|
||||
foreach (var player in FindObjectsByType<PlayerNetworkController>(FindObjectsSortMode.None))
|
||||
{
|
||||
Debug.Log($"[PlayerHUD] Player {player.OwnerClientId}: IsOwner={player.IsOwner}, IsSpawned={player.IsSpawned}");
|
||||
if (player.IsOwner)
|
||||
{
|
||||
SetTarget(player);
|
||||
@@ -62,8 +59,6 @@ namespace Colosseum.UI
|
||||
/// </summary>
|
||||
public void SetTarget(PlayerNetworkController player)
|
||||
{
|
||||
Debug.Log($"[PlayerHUD] SetTarget called: {(player != null ? $"Player {player.OwnerClientId}" : "null")}");
|
||||
|
||||
// 이전 타겟 구독 해제
|
||||
UnsubscribeFromEvents();
|
||||
|
||||
@@ -74,8 +69,6 @@ namespace Colosseum.UI
|
||||
|
||||
// 초기 값 설정
|
||||
UpdateStatBars();
|
||||
|
||||
Debug.Log($"[PlayerHUD] Initial HP: {targetPlayer?.Health}/{targetPlayer?.MaxHealth}, MP: {targetPlayer?.Mana}/{targetPlayer?.MaxMana}");
|
||||
}
|
||||
|
||||
private void SubscribeToEvents()
|
||||
@@ -112,31 +105,17 @@ namespace Colosseum.UI
|
||||
|
||||
private void UpdateStatBars()
|
||||
{
|
||||
if (targetPlayer == null)
|
||||
{
|
||||
Debug.Log("[PlayerHUD] UpdateStatBars: targetPlayer is null");
|
||||
return;
|
||||
}
|
||||
|
||||
Debug.Log($"[PlayerHUD] UpdateStatBars: HP={targetPlayer.Health}/{targetPlayer.MaxHealth}, MP={targetPlayer.Mana}/{targetPlayer.MaxMana}");
|
||||
if (targetPlayer == null) return;
|
||||
|
||||
if (healthBar != null)
|
||||
{
|
||||
healthBar.SetValue(targetPlayer.Health, targetPlayer.MaxHealth);
|
||||
}
|
||||
else
|
||||
{
|
||||
Debug.LogWarning("[PlayerHUD] healthBar is null!");
|
||||
}
|
||||
|
||||
if (manaBar != null)
|
||||
{
|
||||
manaBar.SetValue(targetPlayer.Mana, targetPlayer.MaxMana);
|
||||
}
|
||||
else
|
||||
{
|
||||
Debug.LogWarning("[PlayerHUD] manaBar is null!");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -86,8 +86,6 @@ namespace Colosseum.UI
|
||||
{
|
||||
iconImage.enabled = false;
|
||||
}
|
||||
|
||||
Debug.Log($"[SkillSlotUI] Init slot {index}: skill={skillData?.SkillName}, useIcon={useIconForCooldown}");
|
||||
}
|
||||
|
||||
public void UpdateState(float cooldownRemaining, float cooldownTotal, bool hasEnoughMana)
|
||||
|
||||
Reference in New Issue
Block a user