浏览代码

Added OnEnable/OnDisable on parameters for special cases

/feature-ReflectionProbeFit
Thomas 7 年前
当前提交
dc04bdc5
共有 2 个文件被更改,包括 22 次插入0 次删除
  1. 8
      ScriptableRenderPipeline/Core/Volume/VolumeComponent.cs
  2. 14
      ScriptableRenderPipeline/Core/Volume/VolumeParameter.cs

8
ScriptableRenderPipeline/Core/Volume/VolumeComponent.cs


.Select(t => (VolumeParameter)t.GetValue(this))
.ToList()
.AsReadOnly();
foreach (var parameter in parameters)
parameter.OnEnable();
if (parameters == null)
return;
foreach (var parameter in parameters)
parameter.OnDisable();
}
public void SetAllOverridesTo(bool state)

14
ScriptableRenderPipeline/Core/Volume/VolumeParameter.cs


internal abstract void SetValue(VolumeParameter parameter);
// This is used in case you need to access fields/properties that can't be accessed in the
// constructor of a ScriptableObject (VolumeParameter are generally declared and inited in
// a VolumeComponent which is a ScriptableObject). This will be called right after the
// VolumeComponent object has been constructed, thus allowing access to previously
// "forbidden" fields/properties.
protected internal virtual void OnEnable()
{
}
// Called when the parent VolumeComponent OnDisabled is called
protected internal virtual void OnDisable()
{
}
public static bool IsObjectParameter(Type type)
{
if (type.IsGenericType && type.GetGenericTypeDefinition() == typeof(ObjectParameter<>))

正在加载...
取消
保存