Files
Test/Library/PackageCache/com.unity.render-pipelines.universal@ffe395a3a1d1/Editor/Tools/Project Auditor/DefaultVolumeProfileValidation.cs
T
2026-11-01 23:39:55 +02:00

32 lines
1.3 KiB
C#

using System.Collections.Generic;
using System.ComponentModel;
using Unity.ProjectAuditor.Editor;
using UnityEngine.Rendering;
using UnityEngine.Rendering.Universal;
namespace UnityEditor.Rendering.Universal.ProjectAuditor
{
[Category("Global Settings")]
class DefaultVolumeProfileAnalyzer : IRenderingSettingsAnalyzer
{
internal const string URP0202 = nameof(URP0202);
public Descriptor Descriptor { get; } = new Descriptor(
URP0202,
"URP: Default Volume Profile is not assigned",
Areas.Quality,
"The default Volume Profile is not assigned in Graphics Settings. Without a default volume profile, post-processing and other volume-based effects may not work correctly. This setting is configured in Project Settings > Graphics > URP.",
"Assign a default Volume Profile in Project Settings > Graphics > URP section"
);
public IEnumerable<RenderingSettingsIssue> EnumerateIssues()
{
var settings = GraphicsSettings.GetRenderPipelineSettings<URPDefaultVolumeProfileSettings>();
// If settings is null, we're not in URP or settings haven't been initialized
if (settings != null && settings.volumeProfile == null)
yield return new RenderingSettingsIssue(URP0202);
}
}
}