59 lines
2.8 KiB
C#
59 lines
2.8 KiB
C#
using System.Collections.Generic;
|
|
using UnityEditor;
|
|
using UnityEngine;
|
|
// 황충 발동 마법진의 굵은 선 판(2026-11-11 PD 「황충 시전 이펙트가 화풍과 다르다고 느껴지는 이유 = 너무 샤프한 느낌의 선으로 구성 된 느낌」):
|
|
// 팩 HCFX_MagicCircle_02 사본의 고리 2겹(magic_circle_center · magic_circle_inner)만 굵고 둥근 3단 그림(Tools/bake_magic_circle_bold.py 가 구움 ·
|
|
// Assets/VFX/TKS2D/MagicCircleBold_04·02.png · G = 0 테 · 0.45 몸 · 1 심)으로 바꾼 사본 Resources/Fx/TKS_Fx_Sk_MagicCircle_Bold 을 만든다(움직임·크기·나머지 층은 원본 그대로).
|
|
// 실행: unity command --project-path . script eval --file Tools/build_magic_circle_bold.cs
|
|
string src = "Assets/Resources/Fx/TKS_Fx_Sk_HCFX_MagicCircle_02.prefab";
|
|
string dir = "Assets/VFX/TKS2D/";
|
|
string outPath = "Assets/Resources/Fx/TKS_Fx_Sk_MagicCircle_Bold.prefab";
|
|
const string TexProp = "Texture2D_F593E37E";
|
|
// 뿌리 층(네 귀퉁이 매듭 장식 + 십자 가시)은 PD 2026-11-11 「위 레이어는 제거해」 → 굽지 않음 · 표에서 그 층을 끔(s_off @root)
|
|
var map = new Dictionary<string, string> { { "magic_circle_center", "MagicCircleBold_04" }, { "magic_circle_inner", "MagicCircleBold_02" } };
|
|
AssetDatabase.Refresh();
|
|
foreach (var n in map.Values)
|
|
{
|
|
var ti = AssetImporter.GetAtPath(dir + n + ".png") as TextureImporter;
|
|
if (ti == null) return "그림 없음 " + n;
|
|
ti.textureType = TextureImporterType.Default;
|
|
ti.sRGBTexture = true;
|
|
ti.alphaIsTransparency = false;
|
|
ti.mipmapEnabled = true;
|
|
ti.wrapMode = TextureWrapMode.Clamp;
|
|
ti.filterMode = FilterMode.Bilinear;
|
|
ti.SaveAndReimport();
|
|
}
|
|
var prefab = AssetDatabase.LoadAssetAtPath<GameObject>(src);
|
|
if (prefab == null) return "원본 사본 없음 " + src;
|
|
var go = (GameObject)Object.Instantiate(prefab);
|
|
go.name = "TKS_Fx_Sk_MagicCircle_Bold";
|
|
int done = 0;
|
|
foreach (var rd in go.GetComponentsInChildren<ParticleSystemRenderer>(true))
|
|
{
|
|
string key = rd.transform == go.transform ? "@root" : rd.gameObject.name;
|
|
string texName;
|
|
if (!map.TryGetValue(key, out texName)) continue;
|
|
var tex = AssetDatabase.LoadAssetAtPath<Texture2D>(dir + texName + ".png");
|
|
string mpath = dir + "Mat_" + texName + ".mat";
|
|
var m = AssetDatabase.LoadAssetAtPath<Material>(mpath);
|
|
if (m == null)
|
|
{
|
|
m = new Material(rd.sharedMaterial);
|
|
AssetDatabase.CreateAsset(m, mpath);
|
|
}
|
|
else
|
|
{
|
|
m.shader = rd.sharedMaterial.shader;
|
|
m.CopyPropertiesFromMaterial(rd.sharedMaterial);
|
|
}
|
|
m.SetTexture(TexProp, tex);
|
|
EditorUtility.SetDirty(m);
|
|
rd.sharedMaterial = m;
|
|
done++;
|
|
}
|
|
PrefabUtility.SaveAsPrefabAsset(go, outPath);
|
|
Object.DestroyImmediate(go);
|
|
AssetDatabase.SaveAssets();
|
|
return "굵은 선 판 " + done + "겹 → " + outPath;
|