ThreeKingdomsSlingshot/Tools/build_whirl_ring.cs

39 lines
2.5 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-13 PD 21차 「"Game VFX - Cartoon Skill Collection Vol.2(URP)" 에셋의 첨부한 예시와 같은 이펙트를 손상향에게 재생 · 이펙트와 함께 유닛을 한바퀴 회전」)
// TKS_Fx_C_WhirlRing = Vol.2 `FX_Whirlwind Slash` 의 앞부분(제자리에서 도는 회오리 = Slash03 묶음: 파란 고리 Rim·imp·Rot + 흰 베기 줄기 AX·Slash_b·aura_sl + 바닥 고리·방사 줄 floor_ring·floor_smoke)만 남긴 사본.
// 원본은 0.5초 뒤 옆(−2.6)으로 내려치는 마무리(ground2 묶음 = 물보라·돌·바닥 별)와 두 번째 베기(Slash04)가 이어지는데 PD 첨부 그림은 도는 고리 부분 → 그 둘과 0.5초 뒤의 큰 충격 호(aura01)는 지움.
// 층 이름이 묶음끼리 겹쳐(AX·Rim·imp·Slash_b·Glow2_b) 표의 s_off 로는 가를 수 없어 사본으로 만든다.
// 원점 = 회오리 가운데 바닥(원본은 고리 가운데가 원점에서 옆 0.25 · 바닥 고리가 아래 0.45).
// 실행: unity command --project-path . --timeout 300 script eval --file Tools/build_whirl_ring.cs
string src = "Assets/VFX/EricWang/Game VFX - Cartoon Skill Collection Vol2/Prefabs/FX_Whirlwind Slash.prefab";
string dst = "Assets/Resources/Fx/TKS_Fx_C_WhirlRing.prefab";
var shift = new Vector3(-0.25f, 0.45f, -0.15f); // 회오리 가운데 → 원점 · 바닥 고리 → 높이 0
var prefab = AssetDatabase.LoadAssetAtPath<GameObject>(src);
if (prefab == null) return "원본 없음: " + src;
var go = Object.Instantiate(prefab);
go.name = "TKS_Fx_C_WhirlRing";
var mid = go.transform.Find("Particle System");
if (mid == null) { Object.DestroyImmediate(go); return "Particle System 층 없음"; }
int cut = 0;
foreach (var n in new[] { "ground2", "Slash04", "Slash03/aura01" })
{
var t = mid.Find(n);
if (t == null) { Object.DestroyImmediate(go); return "층 없음: " + n; }
Object.DestroyImmediate(t.gameObject);
cut++;
}
mid.localPosition += shift;
// 껍데기 층(그리지 않는 반복 층)은 한 번만 — 사본이 스스로 되풀이되지 않게
foreach (var ps in go.GetComponentsInChildren<ParticleSystem>(true))
{
var m = ps.main;
if (m.loop && !ps.GetComponent<ParticleSystemRenderer>().enabled) m.loop = false;
}
int left = go.GetComponentsInChildren<ParticleSystemRenderer>(true).Length;
PrefabUtility.SaveAsPrefabAsset(go, dst);
Object.DestroyImmediate(go);
AssetDatabase.SaveAssets();
return "ok " + dst + " · 지운 묶음 " + cut + " · 남은 층 " + left;