82 lines
4.2 KiB
C#
82 lines
4.2 KiB
C#
// ─────────────────────────────────────────────────────────────────────────────
|
|
// WLCharacterPaletteSettings.cs — 팔레트 아틀라스 UV(도트) 되돌리기 스위치 (WL-814x)
|
|
//
|
|
// PD 지시 #814 · 발주서 WL-814x §4
|
|
//
|
|
// 🔴 enabled_ = 0 → 이 기능 전체 off = 814s + 814t 상태 100 %
|
|
// (814s 의 WLCharacterLookSettings 는 그대로 두고, 그 **뒤에** 얹는 별도 스위치다.
|
|
// 그래서 이 SO 를 꺼도 기존 되돌리기 동작이 조금도 바뀌지 않는다.)
|
|
//
|
|
// 무엇을 바꾸나 = 렌더러별로 ① 메시를 「팔레트 UV 복사본」으로 ② 머티리얼을 팔레트 머티리얼로.
|
|
// 원본 FBX·원본 png·프리팹은 손대지 않는다 — 전부 런타임 교체다.
|
|
//
|
|
// 🔴 Debug.LogError / Debug.LogException 을 쓰지 않는다(813z 규칙).
|
|
// ─────────────────────────────────────────────────────────────────────────────
|
|
|
|
using UnityEngine;
|
|
|
|
namespace WL.Look.Character
|
|
{
|
|
public class WLCharacterPaletteSettings : ScriptableObject
|
|
{
|
|
[Header("스위치")]
|
|
[Tooltip("0 이면 이 기능 전체 off (= 814s+814t 상태 100 %)")]
|
|
public int enabled_ = 1;
|
|
|
|
[Tooltip("1 이면 적용 내역을 로그로 남긴다")]
|
|
public int verboseLog = 0;
|
|
|
|
[Header("렌더러별 표 (같은 인덱스끼리 짝)")]
|
|
[Tooltip("LH_M05 프리팹 안의 렌더러 GameObject 이름")]
|
|
public string[] rendererNames;
|
|
|
|
[Tooltip("팔레트 UV 메시 복사본 (비어 있으면 메시는 안 바꾼다 = 얼굴)")]
|
|
public Mesh[] paletteMeshes;
|
|
|
|
[Tooltip("팔레트 머티리얼")]
|
|
public Material[] paletteMaterials;
|
|
|
|
// ───────────────────────────────────────── 무기 (WL-816b · PD 「이 화풍으로 무기와 코스튬으로 넓히자」)
|
|
// 🔴 캐릭터 스위치(enabled_)와 **별개 스위치**다. 이 칸만 0 으로 두면 무기는 원본 100 %,
|
|
// 캐릭터는 814x 상태 그대로 남는다. enabled_ = 0 이면 무기도 함께 꺼진다(상위 스위치).
|
|
// 무기는 소켓에 **비동기로** 붙는다(`PCActor.Make_Weapon` = Addressables 콜백)이라
|
|
// `WLWeaponFitter` 의 소켓 스캔에 얹어서 새 인스턴스 1회만 갈아끼운다(814p 와 같은 자리).
|
|
[Header("무기 (WL-816b)")]
|
|
[Tooltip("0 이면 무기 팔레트만 off (= 무기 원본 100 % · 캐릭터는 그대로)")]
|
|
public int weaponEnabled_ = 1;
|
|
|
|
[Tooltip("무기 프리팹 이름 (Assets/Res_Addr/Weapon/<이름>.prefab · \"(Clone)\" 은 떼고 비교한다)")]
|
|
public string[] weaponNames;
|
|
|
|
[Tooltip("팔레트 UV 메시 복사본 (같은 인덱스)")]
|
|
public Mesh[] weaponMeshes;
|
|
|
|
[Tooltip("팔레트 머티리얼 (같은 인덱스)")]
|
|
public Material[] weaponMaterials;
|
|
|
|
public static bool WeaponEnabled { get { var c = Instance; return c != null && c.enabled_ != 0 && c.weaponEnabled_ != 0; } }
|
|
|
|
// ───────────────────────────────────────── 싱글턴(Resources)
|
|
public const string ResourcePath = "WL/WLCharacterPaletteSettings";
|
|
static WLCharacterPaletteSettings s_inst;
|
|
static bool s_tried;
|
|
|
|
public static WLCharacterPaletteSettings Instance
|
|
{
|
|
get
|
|
{
|
|
if (s_inst == null && !s_tried)
|
|
{
|
|
s_tried = true;
|
|
s_inst = Resources.Load<WLCharacterPaletteSettings>(ResourcePath);
|
|
}
|
|
return s_inst;
|
|
}
|
|
}
|
|
|
|
public static void Invalidate() { s_inst = null; s_tried = false; }
|
|
|
|
public static bool Enabled { get { var c = Instance; return c != null && c.enabled_ != 0; } }
|
|
}
|
|
}
|