Skip to content

Commit 20c0523

Browse files
amsXYZEvergreen
authored andcommitted
URP: Ensure ScriptableRendererFeatures are compiled before validating them.
This PR add an extra check to `ScriptableRendererData.OnValidate` to ensure we only validate `ScriptableRendererFeatures` when all scripts have been compiled. Not doing so can lead to errors being thrown to the console during import (see attached Jira ticket). Jira: https://jira.unity3d.com/browse/UUM-58944
1 parent 7ae738d commit 20c0523

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

Packages/com.unity.render-pipelines.universal/Runtime/ScriptableRendererData.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,9 @@ protected virtual void OnValidate()
5959
{
6060
SetDirty();
6161
#if UNITY_EDITOR
62-
if (m_RendererFeatures.Contains(null))
62+
// Only validate ScriptableRendererFeatures when all scripts have finished compiling (to avoid false-negatives
63+
// when ScriptableRendererFeatures haven't been compiled before this check).
64+
if (!EditorApplication.isCompiling && m_RendererFeatures.Contains(null))
6365
ValidateRendererFeatures();
6466
#endif
6567
}

0 commit comments

Comments
 (0)