ThreeKingdomsSlingshot/Tools/build_orange_slash.cs

28 lines
2.0 KiB
C#
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

using UnityEditor;
using UnityEngine;
// 주창 대도 일섬 베기 사본(2026-11-12 PD 「검기 궤적 이펙트가 주창을 기준으로 적을 향해 발생되어야 하는데 뒤집혀서 발동」):
// Slash Collection Orange_Slash_1 의 베기 호(자식 eff)를 뿌리 기준으로 돌리고 옮겨 「호의 원 중심 = 원점 · 볼록한 쪽(호 가운데) = +X」로 맞춘 사본
// Resources/Fx/TKS_Fx_Sk_Orange_Slash_1 을 원본에서 다시 만든다 → 표 b_flat 1 이 +X 를 진행 방향으로 돌리면 볼록한 쪽이 적을 향함 ·
// f_fwd = −(반지름) 이면 원 중심이 시전자 쪽에 오고 호 꼭대기가 적에 닿음(휘두르는 사람을 중심으로 한 궤적).
// 실측(Tools/vfx_capture/strip.cs · 기울기 0 · 회전 없음 · 반높이 10 = 잘림 없음 · 가장 크게 그어지는 0.1초 · 2026-11-12): 호의 원 중심 (−0.3, 1.07) · 반지름 4.0 · 호가 걸친 각 60°~280° → 가운데 170°.
// 실행: unity command --project-path . script eval --file Tools/build_orange_slash.cs
string src = "Assets/VFX/EricWang/FX_Slash_Collection/Prefabs/Orange_Slash_1.prefab";
string outPath = "Assets/Resources/Fx/TKS_Fx_Sk_Orange_Slash_1.prefab";
Vector2 center = new Vector2(-0.3f, 1.07f);
const float Bulge = 170f;
var prefab = AssetDatabase.LoadAssetAtPath<GameObject>(src);
if (prefab == null) return "원본 없음 " + src;
var go = (GameObject)Object.Instantiate(prefab);
go.name = "TKS_Fx_Sk_Orange_Slash_1";
var eff = go.transform.Find("eff");
if (eff == null) { Object.DestroyImmediate(go); return "eff 층 없음"; }
var turn = Quaternion.Euler(0f, 0f, -Bulge);
Vector3 c = turn * new Vector3(center.x, center.y, 0f);
eff.localPosition = turn * eff.localPosition - c;
eff.localRotation = turn * eff.localRotation;
string msg = "베기 사본 → " + outPath + " · eff " + eff.localPosition.ToString("0.00") + " " + eff.localEulerAngles.ToString("0");
PrefabUtility.SaveAsPrefabAsset(go, outPath);
Object.DestroyImmediate(go);
AssetDatabase.SaveAssets();
return msg;