您最多选择25个主题
主题必须以中文或者字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符
59 行
1.6 KiB
59 行
1.6 KiB
using System.Collections.Generic;
|
|
using UnityEngine.Scripting.APIUpdating;
|
|
|
|
namespace UnityEngine.Rendering.Universal
|
|
{
|
|
/// <summary>
|
|
/// Class <c>ScriptableRendererData</c> contains resources for a <c>ScriptableRenderer</c>.
|
|
/// <seealso cref="ScriptableRenderer"/>
|
|
/// </summary>
|
|
[MovedFrom("UnityEngine.Rendering.LWRP")] public abstract class ScriptableRendererData : ScriptableObject
|
|
{
|
|
internal bool isInvalidated { get; set; }
|
|
|
|
/// <summary>
|
|
/// Creates the instance of the ScriptableRenderer.
|
|
/// </summary>
|
|
/// <returns>The instance of ScriptableRenderer</returns>
|
|
protected abstract ScriptableRenderer Create();
|
|
|
|
[SerializeField] List<ScriptableRendererFeature> m_RendererFeatures = new List<ScriptableRendererFeature>(10);
|
|
|
|
/// <summary>
|
|
/// List of additional render pass features for this renderer.
|
|
/// </summary>
|
|
public List<ScriptableRendererFeature> rendererFeatures
|
|
{
|
|
get => m_RendererFeatures;
|
|
}
|
|
|
|
internal ScriptableRenderer InternalCreateRenderer()
|
|
{
|
|
isInvalidated = false;
|
|
return Create();
|
|
}
|
|
|
|
protected virtual void OnValidate()
|
|
{
|
|
isInvalidated = true;
|
|
}
|
|
|
|
protected virtual void OnEnable()
|
|
{
|
|
isInvalidated = true;
|
|
}
|
|
|
|
#if UNITY_EDITOR
|
|
internal virtual Material GetDefaultMaterial(DefaultMaterialType materialType)
|
|
{
|
|
return null;
|
|
}
|
|
|
|
internal virtual Shader GetDefaultShader()
|
|
{
|
|
return null;
|
|
}
|
|
#endif
|
|
}
|
|
}
|
|
|