Project_WL/AgentScripts/WL785_Tune.cs

125 lines
5.5 KiB
C#
Raw Permalink 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
// WL785_Tune.cs — #785 리본 룩 실시간 튜닝 (Play 중 사용 · 에셋 인스턴스 메모리 수정)
// unity command run_script --file AgentScripts/WL785_Tune.cs --entry WL785_Tune.Set \
// --args '[intensity, headAlpha, midAlpha, edgeSoft, tailSoft, life, hold]'
// unity command run_script --file AgentScripts/WL785_Tune.cs --entry WL785_Tune.Show
//
// 왜 별도 스크립트인가: WL785_Setup 은 Play 중이면 중단하도록 막아 뒀다(에셋 집행용).
// 이건 "보면서 값을 고르는" 용도라 Play 중에만 의미가 있다. 고른 값은 Play 를 멈춘 뒤
// WL785_Setup.ApplySettings 의 기본값에 반영해 디스크에 굽는다(SOT 는 에셋 · C45).
using System.Text;
using UnityEditor;
using UnityEngine;
public static class WL785_Tune
{
const string MatPath = "Assets/WL/Combat/Materials/M_WL_BladeRibbon.mat";
public static object Set(float intensity, float headAlpha, float midAlpha,
float edgeSoft, float tailSoft, float life, float hold)
{
var s = WL.Combat.SlashTrailSettings.Instance;
if (s == null) return "SlashTrailSettings.Instance null (Play 중이어야 한다)";
s.colorIntensity = intensity;
s.fadeSeconds = life;
s.fadeHoldRatio = hold;
var g = new Gradient();
g.SetKeys(
new[]
{
new GradientColorKey(new Color(0.42f, 0.16f, 0.90f), 0.00f),
new GradientColorKey(new Color(0.20f, 0.45f, 1.00f), 0.32f),
new GradientColorKey(new Color(1.00f, 0.52f, 0.14f), 0.72f),
new GradientColorKey(new Color(1.00f, 0.85f, 0.42f), 1.00f),
},
new[]
{
new GradientAlphaKey(0.00f, 0.00f),
new GradientAlphaKey(midAlpha, 0.28f),
new GradientAlphaKey(headAlpha, 0.70f),
new GradientAlphaKey(headAlpha, 1.00f),
});
s.gradientAlongSwing = g;
var mat = s.materialAdditive != null ? s.materialAdditive : AssetDatabase.LoadAssetAtPath<Material>(MatPath);
if (mat != null)
{
mat.SetFloat("_EdgeSoftness", edgeSoft);
mat.SetFloat("_TailSoftness", tailSoft);
}
return Show();
}
/// <summary>
/// 색 축 비중과 알파 곡선을 함께 조정한다.
/// bladeW 가 0.5 면 잔상축(꼬리 보라)과 칼날축(안쪽 주황)을 반반 섞는데,
/// 보라와 노랑을 반반 섞으면 회색이 된다(실측 — 리본이 흰색으로 보이던 원인).
/// 그래서 칼날축을 주(0.75~1.0)로 두고 잔상축은 꼬리 색조만 얹는 쪽이 참고 이미지에 가깝다.
/// </summary>
public static object Look(float intensity, float bladeW, float aMid, float aHead,
float edgeSoft, float tailSoft, float hold)
{
var s = WL.Combat.SlashTrailSettings.Instance;
if (s == null) return "settings null";
s.colorIntensity = intensity;
s.bladeGradientWeight = bladeW;
s.fadeHoldRatio = hold;
var g = new Gradient();
g.SetKeys(
new[]
{
new GradientColorKey(new Color(0.42f, 0.16f, 0.90f), 0.00f),
new GradientColorKey(new Color(0.20f, 0.45f, 1.00f), 0.32f),
new GradientColorKey(new Color(1.00f, 0.52f, 0.14f), 0.72f),
new GradientColorKey(new Color(1.00f, 0.85f, 0.42f), 1.00f),
},
new[]
{
new GradientAlphaKey(0.00f, 0.00f),
new GradientAlphaKey(aMid, 0.18f),
new GradientAlphaKey(aHead, 0.55f),
new GradientAlphaKey(aHead, 1.00f),
});
s.gradientAlongSwing = g;
var mat = s.materialAdditive;
if (mat != null)
{
mat.SetFloat("_EdgeSoftness", edgeSoft);
mat.SetFloat("_TailSoftness", tailSoft);
mat.SetFloat("_Intensity", 1f);
}
return Show();
}
/// <summary>블렌드 모드만 바꾼다. 1/10 = 프리멀티 알파, 1/1 = 순수 가산.</summary>
public static object Blend(int src, int dst)
{
var s = WL.Combat.SlashTrailSettings.Instance;
var mat = s != null && s.materialAdditive != null ? s.materialAdditive : AssetDatabase.LoadAssetAtPath<Material>(MatPath);
if (mat == null) return "material null";
mat.SetFloat("_SrcBlend", src);
mat.SetFloat("_DstBlend", dst);
return "blend src=" + src + " dst=" + dst;
}
public static object Show()
{
var s = WL.Combat.SlashTrailSettings.Instance;
if (s == null) return "settings null";
var mat = s.materialAdditive;
var sb = new StringBuilder();
sb.AppendLine("intensity=" + s.colorIntensity + " life=" + s.fadeSeconds + " hold=" + s.fadeHoldRatio +
" bladeW=" + s.bladeGradientWeight + " width=" + s.widthScale + " tailW=" + s.tailWidthRatio);
if (mat != null)
sb.AppendLine("mat edge=" + mat.GetFloat("_EdgeSoftness") + " head=" + mat.GetFloat("_HeadSoftness") +
" tail=" + mat.GetFloat("_TailSoftness") + " intens=" + mat.GetFloat("_Intensity") +
" src=" + mat.GetFloat("_SrcBlend") + " dst=" + mat.GetFloat("_DstBlend"));
for (float t = 0f; t <= 1.001f; t += 0.25f)
sb.AppendLine(" swing t=" + t.ToString("0.00") + " -> " + s.gradientAlongSwing.Evaluate(t));
return sb.ToString();
}
}