Project_WL/Assets/Script/Ingame/GlobalVolumeMgr.cs

22 lines
509 B
C#

using System.Collections;
using UnityEngine;
using UnityEngine.Rendering;
public class GlobalVolumeMgr : MonoBehaviourSingletonTemplate<GlobalVolumeMgr>
{
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);
}
}