- 다중 젬 슬롯용 타입을 별도 스크립트로 분리하고 테스트 젬/로드아웃 자산 생성 경로를 정리 - 젬 테스트 전용 공격 스킬과 분리된 애니메이션 자산을 추가해 베이스 스킬 검증 경로를 마련 - PlayerSkillDebugMenu와 MPP 디버그 메뉴를 보강해 젬 프리셋 적용, 원격 테스트, 보스 기절 디버그 메뉴를 추가 - BossCombatBehaviorContext와 공통 BT 액션이 기절 상태를 존중하도록 수정해 보스 추적과 패턴 실행을 중단 - Unity 리프레시와 외부 빌드 통과를 확인하고 드로그전 및 MPP 기준 젬 프리셋 적용 흐름을 검증
807 lines
32 KiB
C#
807 lines
32 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 GemTestSkillPath = "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";
|
|
private const string SkillGemFolderPath = "Assets/_Game/Data/SkillGems";
|
|
private const string LoadoutPresetFolderPath = "Assets/_Game/Data/Loadouts";
|
|
private const string CrushGemPath = SkillGemFolderPath + "/Data_SkillGem_Player_파쇄.asset";
|
|
private const string ChallengerGemPath = SkillGemFolderPath + "/Data_SkillGem_Player_도전자.asset";
|
|
private const string GuardianGemPath = SkillGemFolderPath + "/Data_SkillGem_Player_수호.asset";
|
|
private const string TankGemPresetPath = LoadoutPresetFolderPath + "/Data_LoadoutPreset_Player_탱커_젬테스트.asset";
|
|
private const string SupportGemPresetPath = LoadoutPresetFolderPath + "/Data_LoadoutPreset_Player_지원_젬테스트.asset";
|
|
private const string DpsGemPresetPath = LoadoutPresetFolderPath + "/Data_LoadoutPreset_Player_딜러_젬테스트.asset";
|
|
|
|
[MenuItem("Tools/Colosseum/Debug/Cast Local Skill 3")]
|
|
private static void CastLocalSkill3()
|
|
{
|
|
CastLocalSkill(2);
|
|
}
|
|
|
|
[MenuItem("Tools/Colosseum/Debug/Cast Local Skill R")]
|
|
private static void CastLocalSkillR()
|
|
{
|
|
CastLocalSkill(1);
|
|
}
|
|
|
|
[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 Skill 6")]
|
|
private static void CastLocalSkill6()
|
|
{
|
|
CastLocalSkill(5);
|
|
}
|
|
|
|
[MenuItem("Tools/Colosseum/Debug/Cast Client1 Skill R")]
|
|
private static void CastClient1SkillR()
|
|
{
|
|
CastOwnedPlayerSkillAsServer(1, 1);
|
|
}
|
|
|
|
[MenuItem("Tools/Colosseum/Debug/Cast Client1 Skill 1")]
|
|
private static void CastClient1Skill1()
|
|
{
|
|
CastOwnedPlayerSkillAsServer(1, 2);
|
|
}
|
|
|
|
[MenuItem("Tools/Colosseum/Debug/Cast Client1 Skill 2")]
|
|
private static void CastClient1Skill2()
|
|
{
|
|
CastOwnedPlayerSkillAsServer(1, 3);
|
|
}
|
|
|
|
[MenuItem("Tools/Colosseum/Debug/Cast Client1 Skill 3")]
|
|
private static void CastClient1Skill3()
|
|
{
|
|
CastOwnedPlayerSkillAsServer(1, 4);
|
|
}
|
|
|
|
[MenuItem("Tools/Colosseum/Debug/Cast Client1 Skill 4")]
|
|
private static void CastClient1Skill4()
|
|
{
|
|
CastOwnedPlayerSkillAsServer(1, 5);
|
|
}
|
|
|
|
[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.Append(" || ");
|
|
|
|
builder.Append(enemy.name);
|
|
builder.Append(" : ");
|
|
builder.Append(enemy.GetThreatDebugSummary().Replace("\r\n", " | ").Replace("\n", " | "));
|
|
}
|
|
|
|
Debug.Log($"[Debug] 보스 위협 요약 | {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/Apply Boss Stun")]
|
|
private static void ApplyBossStun()
|
|
{
|
|
if (!EditorApplication.isPlaying)
|
|
{
|
|
Debug.LogWarning("[Debug] 플레이 모드에서만 사용할 수 있습니다.");
|
|
return;
|
|
}
|
|
|
|
AbnormalityManager abnormalityManager = FindBossAbnormalityManager();
|
|
if (abnormalityManager == null)
|
|
{
|
|
Debug.LogWarning("[Debug] 보스 AbnormalityManager를 찾지 못했습니다.");
|
|
return;
|
|
}
|
|
|
|
AbnormalityData abnormality = AssetDatabase.LoadAssetAtPath<AbnormalityData>(StunAbnormalityPath);
|
|
if (abnormality == null)
|
|
{
|
|
Debug.LogWarning($"[Debug] 기절 이상상태 에셋을 찾지 못했습니다: {StunAbnormalityPath}");
|
|
return;
|
|
}
|
|
|
|
abnormalityManager.ApplyAbnormality(abnormality, abnormalityManager.gameObject);
|
|
Debug.Log($"[Debug] 보스에게 기절 적용 | Target={abnormalityManager.gameObject.name} | Abnormality={abnormality.abnormalityName}");
|
|
}
|
|
|
|
[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/Apply Tank Gem Loadout")]
|
|
private static void ApplyTankGemLoadout()
|
|
{
|
|
ApplyLoadoutPreset(TankGemPresetPath, "탱커 젬");
|
|
}
|
|
|
|
[MenuItem("Tools/Colosseum/Debug/Apply Support Gem Loadout")]
|
|
private static void ApplySupportGemLoadout()
|
|
{
|
|
ApplyLoadoutPreset(SupportGemPresetPath, "지원 젬");
|
|
}
|
|
|
|
[MenuItem("Tools/Colosseum/Debug/Apply DPS Gem Loadout")]
|
|
private static void ApplyDpsGemLoadout()
|
|
{
|
|
ApplyLoadoutPreset(DpsGemPresetPath, "딜러 젬");
|
|
}
|
|
|
|
[MenuItem("Tools/Colosseum/Setup/Create or Update Test Skill Gems")]
|
|
public static void CreateOrUpdateTestSkillGems()
|
|
{
|
|
EnsureFolder("Assets/_Game/Data", "SkillGems");
|
|
|
|
SkillEffect damageEffect = AssetDatabase.LoadAssetAtPath<SkillEffect>("Assets/_Game/Data/Skills/Effects/Data_SkillEffect_Player_찌르기_0_데미지.asset");
|
|
SkillEffect tauntEffect = AssetDatabase.LoadAssetAtPath<SkillEffect>("Assets/_Game/Data/Skills/Effects/Data_SkillEffect_Player_도발_0_도발.asset");
|
|
SkillEffect shieldEffect = AssetDatabase.LoadAssetAtPath<SkillEffect>("Assets/_Game/Data/Skills/Effects/Data_SkillEffect_Player_보호막_0_보호막.asset");
|
|
|
|
CreateOrUpdateGemAsset(
|
|
CrushGemPath,
|
|
"파쇄",
|
|
"고위력 기술의 단일 피해를 강화하는 테스트용 젬",
|
|
1.15f,
|
|
1.1f,
|
|
damageEffect);
|
|
|
|
CreateOrUpdateGemAsset(
|
|
ChallengerGemPath,
|
|
"도전자",
|
|
"고위력 기술에 위협 선점 기능을 얹는 테스트용 젬",
|
|
1f,
|
|
1f,
|
|
tauntEffect);
|
|
|
|
CreateOrUpdateGemAsset(
|
|
GuardianGemPath,
|
|
"수호",
|
|
"고위력 기술에 보호막 보조를 얹는 테스트용 젬",
|
|
1.05f,
|
|
1.1f,
|
|
shieldEffect);
|
|
|
|
AssetDatabase.SaveAssets();
|
|
AssetDatabase.Refresh();
|
|
Debug.Log("[Debug] 테스트용 젬 자산 생성/갱신 완료");
|
|
}
|
|
|
|
[MenuItem("Tools/Colosseum/Setup/Create or Update Test Loadout Presets")]
|
|
public static void CreateOrUpdateTestLoadoutPresets()
|
|
{
|
|
EnsureFolder("Assets/_Game/Data", "Loadouts");
|
|
|
|
CreateOrUpdateTestSkillGems();
|
|
|
|
SkillData slashSkill = AssetDatabase.LoadAssetAtPath<SkillData>(SlashSkillPath);
|
|
SkillData tauntSkill = AssetDatabase.LoadAssetAtPath<SkillData>(TauntSkillPath);
|
|
SkillData guardSkill = AssetDatabase.LoadAssetAtPath<SkillData>(GuardSkillPath);
|
|
SkillData dashSkill = AssetDatabase.LoadAssetAtPath<SkillData>(DashSkillPath);
|
|
SkillData ironWallSkill = AssetDatabase.LoadAssetAtPath<SkillData>(IronWallSkillPath);
|
|
SkillData pierceSkill = AssetDatabase.LoadAssetAtPath<SkillData>(PierceSkillPath);
|
|
SkillData gemTestSkill = AssetDatabase.LoadAssetAtPath<SkillData>(GemTestSkillPath);
|
|
SkillData healSkill = AssetDatabase.LoadAssetAtPath<SkillData>(HealSkillPath);
|
|
SkillData areaHealSkill = AssetDatabase.LoadAssetAtPath<SkillData>(AreaHealSkillPath);
|
|
SkillData shieldSkill = AssetDatabase.LoadAssetAtPath<SkillData>(ShieldSkillPath);
|
|
SkillData projectileSkill = AssetDatabase.LoadAssetAtPath<SkillData>(ProjectileSkillPath);
|
|
SkillData spinSkill = AssetDatabase.LoadAssetAtPath<SkillData>(SpinSkillPath);
|
|
SkillData evadeSkill = AssetDatabase.LoadAssetAtPath<SkillData>(EvadeSkillPath);
|
|
|
|
SkillGemData crushGem = AssetDatabase.LoadAssetAtPath<SkillGemData>(CrushGemPath);
|
|
SkillGemData challengerGem = AssetDatabase.LoadAssetAtPath<SkillGemData>(ChallengerGemPath);
|
|
SkillGemData guardianGem = AssetDatabase.LoadAssetAtPath<SkillGemData>(GuardianGemPath);
|
|
|
|
CreateOrUpdatePresetAsset(
|
|
TankGemPresetPath,
|
|
"탱커 젬 테스트",
|
|
"도전자 젬을 사용하는 탱커 검증 프리셋",
|
|
CreateLoadoutEntries(
|
|
CreateEntry(slashSkill),
|
|
CreateEntry(tauntSkill),
|
|
CreateEntry(guardSkill),
|
|
CreateEntry(dashSkill),
|
|
CreateEntry(ironWallSkill),
|
|
CreateEntry(gemTestSkill, challengerGem),
|
|
CreateEntry(evadeSkill)));
|
|
|
|
CreateOrUpdatePresetAsset(
|
|
SupportGemPresetPath,
|
|
"지원 젬 테스트",
|
|
"수호 젬을 사용하는 지원 검증 프리셋",
|
|
CreateLoadoutEntries(
|
|
CreateEntry(slashSkill),
|
|
CreateEntry(healSkill),
|
|
CreateEntry(areaHealSkill),
|
|
CreateEntry(shieldSkill),
|
|
CreateEntry(dashSkill),
|
|
CreateEntry(gemTestSkill, guardianGem),
|
|
CreateEntry(evadeSkill)));
|
|
|
|
CreateOrUpdatePresetAsset(
|
|
DpsGemPresetPath,
|
|
"딜러 젬 테스트",
|
|
"파쇄 젬을 사용하는 딜러 검증 프리셋",
|
|
CreateLoadoutEntries(
|
|
CreateEntry(slashSkill),
|
|
CreateEntry(pierceSkill),
|
|
CreateEntry(spinSkill),
|
|
CreateEntry(dashSkill),
|
|
CreateEntry(projectileSkill),
|
|
CreateEntry(gemTestSkill, crushGem),
|
|
CreateEntry(evadeSkill)));
|
|
|
|
AssetDatabase.SaveAssets();
|
|
AssetDatabase.Refresh();
|
|
Debug.Log("[Debug] 테스트용 젬 프리셋 생성/갱신 완료");
|
|
}
|
|
|
|
[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]);
|
|
SkillLoadoutEntry loadoutEntry = localSkillInput.GetSkillLoadout(slotOrder[i]);
|
|
builder.Append(slotNames[i]);
|
|
builder.Append(": ");
|
|
builder.Append(skill != null ? skill.SkillName : "(비어 있음)");
|
|
AppendGemSummary(builder, loadoutEntry);
|
|
|
|
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 AbnormalityManager FindBossAbnormalityManager()
|
|
{
|
|
BossEnemy activeBoss = BossEnemy.ActiveBoss;
|
|
if (activeBoss != null)
|
|
{
|
|
AbnormalityManager activeManager = activeBoss.GetComponent<AbnormalityManager>();
|
|
if (activeManager != null)
|
|
return activeManager;
|
|
}
|
|
|
|
BossEnemy bossEnemy = Object.FindFirstObjectByType<BossEnemy>();
|
|
return bossEnemy != null ? bossEnemy.GetComponent<AbnormalityManager>() : 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);
|
|
}
|
|
|
|
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} 프리셋을 적용했습니다.");
|
|
}
|
|
|
|
private static void ApplyLoadoutPreset(string presetPath, string presetLabel)
|
|
{
|
|
if (!EditorApplication.isPlaying)
|
|
{
|
|
Debug.LogWarning("[Debug] 플레이 모드에서만 사용할 수 있습니다.");
|
|
return;
|
|
}
|
|
|
|
PlayerSkillInput localSkillInput = FindLocalSkillInput();
|
|
if (localSkillInput == null)
|
|
{
|
|
Debug.LogWarning("[Debug] 로컬 PlayerSkillInput을 찾지 못했습니다.");
|
|
return;
|
|
}
|
|
|
|
PlayerLoadoutPreset preset = AssetDatabase.LoadAssetAtPath<PlayerLoadoutPreset>(presetPath);
|
|
if (preset == null)
|
|
{
|
|
Debug.LogWarning($"[Debug] 프리셋 에셋을 찾지 못했습니다: {presetPath}");
|
|
return;
|
|
}
|
|
|
|
localSkillInput.ApplyLoadoutPreset(preset);
|
|
Debug.Log($"[Debug] {presetLabel} 프리셋을 적용했습니다.");
|
|
}
|
|
|
|
private static void EnsureFolder(string parentFolder, string childFolderName)
|
|
{
|
|
string combined = $"{parentFolder}/{childFolderName}";
|
|
if (AssetDatabase.IsValidFolder(combined))
|
|
return;
|
|
|
|
AssetDatabase.CreateFolder(parentFolder, childFolderName);
|
|
}
|
|
|
|
private static SkillLoadoutEntry[] CreateLoadoutEntries(params SkillLoadoutEntry[] entries)
|
|
{
|
|
return entries;
|
|
}
|
|
|
|
private static SkillLoadoutEntry CreateEntry(SkillData skill, params SkillGemData[] gems)
|
|
{
|
|
SkillLoadoutEntry entry = SkillLoadoutEntry.CreateTemporary(skill);
|
|
if (gems == null)
|
|
return entry;
|
|
|
|
for (int i = 0; i < gems.Length; i++)
|
|
{
|
|
entry.SetGem(i, gems[i]);
|
|
}
|
|
|
|
return entry;
|
|
}
|
|
|
|
private static void CreateOrUpdateGemAsset(string assetPath, string gemName, string description, float manaCostMultiplier, float cooldownMultiplier, SkillEffect triggeredEffect)
|
|
{
|
|
SkillGemData gem = AssetDatabase.LoadAssetAtPath<SkillGemData>(assetPath);
|
|
if (gem == null)
|
|
{
|
|
if (AssetDatabase.LoadMainAssetAtPath(assetPath) != null)
|
|
{
|
|
AssetDatabase.DeleteAsset(assetPath);
|
|
}
|
|
|
|
gem = ScriptableObject.CreateInstance<SkillGemData>();
|
|
AssetDatabase.CreateAsset(gem, assetPath);
|
|
}
|
|
|
|
SerializedObject serializedGem = new SerializedObject(gem);
|
|
serializedGem.FindProperty("gemName").stringValue = gemName;
|
|
serializedGem.FindProperty("description").stringValue = description;
|
|
serializedGem.FindProperty("manaCostMultiplier").floatValue = manaCostMultiplier;
|
|
serializedGem.FindProperty("cooldownMultiplier").floatValue = cooldownMultiplier;
|
|
|
|
SerializedProperty castStartEffectsProperty = serializedGem.FindProperty("castStartEffects");
|
|
castStartEffectsProperty.arraySize = 0;
|
|
|
|
SerializedProperty triggeredEffectsProperty = serializedGem.FindProperty("triggeredEffects");
|
|
triggeredEffectsProperty.arraySize = triggeredEffect != null ? 1 : 0;
|
|
if (triggeredEffect != null)
|
|
{
|
|
SerializedProperty triggeredEntry = triggeredEffectsProperty.GetArrayElementAtIndex(0);
|
|
triggeredEntry.FindPropertyRelative("triggerIndex").intValue = 0;
|
|
|
|
SerializedProperty effectArray = triggeredEntry.FindPropertyRelative("effects");
|
|
effectArray.arraySize = 1;
|
|
effectArray.GetArrayElementAtIndex(0).objectReferenceValue = triggeredEffect;
|
|
}
|
|
|
|
serializedGem.ApplyModifiedPropertiesWithoutUndo();
|
|
EditorUtility.SetDirty(gem);
|
|
}
|
|
|
|
private static void CreateOrUpdatePresetAsset(string assetPath, string presetName, string description, IReadOnlyList<SkillLoadoutEntry> entries)
|
|
{
|
|
PlayerLoadoutPreset preset = AssetDatabase.LoadAssetAtPath<PlayerLoadoutPreset>(assetPath);
|
|
if (preset == null)
|
|
{
|
|
if (AssetDatabase.LoadMainAssetAtPath(assetPath) != null)
|
|
{
|
|
AssetDatabase.DeleteAsset(assetPath);
|
|
}
|
|
|
|
preset = ScriptableObject.CreateInstance<PlayerLoadoutPreset>();
|
|
AssetDatabase.CreateAsset(preset, assetPath);
|
|
}
|
|
|
|
SerializedObject serializedPreset = new SerializedObject(preset);
|
|
serializedPreset.FindProperty("presetName").stringValue = presetName;
|
|
serializedPreset.FindProperty("description").stringValue = description;
|
|
|
|
SerializedProperty slotsProperty = serializedPreset.FindProperty("slots");
|
|
slotsProperty.arraySize = entries != null ? entries.Count : 0;
|
|
|
|
for (int i = 0; i < slotsProperty.arraySize; i++)
|
|
{
|
|
SkillLoadoutEntry entry = entries[i] != null ? entries[i].CreateCopy() : new SkillLoadoutEntry();
|
|
SerializedProperty slotProperty = slotsProperty.GetArrayElementAtIndex(i);
|
|
slotProperty.FindPropertyRelative("baseSkill").objectReferenceValue = entry.BaseSkill;
|
|
|
|
SerializedProperty gemsProperty = slotProperty.FindPropertyRelative("socketedGems");
|
|
gemsProperty.arraySize = entry.SocketedGems.Count;
|
|
for (int j = 0; j < gemsProperty.arraySize; j++)
|
|
{
|
|
gemsProperty.GetArrayElementAtIndex(j).objectReferenceValue = entry.GetGem(j);
|
|
}
|
|
}
|
|
|
|
serializedPreset.ApplyModifiedPropertiesWithoutUndo();
|
|
EditorUtility.SetDirty(preset);
|
|
}
|
|
|
|
private static void AppendGemSummary(StringBuilder builder, SkillLoadoutEntry loadoutEntry)
|
|
{
|
|
if (builder == null || loadoutEntry == null || loadoutEntry.SocketedGems == null)
|
|
return;
|
|
|
|
bool hasGem = false;
|
|
StringBuilder gemBuilder = new StringBuilder();
|
|
for (int i = 0; i < loadoutEntry.SocketedGems.Count; i++)
|
|
{
|
|
SkillGemData gem = loadoutEntry.SocketedGems[i];
|
|
if (gem == null)
|
|
continue;
|
|
|
|
if (hasGem)
|
|
gemBuilder.Append(", ");
|
|
|
|
gemBuilder.Append(gem.GemName);
|
|
hasGem = true;
|
|
}
|
|
|
|
if (!hasGem)
|
|
return;
|
|
|
|
builder.Append(" [");
|
|
builder.Append(gemBuilder);
|
|
builder.Append("]");
|
|
}
|
|
|
|
private static void CastOwnedPlayerSkillAsServer(ulong ownerClientId, int slotIndex)
|
|
{
|
|
if (!EditorApplication.isPlaying)
|
|
{
|
|
Debug.LogWarning("[Debug] 플레이 모드에서만 사용할 수 있습니다.");
|
|
return;
|
|
}
|
|
|
|
PlayerSkillInput playerSkillInput = FindPlayerSkillInputByOwner(ownerClientId);
|
|
if (playerSkillInput == null)
|
|
{
|
|
Debug.LogWarning($"[Debug] OwnerClientId={ownerClientId} 인 PlayerSkillInput을 찾지 못했습니다.");
|
|
return;
|
|
}
|
|
|
|
bool executed = playerSkillInput.DebugExecuteSkillAsServer(slotIndex);
|
|
Debug.Log($"[Debug] 원격 스킬 실행 요청 | OwnerClientId={ownerClientId} | Slot={slotIndex} | Success={executed}");
|
|
}
|
|
|
|
private static PlayerSkillInput FindPlayerSkillInputByOwner(ulong ownerClientId)
|
|
{
|
|
PlayerSkillInput[] skillInputs = Object.FindObjectsByType<PlayerSkillInput>(FindObjectsInactive.Exclude, FindObjectsSortMode.None);
|
|
for (int i = 0; i < skillInputs.Length; i++)
|
|
{
|
|
PlayerSkillInput skillInput = skillInputs[i];
|
|
if (skillInput != null && skillInput.OwnerClientId == ownerClientId)
|
|
return skillInput;
|
|
}
|
|
|
|
return null;
|
|
}
|
|
}
|
|
}
|