Skip to content

Commit 00d83c2

Browse files
oleks-kEvergreen
authored andcommitted
DOCG-5914 added an extra null check, DOCG-5912 protected access for Dispose
DOCG-5914 added an extra null check, DOCG-5912 protected access for Dispose
1 parent d425aa6 commit 00d83c2

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

Packages/com.unity.render-pipelines.universal/Documentation~/renderer-features/scriptable-renderer-features/inject-a-pass-using-a-scriptable-renderer-feature.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,7 @@ public class MyRendererFeature : ScriptableRendererFeature
136136
{
137137
if (shader == null)
138138
{
139+
Debug.LogError("Ensure that you've set a shader in the Scriptable Renderer Feature.");
139140
return;
140141
}
141142
material = CoreUtils.CreateEngineMaterial(shader);
@@ -147,12 +148,13 @@ public class MyRendererFeature : ScriptableRendererFeature
147148
public override void AddRenderPasses(ScriptableRenderer renderer,
148149
ref RenderingData renderingData)
149150
{
150-
if (renderingData.cameraData.cameraType == CameraType.Game)
151+
if (redTintRenderPass != null &&
152+
renderingData.cameraData.cameraType == CameraType.Game)
151153
{
152154
renderer.EnqueuePass(redTintRenderPass);
153155
}
154156
}
155-
public override void Dispose(bool disposing)
157+
protected override void Dispose(bool disposing)
156158
{
157159
CoreUtils.Destroy(material);
158160
}

0 commit comments

Comments
 (0)