// WL841_SwordArc.cs — 검기 행(SwingCalibration) 1개를 손으로 지정 (#841 · PD 「검 1타 검기 궤적이 칼 경로와 안 맞는다」) // 베이크 도구(WL828)는 Knight Attack1(내려베기)에서 6프레임 빠른 구간만 원으로 맞춰 머리 위 작은 원(pivot y 1.0 · 반지름 0.47)을 내놓았다. // 칼 경로(포즈 띠)에 맞춰 어깨 높이 수직면의 큰 호로 직접 적는다. 값은 인자(C45 · 코드 상수 아님). // unity command run_script --file AgentScripts/WL841_SwordArc.cs --entry WL841_SwordArc.Set --args '[10101, "Effect_Slash_10101_1", "0.05,0.62,0.05", "1,0,0", "0,0.75,-0.66", 165, 0.62, 0.28, "wl841 manual"]' // 인자: classId · clipName(행 키) · pivot(x,y,z 로컬) · planeNormal · startDir · sweepDeg · tipRadius · hiltRadius · source 메모 using System.Globalization; using UnityEditor; using UnityEngine; using WL.Combat; public static class WL841_SwordArc { static Vector3 V(string s) { var p = s.Split(','); return new Vector3(float.Parse(p[0], CultureInfo.InvariantCulture), float.Parse(p[1], CultureInfo.InvariantCulture), float.Parse(p[2], CultureInfo.InvariantCulture)); } public static string Set(int classId, string clipName, string pivot, string normal, string startDir, float sweepDeg, float tipR, float hiltR, string note) { if (EditorApplication.isPlaying) return "skipped: playing"; var settings = SlashTrailSettings.Instance; if (settings == null) return "SlashTrailSettings 없음"; SwingCalibration row = null; foreach (var r in settings.swingCalibrations) if (r != null && r.classId == classId && r.clipName == clipName) { row = r; break; } if (row == null) return "행 없음 " + classId + " " + clipName; string before = "pivot=" + row.pivot.ToString("F3") + " normal=" + row.planeNormal.ToString("F2") + " start=" + row.startDir.ToString("F2") + " sweep=" + row.sweepDeg.ToString("F1") + " tipR=" + row.tipRadius.ToString("F3") + " hiltR=" + row.hiltRadius.ToString("F3") + " src=" + row.source; row.kind = SwingKind.Swing; row.pivot = V(pivot); row.planeNormal = V(normal).normalized; row.startDir = V(startDir).normalized; row.sweepDeg = sweepDeg; row.tipRadius = tipR; row.hiltRadius = hiltR; row.quality = 1f; row.source = note + " " + System.DateTime.Now.ToString("yyyy-MM-dd HH:mm") + " (수동 · 이전: " + before + ")"; EditorUtility.SetDirty(settings); AssetDatabase.SaveAssets(); return "set " + classId + " " + clipName + " · 이전 " + before; } public static string Show(int classId, string clipName) { var settings = SlashTrailSettings.Instance; if (settings == null) return "SlashTrailSettings 없음"; foreach (var r in settings.swingCalibrations) if (r != null && r.classId == classId && r.clipName == clipName) return "pivot=" + r.pivot.ToString("F3") + " normal=" + r.planeNormal.ToString("F2") + " bisector=" + r.bisector.ToString("F2") + " start=" + r.startDir.ToString("F2") + " sweep=" + r.sweepDeg.ToString("F1") + " tipR=" + r.tipRadius.ToString("F3") + " hiltR=" + r.hiltRadius.ToString("F3") + " kind=" + r.kind + " src=" + r.source; return "행 없음"; } }