- 탱커, 지원, 딜러 기본 슬롯 프리셋을 로컬 플레이어에 즉시 적용하는 디버그 메뉴를 추가 - PlayerSkillInput에 7칸 슬롯 자동 보정과 일괄 갱신 API를 넣어 기존 프리팹 직렬화와 호환되도록 정리 - SkillQuickSlotUI가 스킬 슬롯 변경 이벤트를 구독해 프리셋 적용 시 액션바가 즉시 갱신되도록 보강 - 플레이 검증에서 탱커, 지원, 딜러 프리셋이 모두 기대한 슬롯 순서와 Ctrl 회피 슬롯까지 정상 적용되는 것을 확인
396 lines
14 KiB
C#
396 lines
14 KiB
C#
using System.Text;
|
|
using System.Collections.Generic;
|
|
|
|
using Colosseum.Enemy;
|
|
using Colosseum.Player;
|
|
using Colosseum.Skills;
|
|
using Colosseum.UI;
|
|
using Colosseum.Abnormalities;
|
|
|
|
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";
|
|
private const string SlashSkillPath = "Assets/_Game/Data/Skills/Data_Skill_Player_베기.asset";
|
|
private const string PierceSkillPath = "Assets/_Game/Data/Skills/Data_Skill_Player_찌르기.asset";
|
|
private const string SpinSkillPath = "Assets/_Game/Data/Skills/Data_Skill_Player_회전베기.asset";
|
|
private const string DashSkillPath = "Assets/_Game/Data/Skills/Data_Skill_Player_돌진.asset";
|
|
private const string ProjectileSkillPath = "Assets/_Game/Data/Skills/Data_Skill_Player_투사체.asset";
|
|
private const string TauntSkillPath = "Assets/_Game/Data/Skills/Data_Skill_Player_도발.asset";
|
|
private const string GuardSkillPath = "Assets/_Game/Data/Skills/Data_Skill_Player_방어태세.asset";
|
|
private const string IronWallSkillPath = "Assets/_Game/Data/Skills/Data_Skill_Player_철벽.asset";
|
|
private const string EvadeSkillPath = "Assets/_Game/Data/Skills/Data_Skill_Player_구르기.asset";
|
|
private const string StunAbnormalityPath = "Assets/_Game/Data/Abnormalities/Data_Abnormality_Player_Stun.asset";
|
|
private const string SilenceAbnormalityPath = "Assets/_Game/Data/Abnormalities/Data_Abnormality_Player_Silence.asset";
|
|
private const string MarkAbnormalityPath = "Assets/_Game/Data/Abnormalities/Data_Abnormality_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}");
|
|
}
|
|
|
|
[MenuItem("Tools/Colosseum/Debug/Apply Local Stun")]
|
|
private static void ApplyLocalStun()
|
|
{
|
|
ApplyLocalAbnormality(StunAbnormalityPath);
|
|
}
|
|
|
|
[MenuItem("Tools/Colosseum/Debug/Apply Local Silence")]
|
|
private static void ApplyLocalSilence()
|
|
{
|
|
ApplyLocalAbnormality(SilenceAbnormalityPath);
|
|
}
|
|
|
|
[MenuItem("Tools/Colosseum/Debug/Apply Local Mark")]
|
|
private static void ApplyLocalMark()
|
|
{
|
|
ApplyLocalAbnormality(MarkAbnormalityPath);
|
|
}
|
|
|
|
[MenuItem("Tools/Colosseum/Debug/Log HUD Abnormality Summary")]
|
|
private static void LogHudAbnormalitySummary()
|
|
{
|
|
if (!EditorApplication.isPlaying)
|
|
{
|
|
Debug.LogWarning("[Debug] 플레이 모드에서만 사용할 수 있습니다.");
|
|
return;
|
|
}
|
|
|
|
PlayerHUD playerHud = Object.FindFirstObjectByType<PlayerHUD>();
|
|
if (playerHud == null)
|
|
{
|
|
Debug.LogWarning("[Debug] PlayerHUD를 찾지 못했습니다.");
|
|
return;
|
|
}
|
|
|
|
Debug.Log($"[Debug] HUD 이상상태 요약 | {playerHud.CurrentAbnormalitySummary}");
|
|
}
|
|
|
|
[MenuItem("Tools/Colosseum/Debug/Apply Tank Loadout")]
|
|
private static void ApplyTankLoadout()
|
|
{
|
|
ApplyLoadout(
|
|
"탱커",
|
|
SlashSkillPath,
|
|
TauntSkillPath,
|
|
GuardSkillPath,
|
|
DashSkillPath,
|
|
IronWallSkillPath,
|
|
PierceSkillPath,
|
|
EvadeSkillPath);
|
|
}
|
|
|
|
[MenuItem("Tools/Colosseum/Debug/Apply Support Loadout")]
|
|
private static void ApplySupportLoadout()
|
|
{
|
|
ApplyLoadout(
|
|
"지원",
|
|
SlashSkillPath,
|
|
HealSkillPath,
|
|
AreaHealSkillPath,
|
|
ShieldSkillPath,
|
|
DashSkillPath,
|
|
ProjectileSkillPath,
|
|
EvadeSkillPath);
|
|
}
|
|
|
|
[MenuItem("Tools/Colosseum/Debug/Apply DPS Loadout")]
|
|
private static void ApplyDpsLoadout()
|
|
{
|
|
ApplyLoadout(
|
|
"딜러",
|
|
SlashSkillPath,
|
|
PierceSkillPath,
|
|
SpinSkillPath,
|
|
DashSkillPath,
|
|
ProjectileSkillPath,
|
|
ShieldSkillPath,
|
|
EvadeSkillPath);
|
|
}
|
|
|
|
[MenuItem("Tools/Colosseum/Debug/Log Local Skill Loadout")]
|
|
private static void LogLocalSkillLoadout()
|
|
{
|
|
if (!EditorApplication.isPlaying)
|
|
{
|
|
Debug.LogWarning("[Debug] 플레이 모드에서만 사용할 수 있습니다.");
|
|
return;
|
|
}
|
|
|
|
PlayerSkillInput localSkillInput = FindLocalSkillInput();
|
|
if (localSkillInput == null)
|
|
{
|
|
Debug.LogWarning("[Debug] 로컬 PlayerSkillInput을 찾지 못했습니다.");
|
|
return;
|
|
}
|
|
|
|
string[] slotNames = { "L", "R", "1", "2", "3", "4", "Ctrl" };
|
|
int[] slotOrder = { 0, 1, 2, 3, 4, 5, 6 };
|
|
StringBuilder builder = new StringBuilder();
|
|
for (int i = 0; i < slotOrder.Length; i++)
|
|
{
|
|
SkillData skill = localSkillInput.GetSkill(slotOrder[i]);
|
|
builder.Append(slotNames[i]);
|
|
builder.Append(": ");
|
|
builder.Append(skill != null ? skill.SkillName : "(비어 있음)");
|
|
|
|
if (i < slotOrder.Length - 1)
|
|
builder.Append(" | ");
|
|
}
|
|
|
|
Debug.Log($"[Debug] 로컬 스킬 구성 | {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 AbnormalityManager FindLocalAbnormalityManager()
|
|
{
|
|
PlayerNetworkController localNetworkController = FindLocalNetworkController();
|
|
if (localNetworkController == null)
|
|
{
|
|
return null;
|
|
}
|
|
|
|
return localNetworkController.GetComponent<AbnormalityManager>();
|
|
}
|
|
|
|
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);
|
|
}
|
|
|
|
private static void ApplyLocalAbnormality(string assetPath)
|
|
{
|
|
if (!EditorApplication.isPlaying)
|
|
{
|
|
Debug.LogWarning("[Debug] 플레이 모드에서만 사용할 수 있습니다.");
|
|
return;
|
|
}
|
|
|
|
AbnormalityManager abnormalityManager = FindLocalAbnormalityManager();
|
|
if (abnormalityManager == null)
|
|
{
|
|
Debug.LogWarning("[Debug] 로컬 AbnormalityManager를 찾지 못했습니다.");
|
|
return;
|
|
}
|
|
|
|
AbnormalityData abnormality = AssetDatabase.LoadAssetAtPath<AbnormalityData>(assetPath);
|
|
if (abnormality == null)
|
|
{
|
|
Debug.LogWarning($"[Debug] 이상상태 에셋을 찾지 못했습니다: {assetPath}");
|
|
return;
|
|
}
|
|
|
|
abnormalityManager.ApplyAbnormality(abnormality, abnormalityManager.gameObject);
|
|
}
|
|
|
|
private static void ApplyLoadout(string loadoutName, params string[] skillPaths)
|
|
{
|
|
if (!EditorApplication.isPlaying)
|
|
{
|
|
Debug.LogWarning("[Debug] 플레이 모드에서만 사용할 수 있습니다.");
|
|
return;
|
|
}
|
|
|
|
PlayerSkillInput localSkillInput = FindLocalSkillInput();
|
|
if (localSkillInput == null)
|
|
{
|
|
Debug.LogWarning("[Debug] 로컬 PlayerSkillInput을 찾지 못했습니다.");
|
|
return;
|
|
}
|
|
|
|
List<SkillData> skills = new List<SkillData>(skillPaths.Length);
|
|
for (int i = 0; i < skillPaths.Length; i++)
|
|
{
|
|
SkillData skill = AssetDatabase.LoadAssetAtPath<SkillData>(skillPaths[i]);
|
|
if (skill == null)
|
|
{
|
|
Debug.LogWarning($"[Debug] 스킬 에셋을 찾지 못했습니다: {skillPaths[i]}");
|
|
return;
|
|
}
|
|
|
|
skills.Add(skill);
|
|
}
|
|
|
|
localSkillInput.SetSkills(skills);
|
|
Debug.Log($"[Debug] {loadoutName} 프리셋을 적용했습니다.");
|
|
}
|
|
}
|
|
}
|