using UnityEngine; namespace EerieVillage.Skills.Effectors { /// /// PD 지시 2026-05-13 — fx GO 영역 unscaledTime 영역 자가 Destroy. /// Object.Destroy(go, t) 영역 second timer 영역 Time.timeScale 영향 영역 → timeScale=0 (LevelUp 등) 영역 호출 정지·잔존. /// 본 컴포넌트 = Update 영역 Time.unscaledTime 영역 lifetime check → 자가 Destroy. /// fxGo Instantiate 직후 AddComponent 영역 lifetime 설정. /// public class FxAutoDestroyUnscaled : MonoBehaviour { public float Lifetime = 5f; float _spawnTime; void Awake() { _spawnTime = Time.unscaledTime; } void Update() { if (Time.unscaledTime - _spawnTime >= Lifetime) { Destroy(gameObject); } } public static void Attach(GameObject go, float lifetime) { if (go == null) return; var c = go.GetComponent(); if (c == null) c = go.AddComponent(); c.Lifetime = Mathf.Max(0.1f, lifetime); } } }