feat: 젬 테스트 경로 및 보스 기절 디버그 추가
- 다중 젬 슬롯용 타입을 별도 스크립트로 분리하고 테스트 젬/로드아웃 자산 생성 경로를 정리 - 젬 테스트 전용 공격 스킬과 분리된 애니메이션 자산을 추가해 베이스 스킬 검증 경로를 마련 - PlayerSkillDebugMenu와 MPP 디버그 메뉴를 보강해 젬 프리셋 적용, 원격 테스트, 보스 기절 디버그 메뉴를 추가 - BossCombatBehaviorContext와 공통 BT 액션이 기절 상태를 존중하도록 수정해 보스 추적과 패턴 실행을 중단 - Unity 리프레시와 외부 빌드 통과를 확인하고 드로그전 및 MPP 기준 젬 프리셋 적용 흐름을 검증
This commit is contained in:
356
Assets/_Game/Scripts/Editor/MultiplayerPlayModeDebugMenu.cs
Normal file
356
Assets/_Game/Scripts/Editor/MultiplayerPlayModeDebugMenu.cs
Normal file
@@ -0,0 +1,356 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Reflection;
|
||||
using System.Text;
|
||||
using System.IO;
|
||||
using Process = System.Diagnostics.Process;
|
||||
|
||||
using UnityEditor;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Colosseum.Editor
|
||||
{
|
||||
/// <summary>
|
||||
/// Multiplayer Play Mode 관련 상태와 리플렉션 정보를 점검하는 디버그 메뉴입니다.
|
||||
/// </summary>
|
||||
public static class MultiplayerPlayModeDebugMenu
|
||||
{
|
||||
private const string MultiplayerManagerAssetPath = "ProjectSettings/MultiplayerManager.asset";
|
||||
private const string DiagnosticsDirectory = "Temp/MPP";
|
||||
private const string VirtualProjectsRoot = "Library/VP";
|
||||
|
||||
[MenuItem("Tools/Colosseum/Multiplayer/Log Play Mode Module Types")]
|
||||
private static void LogPlayModeModuleTypes()
|
||||
{
|
||||
Assembly playModeAssembly = typeof(UnityEditor.PlayModeStateChange).Assembly;
|
||||
Type[] types = playModeAssembly
|
||||
.GetTypes()
|
||||
.Where(type => type.FullName != null &&
|
||||
(type.FullName.Contains("PlayMode", StringComparison.OrdinalIgnoreCase) ||
|
||||
type.FullName.Contains("Scenario", StringComparison.OrdinalIgnoreCase) ||
|
||||
type.FullName.Contains("Multiplayer", StringComparison.OrdinalIgnoreCase)))
|
||||
.OrderBy(type => type.FullName)
|
||||
.ToArray();
|
||||
|
||||
StringBuilder builder = new StringBuilder();
|
||||
builder.AppendLine("[MPP] PlayModeModule 타입 목록");
|
||||
for (int i = 0; i < types.Length; i++)
|
||||
{
|
||||
builder.Append("- ");
|
||||
builder.AppendLine(types[i].FullName);
|
||||
}
|
||||
|
||||
string diagnosticsPath = EnsureDiagnosticsFilePath("PlayModeModuleTypes.txt");
|
||||
File.WriteAllText(diagnosticsPath, builder.ToString(), Encoding.UTF8);
|
||||
Debug.Log($"[MPP] PlayModeModule 타입 목록을 저장했습니다. {diagnosticsPath}");
|
||||
}
|
||||
|
||||
[MenuItem("Tools/Colosseum/Multiplayer/Log Play Mode User Settings")]
|
||||
private static void LogPlayModeUserSettings()
|
||||
{
|
||||
Type settingsType = Type.GetType("Unity.PlayMode.Editor.PlayModeUserSettings, UnityEditor.PlayModeModule");
|
||||
if (settingsType == null)
|
||||
{
|
||||
Debug.LogWarning("[MPP] Unity.PlayMode.Editor.PlayModeUserSettings 타입을 찾지 못했습니다.");
|
||||
return;
|
||||
}
|
||||
|
||||
string diagnosticsPath = EnsureDiagnosticsFilePath("PlayModeUserSettings.txt");
|
||||
MethodInfo getOrCreateMethod = settingsType.GetMethod(
|
||||
"GetOrCreateSettings",
|
||||
BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic);
|
||||
|
||||
object settings = getOrCreateMethod?.Invoke(null, null);
|
||||
if (settings == null)
|
||||
{
|
||||
StringBuilder nullBuilder = new StringBuilder();
|
||||
nullBuilder.AppendLine("[MPP] PlayModeUserSettings 인스턴스를 가져오지 못했습니다.");
|
||||
nullBuilder.AppendLine($"Type: {settingsType.FullName}");
|
||||
nullBuilder.AppendLine("Static Members:");
|
||||
AppendStaticMembers(nullBuilder, settingsType);
|
||||
File.WriteAllText(diagnosticsPath, nullBuilder.ToString(), Encoding.UTF8);
|
||||
Debug.LogWarning($"[MPP] PlayModeUserSettings 인스턴스를 가져오지 못했습니다. 진단 파일: {diagnosticsPath}");
|
||||
return;
|
||||
}
|
||||
|
||||
StringBuilder builder = new StringBuilder();
|
||||
builder.AppendLine("[MPP] PlayModeUserSettings");
|
||||
AppendMembers(builder, settingsType, settings);
|
||||
AppendStaticMembers(builder, settingsType);
|
||||
File.WriteAllText(diagnosticsPath, builder.ToString(), Encoding.UTF8);
|
||||
Debug.Log($"[MPP] PlayModeUserSettings 정보를 저장했습니다. {diagnosticsPath}");
|
||||
}
|
||||
|
||||
[MenuItem("Tools/Colosseum/Multiplayer/Enable Local Deployment")]
|
||||
private static void EnableLocalDeployment()
|
||||
{
|
||||
SerializedObject multiplayerManager = GetMultiplayerManagerSerializedObject();
|
||||
if (multiplayerManager == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
SerializedProperty localDeployment = multiplayerManager.FindProperty("m_EnablePlayModeLocalDeployment");
|
||||
if (localDeployment == null)
|
||||
{
|
||||
Debug.LogWarning("[MPP] m_EnablePlayModeLocalDeployment 속성을 찾지 못했습니다.");
|
||||
return;
|
||||
}
|
||||
|
||||
localDeployment.intValue = 1;
|
||||
multiplayerManager.ApplyModifiedPropertiesWithoutUndo();
|
||||
AssetDatabase.SaveAssets();
|
||||
|
||||
Debug.Log("[MPP] 로컬 Play Mode 배포를 활성화했습니다.");
|
||||
}
|
||||
|
||||
[MenuItem("Tools/Colosseum/Multiplayer/Disable Local Deployment")]
|
||||
private static void DisableLocalDeployment()
|
||||
{
|
||||
SerializedObject multiplayerManager = GetMultiplayerManagerSerializedObject();
|
||||
if (multiplayerManager == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
SerializedProperty localDeployment = multiplayerManager.FindProperty("m_EnablePlayModeLocalDeployment");
|
||||
if (localDeployment == null)
|
||||
{
|
||||
Debug.LogWarning("[MPP] m_EnablePlayModeLocalDeployment 속성을 찾지 못했습니다.");
|
||||
return;
|
||||
}
|
||||
|
||||
localDeployment.intValue = 0;
|
||||
multiplayerManager.ApplyModifiedPropertiesWithoutUndo();
|
||||
AssetDatabase.SaveAssets();
|
||||
|
||||
Debug.Log("[MPP] 로컬 Play Mode 배포를 비활성화했습니다.");
|
||||
}
|
||||
|
||||
[MenuItem("Tools/Colosseum/Multiplayer/Log Multiplayer Manager Settings")]
|
||||
private static void LogMultiplayerManagerSettings()
|
||||
{
|
||||
SerializedObject multiplayerManager = GetMultiplayerManagerSerializedObject();
|
||||
if (multiplayerManager == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
SerializedProperty roles = multiplayerManager.FindProperty("m_EnableMultiplayerRoles");
|
||||
SerializedProperty localDeployment = multiplayerManager.FindProperty("m_EnablePlayModeLocalDeployment");
|
||||
SerializedProperty remoteDeployment = multiplayerManager.FindProperty("m_EnablePlayModeRemoteDeployment");
|
||||
|
||||
Debug.Log(
|
||||
$"[MPP] MultiplayerManager | Roles={roles?.intValue ?? -1} | " +
|
||||
$"LocalDeployment={localDeployment?.intValue ?? -1} | " +
|
||||
$"RemoteDeployment={remoteDeployment?.intValue ?? -1}");
|
||||
}
|
||||
|
||||
[MenuItem("Tools/Colosseum/Multiplayer/Log Virtual Player Clones")]
|
||||
private static void LogVirtualPlayerClones()
|
||||
{
|
||||
string[] cloneDirectories = GetVirtualPlayerCloneDirectories();
|
||||
if (cloneDirectories.Length == 0)
|
||||
{
|
||||
Debug.LogWarning("[MPP] Library/VP 아래에 가상 플레이어 복제본을 찾지 못했습니다.");
|
||||
return;
|
||||
}
|
||||
|
||||
StringBuilder builder = new StringBuilder();
|
||||
builder.AppendLine("[MPP] 가상 플레이어 복제본 목록");
|
||||
for (int i = 0; i < cloneDirectories.Length; i++)
|
||||
{
|
||||
builder.Append("- ");
|
||||
builder.AppendLine(Path.GetFullPath(cloneDirectories[i]));
|
||||
}
|
||||
|
||||
Debug.Log(builder.ToString());
|
||||
}
|
||||
|
||||
[MenuItem("Tools/Colosseum/Multiplayer/Launch First Virtual Player Clone")]
|
||||
private static void LaunchFirstVirtualPlayerClone()
|
||||
{
|
||||
string[] cloneDirectories = GetVirtualPlayerCloneDirectories();
|
||||
if (cloneDirectories.Length == 0)
|
||||
{
|
||||
Debug.LogWarning("[MPP] 실행할 가상 플레이어 복제본이 없습니다.");
|
||||
return;
|
||||
}
|
||||
|
||||
string cloneProjectPath = Path.GetFullPath(cloneDirectories[0]);
|
||||
Process.Start(new System.Diagnostics.ProcessStartInfo
|
||||
{
|
||||
FileName = EditorApplication.applicationPath,
|
||||
Arguments = $"-projectPath \"{cloneProjectPath}\"",
|
||||
UseShellExecute = true,
|
||||
});
|
||||
|
||||
Debug.Log($"[MPP] 가상 플레이어 복제본을 실행했습니다. {cloneProjectPath}");
|
||||
}
|
||||
|
||||
private static SerializedObject GetMultiplayerManagerSerializedObject()
|
||||
{
|
||||
UnityEngine.Object[] assets = AssetDatabase.LoadAllAssetsAtPath(MultiplayerManagerAssetPath);
|
||||
if (assets == null || assets.Length == 0 || assets[0] == null)
|
||||
{
|
||||
Debug.LogWarning("[MPP] MultiplayerManager.asset를 찾지 못했습니다.");
|
||||
return null;
|
||||
}
|
||||
|
||||
return new SerializedObject(assets[0]);
|
||||
}
|
||||
|
||||
private static void AppendMembers(StringBuilder builder, Type settingsType, object settings)
|
||||
{
|
||||
const BindingFlags flags = BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic;
|
||||
|
||||
List<PropertyInfo> properties = settingsType.GetProperties(flags)
|
||||
.Where(property => property.GetIndexParameters().Length == 0)
|
||||
.OrderBy(property => property.Name)
|
||||
.ToList();
|
||||
|
||||
for (int i = 0; i < properties.Count; i++)
|
||||
{
|
||||
PropertyInfo property = properties[i];
|
||||
object value = null;
|
||||
bool success = true;
|
||||
|
||||
try
|
||||
{
|
||||
value = property.GetValue(settings);
|
||||
}
|
||||
catch (Exception exception)
|
||||
{
|
||||
success = false;
|
||||
value = exception.GetType().Name;
|
||||
}
|
||||
|
||||
builder.Append("- Property ");
|
||||
builder.Append(property.Name);
|
||||
builder.Append(" = ");
|
||||
builder.AppendLine(success ? FormatValue(value) : $"<error: {value}>");
|
||||
}
|
||||
|
||||
List<FieldInfo> fields = settingsType.GetFields(flags)
|
||||
.OrderBy(field => field.Name)
|
||||
.ToList();
|
||||
|
||||
for (int i = 0; i < fields.Count; i++)
|
||||
{
|
||||
FieldInfo field = fields[i];
|
||||
object value = field.GetValue(settings);
|
||||
builder.Append("- Field ");
|
||||
builder.Append(field.Name);
|
||||
builder.Append(" = ");
|
||||
builder.AppendLine(FormatValue(value));
|
||||
}
|
||||
}
|
||||
|
||||
private static void AppendStaticMembers(StringBuilder builder, Type settingsType)
|
||||
{
|
||||
const BindingFlags flags = BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic;
|
||||
|
||||
List<PropertyInfo> properties = settingsType.GetProperties(flags)
|
||||
.Where(property => property.GetIndexParameters().Length == 0)
|
||||
.OrderBy(property => property.Name)
|
||||
.ToList();
|
||||
|
||||
for (int i = 0; i < properties.Count; i++)
|
||||
{
|
||||
PropertyInfo property = properties[i];
|
||||
object value = null;
|
||||
bool success = true;
|
||||
|
||||
try
|
||||
{
|
||||
value = property.GetValue(null);
|
||||
}
|
||||
catch (Exception exception)
|
||||
{
|
||||
success = false;
|
||||
value = exception.GetType().Name;
|
||||
}
|
||||
|
||||
builder.Append("- Static Property ");
|
||||
builder.Append(property.Name);
|
||||
builder.Append(" = ");
|
||||
builder.AppendLine(success ? FormatValue(value) : $"<error: {value}>");
|
||||
}
|
||||
|
||||
List<FieldInfo> fields = settingsType.GetFields(flags)
|
||||
.OrderBy(field => field.Name)
|
||||
.ToList();
|
||||
|
||||
for (int i = 0; i < fields.Count; i++)
|
||||
{
|
||||
FieldInfo field = fields[i];
|
||||
object value = field.GetValue(null);
|
||||
builder.Append("- Static Field ");
|
||||
builder.Append(field.Name);
|
||||
builder.Append(" = ");
|
||||
builder.AppendLine(FormatValue(value));
|
||||
}
|
||||
|
||||
List<MethodInfo> methods = settingsType.GetMethods(flags)
|
||||
.Where(method => !method.IsSpecialName)
|
||||
.OrderBy(method => method.Name)
|
||||
.ToList();
|
||||
|
||||
for (int i = 0; i < methods.Count; i++)
|
||||
{
|
||||
MethodInfo method = methods[i];
|
||||
string parameterSummary = string.Join(
|
||||
", ",
|
||||
method.GetParameters().Select(parameter => $"{parameter.ParameterType.Name} {parameter.Name}"));
|
||||
|
||||
builder.Append("- Static Method ");
|
||||
builder.Append(method.ReturnType.Name);
|
||||
builder.Append(' ');
|
||||
builder.Append(method.Name);
|
||||
builder.Append('(');
|
||||
builder.Append(parameterSummary);
|
||||
builder.AppendLine(")");
|
||||
}
|
||||
}
|
||||
|
||||
private static string EnsureDiagnosticsFilePath(string fileName)
|
||||
{
|
||||
Directory.CreateDirectory(DiagnosticsDirectory);
|
||||
return Path.Combine(DiagnosticsDirectory, fileName);
|
||||
}
|
||||
|
||||
private static string[] GetVirtualPlayerCloneDirectories()
|
||||
{
|
||||
if (!Directory.Exists(VirtualProjectsRoot))
|
||||
{
|
||||
return Array.Empty<string>();
|
||||
}
|
||||
|
||||
return Directory
|
||||
.GetDirectories(VirtualProjectsRoot, "mppm*")
|
||||
.OrderBy(path => path)
|
||||
.ToArray();
|
||||
}
|
||||
|
||||
private static string FormatValue(object value)
|
||||
{
|
||||
if (value == null)
|
||||
{
|
||||
return "null";
|
||||
}
|
||||
|
||||
if (value is string stringValue)
|
||||
{
|
||||
return stringValue;
|
||||
}
|
||||
|
||||
if (value is IEnumerable<object> enumerable)
|
||||
{
|
||||
return "[" + string.Join(", ", enumerable.Select(FormatValue)) + "]";
|
||||
}
|
||||
|
||||
return value.ToString();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: eb18c83f7c6efff429f59061e7f0b07b
|
||||
@@ -23,6 +23,7 @@ namespace Colosseum.Editor
|
||||
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";
|
||||
@@ -33,6 +34,14 @@ namespace Colosseum.Editor
|
||||
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()
|
||||
@@ -40,6 +49,12 @@ namespace Colosseum.Editor
|
||||
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()
|
||||
{
|
||||
@@ -52,6 +67,42 @@ namespace Colosseum.Editor
|
||||
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()
|
||||
{
|
||||
@@ -134,14 +185,14 @@ namespace Colosseum.Editor
|
||||
continue;
|
||||
|
||||
if (builder.Length > 0)
|
||||
builder.AppendLine().AppendLine();
|
||||
builder.Append(" || ");
|
||||
|
||||
builder.Append(enemy.name);
|
||||
builder.Append(" : ");
|
||||
builder.Append(enemy.GetThreatDebugSummary().Replace("\r\n", " | ").Replace("\n", " | "));
|
||||
}
|
||||
|
||||
Debug.Log($"[Debug] 보스 위협 요약\n{builder}");
|
||||
Debug.Log($"[Debug] 보스 위협 요약 | {builder}");
|
||||
}
|
||||
|
||||
[MenuItem("Tools/Colosseum/Debug/Apply Local Stun")]
|
||||
@@ -162,6 +213,33 @@ namespace Colosseum.Editor
|
||||
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()
|
||||
{
|
||||
@@ -223,6 +301,131 @@ namespace Colosseum.Editor
|
||||
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()
|
||||
{
|
||||
@@ -245,9 +448,11 @@ namespace Colosseum.Editor
|
||||
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(" | ");
|
||||
@@ -291,6 +496,20 @@ namespace Colosseum.Editor
|
||||
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)
|
||||
@@ -391,5 +610,197 @@ namespace Colosseum.Editor
|
||||
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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user