using System.Collections; using UnityEngine; using UnityEngine.Rendering; public class GlobalVolumeMgr : MonoBehaviourSingletonTemplate { public Volume m_Volume; public void Set(int index, float lifetime = 0f) { if (lifetime > 0f) StartCoroutine(Co_Off(lifetime)); } IEnumerator Co_Off(float lifetime) { m_Volume.enabled = true; yield return new WaitForSeconds(lifetime); m_Volume.enabled = false; Set(0); } }