Project_WL/AgentScripts/WL789_RootProbe.cs

71 lines
4.0 KiB
C#
Raw Normal View History

WL 리뉴얼 세션 2026-09-06~07 (#760~#800) — 전투·배경·UI·타격감 (조직 PD 로그 #746~#800 · 대화로그 §14~§24) - 전투: Knight@Attack1~3_S 3콤보(4 컨트롤러·클래스별 서브클립) · 타겟팅 4규칙(정면 우선·재타겟·즉시 공격·어그로 금지 · WLTargetingSettings) · 대쉬 후 공격(Stander@Chase_Start · DashDriver · 5 m · 사정거리+0.8 · 근거리 적 우선) · 공격 이동 FrameTable(발 접지 실측 표 · AttackRootMotion) · 충돌 반경/투사체 0.3 배(WLCollisionTuning) · 무적(임시)·펫 금지(WLGameplaySettings) - 검기: NamuFX Slash_B 배리언트 Effect_WLSwingArc 원 피팅 정합 배치 + 캘리브레이션(SlashArcMeasure · SlashTrailSettings) · 찌르기 Effect_WLStab 대기 · 램프 리본(BladeTrail · WL_BladeRibbon.shader · T_WL_BladeRibbonRamp) 보존(drawRibbon 0) - 타격감: Assets/WL/Feel(WLHitFeel · 히트스톱 0.03 · 셰이크 0.10 m · 몹 펀치 1.12 · Actor.Get_Damage 훅 1줄 · 원본 RealCamera 셰이크 결함 대체) - 배경/맵: LMHPOLY Demo_01~10 → WL_Nature01~10(프리팹·씬·NavMesh·스포너·BattleMapConfig) · 물(ToonWaterU) · 포스트 블룸 0.9/0.3 · 잔디(BruteForce·드레싱) 제거 · 마젠타 머티리얼 URP 변환 - UI: 세로 HUD(WL_HUD · 하단 5메뉴 폭 전체 · 채팅/전투 패드 숨김 · WLIngameUiOverride) · Title/TitleInfo 1080×1920 Expand + 배경 높이 fit(WLBackgroundFit) · 로딩 SortOrder_5(WLRawImageAspectSync · 초점표 8장) · Loading1~8 ASTC 6×6 - 도구: AgentScripts/*(LightProbe · WL_MapSwitch · WL760~WL800 프로브/집행/검증 · 상단 사용법 주석) · 에디터 락 프로토콜 파일(staging) - 제외(별도 커밋 예정): Assets/LMHPOLY(703 MB) · Assets/Feel(422 MB) · Assets/Shinabro(300 MB) — 에셋 스토어/구 WL 팩 원본 Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-09-06 23:24:25 +00:00
// WL789_RootProbe.cs — Knight 공격 클립의 루트 이동(RootT) 곡선 실측 (에디트 모드 · 읽기 전용)
// unity command run_script --file AgentScripts/WL789_RootProbe.cs --entry WL789_RootProbe.Dump --args '["Assets/Res_Addr/Animations/Animation/OneHand/Knight@Attack1_S.FBX"]'
// unity command run_script --file AgentScripts/WL789_RootProbe.cs --entry WL789_RootProbe.All
// 휴머노이드 클립의 RootT.x/y/z · RootQ 커브를 8등분 샘플로 출력한다(정규화 시간 · 미터). 이동 거리 = 시작→끝 XZ 변위.
using System.Linq;
using System.Text;
using UnityEditor;
using UnityEngine;
public static class WL789_RootProbe
{
static readonly string[] Paths =
{
"Assets/Res_Addr/Animations/Animation/OneHand/Knight@Attack1_S.FBX",
"Assets/Res_Addr/Animations/Animation/OneHand/Knight@Attack2_S.FBX",
"Assets/Res_Addr/Animations/Animation/OneHand/Knight@Attack3_S.FBX",
"Assets/Res_Addr/Animations/Animation/Common_PlatformAnim/Stander@Chase_Start.FBX",
"Assets/Res_Addr/Animations/Animation/Paladin/attack.FBX",
};
public static object All()
{
var sb = new StringBuilder();
foreach (var p in Paths) sb.Append(Dump(p));
return sb.ToString();
}
public static object Dump(string path)
{
var sb = new StringBuilder();
var clips = AssetDatabase.LoadAllAssetsAtPath(path).OfType<AnimationClip>().Where(c => !c.name.StartsWith("__preview")).ToArray();
sb.AppendLine("== " + path + " clips=" + clips.Length);
foreach (var clip in clips)
{
var bindings = AnimationUtility.GetCurveBindings(clip);
AnimationCurve rx = null, ry = null, rz = null;
foreach (var b in bindings)
{
if (b.propertyName == "RootT.x") rx = AnimationUtility.GetEditorCurve(clip, b);
else if (b.propertyName == "RootT.y") ry = AnimationUtility.GetEditorCurve(clip, b);
else if (b.propertyName == "RootT.z") rz = AnimationUtility.GetEditorCurve(clip, b);
}
sb.Append(" - " + clip.name + " len=" + clip.length.ToString("F3") + "s root=" + (rx != null && rz != null ? "yes" : "no")
+ " hasRootCurves=" + clip.hasRootCurves + " hasMotionCurves=" + clip.hasMotionCurves + " humanMotion=" + clip.humanMotion);
if (rx != null && rz != null)
{
float x0 = rx.Evaluate(0f), z0 = rz.Evaluate(0f);
float xe = rx.Evaluate(clip.length), ze = rz.Evaluate(clip.length);
sb.Append(" | XZ 변위 = " + Mathf.Sqrt((xe - x0) * (xe - x0) + (ze - z0) * (ze - z0)).ToString("F3") + " m (dx " + (xe - x0).ToString("F3") + ", dz " + (ze - z0).ToString("F3") + ")");
sb.AppendLine();
sb.Append(" n: ");
for (int i = 0; i <= 8; i++)
{
float t = clip.length * i / 8f;
float dx = rx.Evaluate(t) - x0, dz = rz.Evaluate(t) - z0;
sb.Append((i / 8f).ToString("F2") + "→" + Mathf.Sqrt(dx * dx + dz * dz).ToString("F2") + " ");
}
if (ry != null) sb.Append("| y " + ry.Evaluate(0f).ToString("F2") + "→max " + Enumerable.Range(0, 9).Max(i => ry.Evaluate(clip.length * i / 8f)).ToString("F2"));
}
sb.AppendLine();
}
var imp = AssetImporter.GetAtPath(path) as ModelImporter;
if (imp != null)
{
var c0 = imp.clipAnimations.Length > 0 ? imp.clipAnimations[0] : (imp.defaultClipAnimations.Length > 0 ? imp.defaultClipAnimations[0] : null);
if (c0 != null) sb.AppendLine(" importer clip0=" + c0.name + " lockRootPositionXZ=" + c0.lockRootPositionXZ + " keepOriginalPositionXZ=" + c0.keepOriginalPositionXZ + " lockRootHeightY=" + c0.lockRootHeightY + " keepOriginalPositionY=" + c0.keepOriginalPositionY + " lockRootRotation=" + c0.lockRootRotation);
}
return sb.ToString();
}
}