feat: 플레이어 탱킹 및 지원 스킬 1차 구현
- 도발, 방어 태세, 철벽 스킬과 위협 생성 배율 시스템을 추가 - 치유, 광역 치유, 보호막 스킬과 관련 이상상태/이펙트 자산을 구성 - 보호막 흡수 로직과 체력 HUD 보너스 표시를 PlayerNetworkController, PlayerHUD, StatBar에 반영 - 플레이어 프리팹 슬롯과 디버그 메뉴를 확장해 탱킹·지원 스킬 검증 경로를 추가 - Unity 컴파일과 런타임 테스트에서 도발, 치유, 광역 치유, 보호막 발동 및 보호막 수치 적용을 확인
This commit is contained in:
200
Assets/_Game/Scripts/Editor/PlayerSkillDebugMenu.cs
Normal file
200
Assets/_Game/Scripts/Editor/PlayerSkillDebugMenu.cs
Normal file
@@ -0,0 +1,200 @@
|
||||
using System.Text;
|
||||
|
||||
using Colosseum.Enemy;
|
||||
using Colosseum.Player;
|
||||
using Colosseum.Skills;
|
||||
|
||||
using UnityEditor;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Colosseum.Editor
|
||||
{
|
||||
/// <summary>
|
||||
/// 플레이 모드에서 로컬 플레이어 스킬과 보스 위협 상태를 빠르게 검증하는 디버그 메뉴입니다.
|
||||
/// </summary>
|
||||
public static class PlayerSkillDebugMenu
|
||||
{
|
||||
private const int TemporaryDebugSlotIndex = 5;
|
||||
private const string HealSkillPath = "Assets/_Game/Data/Skills/Data_Skill_Player_치유.asset";
|
||||
private const string AreaHealSkillPath = "Assets/_Game/Data/Skills/Data_Skill_Player_광역치유.asset";
|
||||
private const string ShieldSkillPath = "Assets/_Game/Data/Skills/Data_Skill_Player_보호막.asset";
|
||||
|
||||
[MenuItem("Tools/Colosseum/Debug/Cast Local Skill 3")]
|
||||
private static void CastLocalSkill3()
|
||||
{
|
||||
CastLocalSkill(2);
|
||||
}
|
||||
|
||||
[MenuItem("Tools/Colosseum/Debug/Cast Local Skill 4")]
|
||||
private static void CastLocalSkill4()
|
||||
{
|
||||
CastLocalSkill(3);
|
||||
}
|
||||
|
||||
[MenuItem("Tools/Colosseum/Debug/Cast Local Skill 5")]
|
||||
private static void CastLocalSkill5()
|
||||
{
|
||||
CastLocalSkill(4);
|
||||
}
|
||||
|
||||
[MenuItem("Tools/Colosseum/Debug/Cast Local Heal")]
|
||||
private static void CastLocalHeal()
|
||||
{
|
||||
CastLocalSkillAsset(HealSkillPath);
|
||||
}
|
||||
|
||||
[MenuItem("Tools/Colosseum/Debug/Cast Local Area Heal")]
|
||||
private static void CastLocalAreaHeal()
|
||||
{
|
||||
CastLocalSkillAsset(AreaHealSkillPath);
|
||||
}
|
||||
|
||||
[MenuItem("Tools/Colosseum/Debug/Cast Local Shield")]
|
||||
private static void CastLocalShield()
|
||||
{
|
||||
CastLocalSkillAsset(ShieldSkillPath);
|
||||
}
|
||||
|
||||
[MenuItem("Tools/Colosseum/Debug/Damage Local Player 30")]
|
||||
private static void DamageLocalPlayer30()
|
||||
{
|
||||
if (!EditorApplication.isPlaying)
|
||||
{
|
||||
Debug.LogWarning("[Debug] 플레이 모드에서만 사용할 수 있습니다.");
|
||||
return;
|
||||
}
|
||||
|
||||
PlayerNetworkController localNetworkController = FindLocalNetworkController();
|
||||
if (localNetworkController == null)
|
||||
{
|
||||
Debug.LogWarning("[Debug] 로컬 PlayerNetworkController를 찾지 못했습니다.");
|
||||
return;
|
||||
}
|
||||
|
||||
localNetworkController.TakeDamageRpc(30f);
|
||||
}
|
||||
|
||||
[MenuItem("Tools/Colosseum/Debug/Log Local Player Status")]
|
||||
private static void LogLocalPlayerStatus()
|
||||
{
|
||||
if (!EditorApplication.isPlaying)
|
||||
{
|
||||
Debug.LogWarning("[Debug] 플레이 모드에서만 사용할 수 있습니다.");
|
||||
return;
|
||||
}
|
||||
|
||||
PlayerNetworkController localNetworkController = FindLocalNetworkController();
|
||||
if (localNetworkController == null)
|
||||
{
|
||||
Debug.LogWarning("[Debug] 로컬 PlayerNetworkController를 찾지 못했습니다.");
|
||||
return;
|
||||
}
|
||||
|
||||
Debug.Log(
|
||||
$"[Debug] 로컬 플레이어 상태 | HP {localNetworkController.Health:F1}/{localNetworkController.MaxHealth:F1} | " +
|
||||
$"MP {localNetworkController.Mana:F1}/{localNetworkController.MaxMana:F1} | Shield {localNetworkController.Shield:F1}");
|
||||
}
|
||||
|
||||
[MenuItem("Tools/Colosseum/Debug/Log Boss Threat Summary")]
|
||||
private static void LogBossThreatSummary()
|
||||
{
|
||||
if (!EditorApplication.isPlaying)
|
||||
{
|
||||
Debug.LogWarning("[Debug] 플레이 모드에서만 사용할 수 있습니다.");
|
||||
return;
|
||||
}
|
||||
|
||||
EnemyBase[] enemies = Object.FindObjectsByType<EnemyBase>(FindObjectsInactive.Exclude, FindObjectsSortMode.None);
|
||||
if (enemies == null || enemies.Length == 0)
|
||||
{
|
||||
Debug.LogWarning("[Debug] 활성 EnemyBase가 없습니다.");
|
||||
return;
|
||||
}
|
||||
|
||||
StringBuilder builder = new StringBuilder();
|
||||
for (int i = 0; i < enemies.Length; i++)
|
||||
{
|
||||
EnemyBase enemy = enemies[i];
|
||||
if (enemy == null)
|
||||
continue;
|
||||
|
||||
if (builder.Length > 0)
|
||||
builder.AppendLine().AppendLine();
|
||||
|
||||
builder.Append(enemy.name);
|
||||
builder.Append(" : ");
|
||||
builder.Append(enemy.GetThreatDebugSummary().Replace("\r\n", " | ").Replace("\n", " | "));
|
||||
}
|
||||
|
||||
Debug.Log($"[Debug] 보스 위협 요약\n{builder}");
|
||||
}
|
||||
|
||||
private static PlayerSkillInput FindLocalSkillInput()
|
||||
{
|
||||
PlayerSkillInput[] skillInputs = Object.FindObjectsByType<PlayerSkillInput>(FindObjectsInactive.Exclude, FindObjectsSortMode.None);
|
||||
for (int i = 0; i < skillInputs.Length; i++)
|
||||
{
|
||||
if (skillInputs[i] != null && skillInputs[i].IsOwner)
|
||||
return skillInputs[i];
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
private static PlayerNetworkController FindLocalNetworkController()
|
||||
{
|
||||
PlayerNetworkController[] networkControllers = Object.FindObjectsByType<PlayerNetworkController>(FindObjectsInactive.Exclude, FindObjectsSortMode.None);
|
||||
for (int i = 0; i < networkControllers.Length; i++)
|
||||
{
|
||||
if (networkControllers[i] != null && networkControllers[i].IsOwner)
|
||||
return networkControllers[i];
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
private static void CastLocalSkill(int slotIndex)
|
||||
{
|
||||
if (!EditorApplication.isPlaying)
|
||||
{
|
||||
Debug.LogWarning("[Debug] 플레이 모드에서만 사용할 수 있습니다.");
|
||||
return;
|
||||
}
|
||||
|
||||
PlayerSkillInput localSkillInput = FindLocalSkillInput();
|
||||
if (localSkillInput == null)
|
||||
{
|
||||
Debug.LogWarning("[Debug] 로컬 PlayerSkillInput을 찾지 못했습니다.");
|
||||
return;
|
||||
}
|
||||
|
||||
localSkillInput.DebugCastSkill(slotIndex);
|
||||
}
|
||||
|
||||
private static void CastLocalSkillAsset(string assetPath)
|
||||
{
|
||||
if (!EditorApplication.isPlaying)
|
||||
{
|
||||
Debug.LogWarning("[Debug] 플레이 모드에서만 사용할 수 있습니다.");
|
||||
return;
|
||||
}
|
||||
|
||||
PlayerSkillInput localSkillInput = FindLocalSkillInput();
|
||||
if (localSkillInput == null)
|
||||
{
|
||||
Debug.LogWarning("[Debug] 로컬 PlayerSkillInput을 찾지 못했습니다.");
|
||||
return;
|
||||
}
|
||||
|
||||
SkillData skill = AssetDatabase.LoadAssetAtPath<SkillData>(assetPath);
|
||||
if (skill == null)
|
||||
{
|
||||
Debug.LogWarning($"[Debug] 스킬 에셋을 찾지 못했습니다: {assetPath}");
|
||||
return;
|
||||
}
|
||||
|
||||
localSkillInput.SetSkill(TemporaryDebugSlotIndex, skill);
|
||||
localSkillInput.DebugCastSkill(TemporaryDebugSlotIndex);
|
||||
}
|
||||
}
|
||||
}
|
||||
2
Assets/_Game/Scripts/Editor/PlayerSkillDebugMenu.cs.meta
Normal file
2
Assets/_Game/Scripts/Editor/PlayerSkillDebugMenu.cs.meta
Normal file
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 024b92839f405134e8824931db2091a6
|
||||
Reference in New Issue
Block a user