Project_WL/Assets/Script/Ingame/GlobalVolumeMgr.cs

22 lines
509 B
C#
Raw Normal View History

2025-02-13 06:10:00 +00:00
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)
{
2025-05-14 05:01:30 +00:00
m_Volume.enabled = true;
2025-02-13 06:10:00 +00:00
yield return new WaitForSeconds(lifetime);
2025-05-14 05:01:30 +00:00
m_Volume.enabled = false;
2025-02-13 06:10:00 +00:00
Set(0);
}
}