22 lines
549 B
C#
22 lines
549 B
C#
using System.Collections;
|
|
using UnityEngine;
|
|
using UnityEngine.Rendering;
|
|
|
|
public class GlobalVolumeMgr : MonoBehaviourSingletonTemplate<GlobalVolumeMgr>
|
|
{
|
|
public VolumeProfile[] volumes; // 0 기본, 1 블라이든
|
|
public Volume m_Volume;
|
|
|
|
public void Set(int index, float lifetime = 0f)
|
|
{
|
|
m_Volume.profile = volumes[index];
|
|
if (lifetime > 0f)
|
|
StartCoroutine(Co_Off(lifetime));
|
|
}
|
|
|
|
IEnumerator Co_Off(float lifetime)
|
|
{
|
|
yield return new WaitForSeconds(lifetime);
|
|
Set(0);
|
|
}
|
|
} |