Thomas 7 年前
当前提交
73b7cf92
共有 1 个文件被更改,包括 4 次插入19 次删除
  1. 23
      ScriptableRenderPipeline/Core/CoreRP/Volume/VolumeManager.cs

23
ScriptableRenderPipeline/Core/CoreRP/Volume/VolumeManager.cs


public sealed class VolumeManager
{
//>>> System.Lazy<T> is broken in Unity (legacy runtime) so we'll have to do it ourselves :|
static volatile VolumeManager s_Instance;
static object s_LockObj = new UnityObject();
static readonly VolumeManager s_Instance = new VolumeManager();
public static VolumeManager instance { get { return s_Instance; } }
public static VolumeManager instance
{
get
{
// Double-lock checking
if (s_Instance == null)
{
lock (s_LockObj) // Lock on a separate object to avoid deadlocks
{
if (s_Instance == null)
s_Instance = new VolumeManager();
}
}
return s_Instance;
}
}
// Explicit static constructor to tell the C# compiler not to mark type as beforefieldinit
static VolumeManager() { }
//<<<
// Internal stack

正在加载...
取消
保存