study/first_study/Library/PackageCache/com.unity.render-pipelines.universal@d10049dfa479/Runtime/Settings/URPReflectionProbeSettings.cs
jh04010421 739d49f1a0 Unity | 2026.01.20
수업 실습 파일
2026-01-20 11:01:57 +09:00

54 lines
2.1 KiB
C#

using System;
#if UNITY_EDITOR
using UnityEditor;
using UnityEditor.Rendering.Universal;
#endif
using UnityEngine.Rendering.Universal;
namespace UnityEngine.Rendering
{
/// <summary>
/// ReflectionProbe global settings class.
/// </summary>
[Serializable]
[SupportedOnRenderPipeline(typeof(UniversalRenderPipelineAsset))]
[Categorization.CategoryInfo(Name = "Lighting", Order = 21)]
public class URPReflectionProbeSettings : IRenderPipelineGraphicsSettings
{
[SerializeField, HideInInspector] private int version = 1;
int IRenderPipelineGraphicsSettings.version => version;
[SerializeField, Tooltip("Use ReflectionProbe rotation. Enabling this will improve the appearance of reflections when the ReflectionProbe isn't axis aligned, but may worsen performance on lower end platforms.")]
private bool useReflectionProbeRotation = true;
/// <summary>
/// Whether to take ReflectionProbe rotation into account when rendering.
/// </summary>
public bool UseReflectionProbeRotation
{
get
{
#if UNITY_EDITOR
var mode = useReflectionProbeRotation ? SupportedRenderingFeatures.ReflectionProbeModes.Rotation : SupportedRenderingFeatures.ReflectionProbeModes.None;
if (mode != SupportedRenderingFeatures.active.reflectionProbeModes)
{
SupportedRenderingFeatures.active.reflectionProbeModes = mode;
}
#endif
return useReflectionProbeRotation;
}
#if UNITY_EDITOR
internal set
{
this.SetValueAndNotify(ref useReflectionProbeRotation, value, nameof(useReflectionProbeRotation));
if (QualitySettings.renderPipeline is UniversalRenderPipelineAsset urpAsset)
{
SupportedRenderingFeatures.active.reflectionProbeModes = value ? SupportedRenderingFeatures.ReflectionProbeModes.Rotation : SupportedRenderingFeatures.ReflectionProbeModes.None;
}
}
#endif
}
}
}