Project_WL/AgentScripts/WL789_Probe.cs

72 lines
4.3 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_Probe.cs — #789 공격 루트모션 재현 검증 (Play 전용 · 읽기 전용)
// unity command run_script --file AgentScripts/WL789_Probe.cs --entry WL789_Probe.Watch --args '[6.0]'
// unity command run_script --file AgentScripts/WL789_Probe.cs --entry WL789_Probe.Report
// 매 프레임 PC 위치·현재 클립을 기록해 클립별(공격 상태별) 전방 이동 최대치·순 이동을 낸다. AttackRootMotion 카운터도 함께.
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using UnityEngine;
public static class WL789_Probe
{
const string Out = "Screenshots_WL/combat5/p_wl789.txt";
class Host : MonoBehaviour
{
public IEnumerator Co(float seconds)
{
var sb = new StringBuilder();
var me = Object.FindObjectsByType<MyActor>(FindObjectsInactive.Exclude, FindObjectsSortMode.None).FirstOrDefault();
if (me == null) { Done(sb.AppendLine("MyActor none")); yield break; }
var anim = me.GetComponentInChildren<Animator>();
var rm = anim != null ? anim.GetComponent<WL.Combat.AttackRootMotion>() : null;
sb.AppendLine("AttackRootMotion attached=" + (rm != null) + " applyRootMotion=" + (anim != null ? anim.applyRootMotion.ToString() : "?")
+ " mode=" + (WL.Combat.WLCombatMotionSettings.Instance != null ? WL.Combat.WLCombatMotionSettings.Instance.attackMoveMode.ToString() : "?"));
int apply0 = WL.Combat.AttackRootMotion.ApplyCount; float acc0 = WL.Combat.AttackRootMotion.SwingAccum; float raw0 = WL.Combat.AttackRootMotion.RawAccum;
string lastClip = ""; Vector3 segStart = me.transform.position; Vector3 segFwd = me.transform.forward; float segMaxFwd = 0f; float segT0 = Time.time;
var rows = new List<string>();
float t0 = Time.time;
while (Time.time - t0 < seconds)
{
string clip = "(none)";
if (anim != null && anim.layerCount > 0) { var ci = anim.GetCurrentAnimatorClipInfo(0); if (ci.Length > 0) clip = ci[0].clip.name; }
Vector3 p = me.transform.position;
if (clip != lastClip)
{
if (lastClip != "")
{
Vector3 d = p - segStart; d.y = 0f;
rows.Add(string.Format("{0,-22} {1:F2}s 최대전방 {2:F2} m 순이동 {3:F2} m (전방성분 {4:F2})", lastClip, Time.time - segT0, segMaxFwd, d.magnitude, Vector3.Dot(d, segFwd)));
}
lastClip = clip; segStart = p; segFwd = me.transform.forward; segFwd.y = 0f; segFwd.Normalize(); segMaxFwd = 0f; segT0 = Time.time;
}
else
{
Vector3 d = p - segStart; d.y = 0f;
segMaxFwd = Mathf.Max(segMaxFwd, Vector3.Dot(d, segFwd));
}
yield return null;
}
sb.AppendLine("== 클립별 이동 (" + seconds + "s) ==");
foreach (var r in rows) sb.AppendLine(" " + r);
sb.AppendLine("AttackRootMotion applyCount=" + (WL.Combat.AttackRootMotion.ApplyCount - apply0) + " appliedAccum=" + (WL.Combat.AttackRootMotion.SwingAccum - acc0).ToString("F2") + " m rawAccum=" + (WL.Combat.AttackRootMotion.RawAccum - raw0).ToString("F2") + " m"
+ " | entry(OnAnimatorMove)=" + WL.Combat.AttackRootMotion.EntryCount + " applyRootMotion=" + (anim != null ? anim.applyRootMotion.ToString() : "?"));
sb.AppendLine("AttackStep count=" + WL.Combat.AttackStepDriver.StepCount + " lastInfo=" + WL.Combat.AttackStepDriver.LastInfo);
Done(sb);
}
void Done(StringBuilder sb) { System.IO.Directory.CreateDirectory(System.IO.Path.GetDirectoryName(Out)); System.IO.File.WriteAllText(Out, sb.ToString()); Destroy(gameObject); }
}
public static object Watch(float seconds)
{
if (!Application.isPlaying) return "not playing";
if (GameObject.Find("__wl789") != null) return "already running";
var h = new GameObject("__wl789").AddComponent<Host>();
h.StartCoroutine(h.Co(seconds));
return "started " + seconds + "s";
}
public static object Report() { return System.IO.File.Exists(Out) ? System.IO.File.ReadAllText(Out) : "(no report)"; }
}