43 lines
2.1 KiB
C#
43 lines
2.1 KiB
C#
// ─────────────────────────────────────────────────────────────────────────────
|
|
// EffectScaleGuardRunner.cs — 이펙트 크기 가드 틱 러너(숨은 오브젝트 1개 · 코루틴 0)
|
|
//
|
|
// PD 지시 #813 · 발주서 WL-811s §1-3
|
|
//
|
|
// · SO 가 꺼져 있으면 **오브젝트를 만들지 않는다**(C8: 꺼짐 = 흔적 0).
|
|
// · **LateUpdate** 로 돈다 — 원본 스폰(Update·코루틴) 뒤 · 렌더 앞이라 활성화된 그 프레임에 배율이 걸린다.
|
|
// · unscaled 시간으로 판정한다(히트스톱 timeScale 0 중에도 착탄 이펙트가 뜬다).
|
|
// · 기존 러너(811def WLReactionRunner · 813m3 NullMaterialGuardRunner)를 건드리지 않는다 = 병합 충돌 0.
|
|
//
|
|
// 🔴 어셈블리 주의: Assets/WL/Combat/ 에 .asmdef 를 만들지 말 것.
|
|
// ─────────────────────────────────────────────────────────────────────────────
|
|
|
|
using UnityEngine;
|
|
|
|
namespace WL.Combat.Reaction
|
|
{
|
|
/// <summary>EffectScaleGuard 전용 러너. DontDestroyOnLoad · LateUpdate 1개.</summary>
|
|
public sealed class EffectScaleGuardRunner : MonoBehaviour
|
|
{
|
|
static EffectScaleGuardRunner 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("__WLEffectScaleGuard");
|
|
DontDestroyOnLoad(go);
|
|
s_runner = go.AddComponent<EffectScaleGuardRunner>();
|
|
}
|
|
|
|
void LateUpdate() { EffectScaleGuard.Tick(Time.unscaledTime); }
|
|
|
|
[RuntimeInitializeOnLoadMethod(RuntimeInitializeLoadType.AfterSceneLoad)]
|
|
static void Boot()
|
|
{
|
|
if (WLEffectScaleSettings.Enabled) Ensure(); // 꺼져 있으면 오브젝트 0(C8)
|
|
}
|
|
}
|
|
}
|