A game about forced loneliness, made by TACStudios
1using System; 2using System.Collections.Generic; 3using System.Linq; 4using System.Reflection; 5 6namespace UnityEngine.Rendering 7{ 8 /// <summary> 9 /// Exposes settings for shader variants 10 /// </summary> 11 [Obsolete("Use GraphicsSettings.GetRenderPipelineSettings<ShaderStrippingSetting>(). #from(23.3)")] 12 13 public interface IShaderVariantSettings 14 { 15 /// <summary> 16 /// Specifies the level of the logging for shader variants 17 /// </summary> 18 ShaderVariantLogLevel shaderVariantLogLevel { get; set; } 19 20 /// <summary> 21 /// Specifies if the stripping of the shaders variants needs to be exported 22 /// </summary> 23 bool exportShaderVariants { get; set; } 24 25 /// <summary> 26 /// Controls whether debug display shaders for Rendering Debugger are available in Player builds. 27 /// </summary> 28 bool stripDebugVariants { get => false; set { } } 29 } 30 31 public abstract partial class VolumeDebugSettings<T> 32 { 33 static List<Type> s_ComponentTypes; 34 /// <summary>List of Volume component types.</summary> 35 [Obsolete("Please use volumeComponentsPathAndType instead, and get the second element of the tuple", false)] 36 public static List<Type> componentTypes 37 { 38 get 39 { 40 if (s_ComponentTypes == null) 41 { 42 s_ComponentTypes = VolumeManager.instance.baseComponentTypeArray 43 .Where(t => !t.IsDefined(typeof(HideInInspector), false)) 44 .Where(t => !t.IsDefined(typeof(ObsoleteAttribute), false)) 45 .OrderBy(t => ComponentDisplayName(t)) 46 .ToList(); 47 } 48 return s_ComponentTypes; 49 } 50 } 51 52 /// <summary>Returns the name of a component from its VolumeComponentMenuForRenderPipeline.</summary> 53 /// <param name="component">A volume component.</param> 54 /// <returns>The component display name.</returns> 55 [Obsolete("Please use componentPathAndType instead, and get the first element of the tuple", false)] 56 public static string ComponentDisplayName(Type component) 57 { 58 if (component.GetCustomAttribute(typeof(VolumeComponentMenuForRenderPipeline), false) is VolumeComponentMenuForRenderPipeline volumeComponentMenuForRenderPipeline) 59 return volumeComponentMenuForRenderPipeline.menu; 60 61 if (component.GetCustomAttribute(typeof(VolumeComponentMenu), false) is VolumeComponentMenuForRenderPipeline volumeComponentMenu) 62 return volumeComponentMenu.menu; 63 64 return component.Name; 65 } 66 67 /// <summary> 68 /// The list of the additional camera datas 69 /// </summary> 70 [Obsolete("Cameras are auto registered/unregistered, use property cameras", false)] 71 protected static List<T> additionalCameraDatas { get; private set; } = new List<T>(); 72 73 /// <summary> 74 /// Register the camera for the Volume Debug. 75 /// </summary> 76 /// <param name="additionalCamera">The AdditionalCameraData of the camera to be registered.</param> 77 [Obsolete("Cameras are auto registered/unregistered", false)] 78 public static void RegisterCamera(T additionalCamera) 79 { 80 if (!additionalCameraDatas.Contains(additionalCamera)) 81 additionalCameraDatas.Add(additionalCamera); 82 } 83 84 /// <summary> 85 /// Unregister the camera for the Volume Debug. 86 /// </summary> 87 /// <param name="additionalCamera">The AdditionalCameraData of the camera to be registered.</param> 88 [Obsolete("Cameras are auto registered/unregistered", false)] 89 public static void UnRegisterCamera(T additionalCamera) 90 { 91 if (additionalCameraDatas.Contains(additionalCamera)) 92 additionalCameraDatas.Remove(additionalCamera); 93 } 94 } 95 96 public sealed partial class DebugManager 97 { 98 /// <summary> 99 /// Toggle the debug window. 100 /// </summary> 101 /// <param name="open">State of the debug window.</param> 102 [Obsolete("Use DebugManager.instance.displayEditorUI property instead. #from(23.1)")] 103 public void ToggleEditorUI(bool open) => editorUIState.open = open; 104 } 105 106 /// <summary> 107 /// A marker to adjust probes in an area of the scene. 108 /// </summary> 109 [Obsolete("ProbeTouchupVolume has been deprecated (UnityUpgradable) -> ProbeAdjustmentVolume", false)] 110 public class ProbeTouchupVolume : ProbeAdjustmentVolume 111 { 112 } 113 114 public sealed partial class VolumeManager 115 { 116 /// <summary> 117 /// Registers a new Volume in the manager. Unity does this automatically when a new Volume is 118 /// enabled, or its layer changes, but you can use this function to force-register a Volume 119 /// that is currently disabled. 120 /// </summary> 121 /// <param name="volume">The volume to register.</param> 122 /// <param name="layer">The LayerMask that this volume is in.</param> 123 /// <seealso cref="Unregister"/> 124 [Obsolete("Please use the Register without a given layer index #from(6000.0)", false)] 125 public void Register(Volume volume, int layer) 126 { 127 if (volume.gameObject.layer != layer) 128 { 129 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}." + 130 $"{Environment.NewLine}The Volume Manager will respect the GameObject's layer."); 131 } 132 133 Register(volume); 134 } 135 136 /// <summary> 137 /// Unregisters a Volume from the manager. Unity does this automatically when a Volume is 138 /// disabled or goes out of scope, but you can use this function to force-unregister a Volume 139 /// that you added manually while it was disabled. 140 /// </summary> 141 /// <param name="volume">The Volume to unregister.</param> 142 /// <param name="layer">The LayerMask that this volume is in.</param> 143 /// <seealso cref="Register"/> 144 [Obsolete("Please use the Register without a given layer index #from(6000.0)", false)] 145 public void Unregister(Volume volume, int layer) 146 { 147 if (volume.gameObject.layer != layer) 148 { 149 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}." + 150 $"{Environment.NewLine}The Volume Manager will respect the GameObject's layer."); 151 } 152 153 Unregister(volume); 154 } 155 } 156}