42 lines
2.0 KiB
C#
42 lines
2.0 KiB
C#
// ─────────────────────────────────────────────────────────────────────────────
|
|
// NullMaterialGuardRunner.cs — 빈 머티리얼 슬롯 가드 틱 러너(숨은 오브젝트 1개 · 코루틴 0)
|
|
//
|
|
// PD 지시 #813 · 발주서 WL-813m3 §1-4
|
|
//
|
|
// · SO 가 꺼져 있으면 **오브젝트를 만들지 않는다**(C8: 꺼짐 = 흔적 0).
|
|
// · unscaled 시간으로 돈다 — 사망 중 세계 정지(timeScale 0)에도 결과창 위 마젠타를 잡아야 한다(Q9 §6 ④).
|
|
// · 기존 WLReactionRunner 를 건드리지 않는다(이번 발주 = Reaction 에 **새 파일만**).
|
|
//
|
|
// 🔴 어셈블리 주의: Assets/WL/Combat/ 에 .asmdef 를 만들지 말 것.
|
|
// ─────────────────────────────────────────────────────────────────────────────
|
|
|
|
using UnityEngine;
|
|
|
|
namespace WL.Combat.Reaction
|
|
{
|
|
/// <summary>NullMaterialGuard 전용 러너. DontDestroyOnLoad · Update 1개.</summary>
|
|
public sealed class NullMaterialGuardRunner : MonoBehaviour
|
|
{
|
|
static NullMaterialGuardRunner s_runner;
|
|
|
|
public static bool Exists { get { return s_runner != null; } }
|
|
|
|
public static void Ensure()
|
|
{
|
|
if (s_runner != null) return;
|
|
if (!Application.isPlaying) return;
|
|
var go = new GameObject("__WLNullMaterialGuard");
|
|
DontDestroyOnLoad(go);
|
|
s_runner = go.AddComponent<NullMaterialGuardRunner>();
|
|
}
|
|
|
|
void Update() { NullMaterialGuard.Tick(Time.unscaledTime); }
|
|
|
|
[RuntimeInitializeOnLoadMethod(RuntimeInitializeLoadType.AfterSceneLoad)]
|
|
static void Boot()
|
|
{
|
|
if (WLNullMaterialSettings.Enabled) Ensure(); // 꺼져 있으면 오브젝트 0(C8)
|
|
}
|
|
}
|
|
}
|