Rasagar/Library/PackageCache/com.unity.render-pipelines.universal/Runtime/Debug/UniversalRenderPipelineVolumeDebugSettings.cs

45 lines
1.5 KiB
C#
Raw Normal View History

2024-08-26 13:07:20 -07:00
namespace UnityEngine.Rendering.Universal
{
/// <summary>
/// Volume debug settings.
/// </summary>
public partial class UniversalRenderPipelineVolumeDebugSettings : VolumeDebugSettings<UniversalAdditionalCameraData>
{
/// <summary>Selected camera volume stack.</summary>
public override VolumeStack selectedCameraVolumeStack
{
get
{
Camera cam = selectedCamera;
if (cam == null)
return null;
var additionalCameraData = selectedCamera.GetComponent<UniversalAdditionalCameraData>();
if (additionalCameraData == null)
return null;
var stack = additionalCameraData.volumeStack;
if (stack != null)
return stack;
return VolumeManager.instance.stack;
}
}
/// <summary>Selected camera volume layer mask.</summary>
public override LayerMask selectedCameraLayerMask
{
get
{
if (selectedCamera != null && selectedCamera.TryGetComponent<UniversalAdditionalCameraData>(out var selectedAdditionalCameraData))
return selectedAdditionalCameraData.volumeLayerMask;
return 1; // "Default"
}
}
/// <summary>Selected camera volume position.</summary>
public override Vector3 selectedCameraPosition => selectedCamera != null ? selectedCamera.transform.position : Vector3.zero;
}
}