您最多选择25个主题
主题必须以中文或者字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符
45 行
1.1 KiB
45 行
1.1 KiB
using System.Collections.Generic;
|
|
|
|
namespace UnityEngine.Experimental.Rendering.HDPipeline
|
|
{
|
|
public class DensityVolumeManager
|
|
{
|
|
static private DensityVolumeManager _instance = null;
|
|
private DensityVolumeManager()
|
|
{
|
|
volumes = new List<HomogeneousDensityVolume>();
|
|
}
|
|
|
|
public static DensityVolumeManager manager
|
|
{
|
|
get
|
|
{
|
|
if (_instance == null)
|
|
{
|
|
_instance = new DensityVolumeManager();
|
|
}
|
|
return _instance;
|
|
}
|
|
}
|
|
|
|
private List<HomogeneousDensityVolume> volumes = null;
|
|
|
|
public void RegisterVolume(HomogeneousDensityVolume volume)
|
|
{
|
|
volumes.Add(volume);
|
|
}
|
|
|
|
public void DeRegisterVolume(HomogeneousDensityVolume volume)
|
|
{
|
|
if (volumes.Contains(volume))
|
|
{
|
|
volumes.Remove(volume);
|
|
}
|
|
}
|
|
|
|
public HomogeneousDensityVolume[] GetAllVolumes()
|
|
{
|
|
return volumes.ToArray();
|
|
}
|
|
}
|
|
}
|