浏览代码

Added a way to check if a component is currently active in a given layer mask

/namespace
Thomas 7 年前
当前提交
15ea76d2
共有 1 个文件被更改,包括 23 次插入6 次删除
  1. 29
      ScriptableRenderPipeline/Core/Volume/VolumeManager.cs

29
ScriptableRenderPipeline/Core/Volume/VolumeManager.cs


// Look for existing cached layer masks and add it there if needed
foreach (var kvp in m_SortedVolumes)
{
var mask = kvp.Key;
if ((mask & (1 << layer)) != 0)
if ((kvp.Key & (1 << layer)) != 0)
kvp.Value.Add(volume);
}

foreach (var kvp in m_SortedVolumes)
{
var mask = kvp.Key;
if ((mask & (1 << layer)) == 0)
if ((kvp.Key & (1 << layer)) == 0)
}
public bool IsComponentActiveInMask<T>(LayerMask layerMask)
where T : VolumeComponent
{
int mask = layerMask.value;
foreach (var kvp in m_SortedVolumes)
{
if ((kvp.Key & mask) == 0)
continue;
foreach (var volume in kvp.Value)
{
T component;
if (volume.TryGet(out component) && component.active)
return true;
}
}
return false;
}
internal void SetLayerDirty(int layer)

正在加载...
取消
保存