using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
namespace UnityEngine.Rendering
{
///
/// Exposes settings for shader variants
///
[Obsolete("Use GraphicsSettings.GetRenderPipelineSettings(). #from(23.3)")]
public interface IShaderVariantSettings
{
///
/// Specifies the level of the logging for shader variants
///
ShaderVariantLogLevel shaderVariantLogLevel { get; set; }
///
/// Specifies if the stripping of the shaders variants needs to be exported
///
bool exportShaderVariants { get; set; }
///
/// Controls whether debug display shaders for Rendering Debugger are available in Player builds.
///
bool stripDebugVariants { get => false; set { } }
}
public abstract partial class VolumeDebugSettings
{
static List s_ComponentTypes;
/// List of Volume component types.
[Obsolete("Please use volumeComponentsPathAndType instead, and get the second element of the tuple", false)]
public static List componentTypes
{
get
{
if (s_ComponentTypes == null)
{
s_ComponentTypes = VolumeManager.instance.baseComponentTypeArray
.Where(t => !t.IsDefined(typeof(HideInInspector), false))
.Where(t => !t.IsDefined(typeof(ObsoleteAttribute), false))
.OrderBy(t => ComponentDisplayName(t))
.ToList();
}
return s_ComponentTypes;
}
}
/// Returns the name of a component from its VolumeComponentMenuForRenderPipeline.
/// A volume component.
/// The component display name.
[Obsolete("Please use componentPathAndType instead, and get the first element of the tuple", false)]
public static string ComponentDisplayName(Type component)
{
if (component.GetCustomAttribute(typeof(VolumeComponentMenuForRenderPipeline), false) is VolumeComponentMenuForRenderPipeline volumeComponentMenuForRenderPipeline)
return volumeComponentMenuForRenderPipeline.menu;
if (component.GetCustomAttribute(typeof(VolumeComponentMenu), false) is VolumeComponentMenuForRenderPipeline volumeComponentMenu)
return volumeComponentMenu.menu;
return component.Name;
}
///
/// The list of the additional camera datas
///
[Obsolete("Cameras are auto registered/unregistered, use property cameras", false)]
protected static List additionalCameraDatas { get; private set; } = new List();
///
/// Register the camera for the Volume Debug.
///
/// The AdditionalCameraData of the camera to be registered.
[Obsolete("Cameras are auto registered/unregistered", false)]
public static void RegisterCamera(T additionalCamera)
{
if (!additionalCameraDatas.Contains(additionalCamera))
additionalCameraDatas.Add(additionalCamera);
}
///
/// Unregister the camera for the Volume Debug.
///
/// The AdditionalCameraData of the camera to be registered.
[Obsolete("Cameras are auto registered/unregistered", false)]
public static void UnRegisterCamera(T additionalCamera)
{
if (additionalCameraDatas.Contains(additionalCamera))
additionalCameraDatas.Remove(additionalCamera);
}
}
public sealed partial class DebugManager
{
///
/// Toggle the debug window.
///
/// State of the debug window.
[Obsolete("Use DebugManager.instance.displayEditorUI property instead. #from(23.1)")]
public void ToggleEditorUI(bool open) => editorUIState.open = open;
}
///
/// A marker to adjust probes in an area of the scene.
///
[Obsolete("ProbeTouchupVolume has been deprecated (UnityUpgradable) -> ProbeAdjustmentVolume", false)]
public class ProbeTouchupVolume : ProbeAdjustmentVolume
{
}
public sealed partial class VolumeManager
{
///
/// Registers a new Volume in the manager. Unity does this automatically when a new Volume is
/// enabled, or its layer changes, but you can use this function to force-register a Volume
/// that is currently disabled.
///
/// The volume to register.
/// The LayerMask that this volume is in.
///
[Obsolete("Please use the Register without a given layer index #from(6000.0)", false)]
public void Register(Volume volume, int layer)
{
if (volume.gameObject.layer != layer)
{
Debug.LogWarning($"Trying to register Volume {volume.name} on layer index {layer}, when the GameObject {volume.gameObject.name} is on layer index {volume.gameObject.layer}." +
$"{Environment.NewLine}The Volume Manager will respect the GameObject's layer.");
}
Register(volume);
}
///
/// Unregisters a Volume from the manager. Unity does this automatically when a Volume is
/// disabled or goes out of scope, but you can use this function to force-unregister a Volume
/// that you added manually while it was disabled.
///
/// The Volume to unregister.
/// The LayerMask that this volume is in.
///
[Obsolete("Please use the Register without a given layer index #from(6000.0)", false)]
public void Unregister(Volume volume, int layer)
{
if (volume.gameObject.layer != layer)
{
Debug.LogWarning($"Trying to unregister Volume {volume.name} on layer index {layer}, when the GameObject {volume.gameObject.name} is on layer index {volume.gameObject.layer}." +
$"{Environment.NewLine}The Volume Manager will respect the GameObject's layer.");
}
Unregister(volume);
}
}
}