A game about forced loneliness, made by TACStudios
1using System; 2using System.Collections.Generic; 3using UnityEngine; 4using UnityEngine.Rendering; 5 6namespace UnityEditor.Rendering 7{ 8 /// <summary> 9 /// Callback method that will be called when the Global Preferences for Additional Properties is changed 10 /// </summary> 11 [AttributeUsage(AttributeTargets.Method, AllowMultiple = false, Inherited = false)] 12 [Obsolete("This attribute is not handled anymore. Use Advanced Properties. #from(6000.0)", false)] 13 public sealed class SetAdditionalPropertiesVisibilityAttribute : Attribute 14 { 15 } 16 17 /// <summary> 18 /// This attributes tells a <see cref="VolumeComponentEditor"/> class which type of 19 /// <see cref="VolumeComponent"/> it's an editor for. 20 /// When you make a custom editor for a component, you need put this attribute on the editor 21 /// class. 22 /// </summary> 23 /// <seealso cref="VolumeComponentEditor"/> 24 [AttributeUsage(AttributeTargets.Class, AllowMultiple = false)] 25 [Obsolete("VolumeComponentEditor property has been deprecated. Please use CustomEditor. #from(2022.2)")] 26 public sealed class VolumeComponentEditorAttribute : CustomEditor 27 { 28 /// <summary> 29 /// A type derived from <see cref="VolumeComponent"/>. 30 /// </summary> 31 public readonly Type componentType; 32 33 /// <summary> 34 /// Creates a new <see cref="VolumeComponentEditorAttribute"/> instance. 35 /// </summary> 36 /// <param name="componentType">A type derived from <see cref="VolumeComponent"/></param> 37 public VolumeComponentEditorAttribute(Type componentType) 38 : base(componentType, true) 39 { 40 this.componentType = componentType; 41 } 42 } 43 44 /// <summary> 45 /// Interface that should be used with [ScriptableRenderPipelineExtension(type))] attribute to dispatch ContextualMenu calls on the different SRPs 46 /// </summary> 47 /// <typeparam name="T">This must be a component that require AdditionalData in your SRP</typeparam> 48 [Obsolete("The menu items are handled automatically for components with the AdditionalComponentData attribute. #from(2022.2)", false)] 49 public interface IRemoveAdditionalDataContextualMenu<T> 50 where T : Component 51 { 52 /// <summary> 53 /// Remove the given component 54 /// </summary> 55 /// <param name="component">The component to remove</param> 56 /// <param name="dependencies">Dependencies.</param> 57 void RemoveComponent(T component, IEnumerable<Component> dependencies); 58 } 59 60 public static partial class RenderPipelineGlobalSettingsUI 61 { 62 /// <summary>A collection of GUIContent for use in the inspector</summary> 63 [Obsolete("Use ShaderStrippingSettings instead. #from(23.2).")] 64 public static class Styles 65 { 66 /// <summary> 67 /// Global label width 68 /// </summary> 69 public const int labelWidth = 250; 70 71 /// <summary> 72 /// Shader Stripping 73 /// </summary> 74 public static readonly GUIContent shaderStrippingSettingsLabel = EditorGUIUtility.TrTextContent("Shader Stripping", "Shader Stripping settings"); 75 76 /// <summary> 77 /// Shader Variant Log Level 78 /// </summary> 79 public static readonly GUIContent shaderVariantLogLevelLabel = EditorGUIUtility.TrTextContent("Shader Variant Log Level", "Controls the level of logging of shader variant information outputted during the build process. Information appears in the Unity Console when the build finishes."); 80 81 /// <summary> 82 /// Export Shader Variants 83 /// </summary> 84 public static readonly GUIContent exportShaderVariantsLabel = EditorGUIUtility.TrTextContent("Export Shader Variants", "Controls whether to output shader variant information to a file."); 85 86 /// <summary> 87 /// Stripping Of Rendering Debugger Shader Variants is enabled 88 /// </summary> 89 public static readonly GUIContent stripRuntimeDebugShadersLabel = EditorGUIUtility.TrTextContent("Strip Runtime Debug Shaders", "When enabled, all debug display shader variants are removed when you build for the Unity Player. This decreases build time, but disables some features of Rendering Debugger in Player builds."); 90 } 91 92 /// <summary> 93 /// Draws the shader stripping settinsg 94 /// </summary> 95 /// <param name="serialized">The serialized global settings</param> 96 /// <param name="owner">The owner editor</param> 97 /// <param name="additionalShaderStrippingSettings">Pass another drawer if you want to specify additional shader stripping settings</param> 98 [Obsolete("Use ShaderStrippingSettings instead. #from(23.2).")] 99 public static void DrawShaderStrippingSettings(ISerializedRenderPipelineGlobalSettings serialized, Editor owner, CoreEditorDrawer<ISerializedRenderPipelineGlobalSettings>.IDrawer additionalShaderStrippingSettings = null) 100 { 101 CoreEditorUtils.DrawSectionHeader(Styles.shaderStrippingSettingsLabel); 102 103 var oldWidth = EditorGUIUtility.labelWidth; 104 EditorGUIUtility.labelWidth = Styles.labelWidth; 105 106 EditorGUILayout.Space(); 107 using (new EditorGUI.IndentLevelScope()) 108 { 109 EditorGUILayout.PropertyField(serialized.shaderVariantLogLevel, Styles.shaderVariantLogLevelLabel); 110 EditorGUILayout.PropertyField(serialized.exportShaderVariants, Styles.exportShaderVariantsLabel); 111 EditorGUILayout.PropertyField(serialized.stripDebugVariants, Styles.stripRuntimeDebugShadersLabel); 112 113 additionalShaderStrippingSettings?.Draw(serialized, owner); 114 } 115 EditorGUILayout.Space(); 116 EditorGUIUtility.labelWidth = oldWidth; 117 } 118 } 119 120 /// <summary> 121 /// Public interface for handling a serialized object of <see cref="UnityEngine.Rendering.RenderPipelineGlobalSettings"/> 122 /// </summary> 123 [Obsolete("Use ShaderStrippingSettings instead. #from(23.2).")] 124 public interface ISerializedRenderPipelineGlobalSettings 125 { 126 /// <summary> 127 /// The <see cref="SerializedObject"/> 128 /// </summary> 129 SerializedObject serializedObject { get; } 130 131 /// <summary> 132 /// The shader variant log level 133 /// </summary> 134 SerializedProperty shaderVariantLogLevel { get; } 135 136 /// <summary> 137 /// If the shader variants needs to be exported 138 /// </summary> 139 SerializedProperty exportShaderVariants { get; } 140 141 /// <summary> 142 /// If the Runtime Rendering Debugger Debug Variants should be stripped 143 /// </summary> 144 SerializedProperty stripDebugVariants { get => null; } 145 } 146 147 public sealed partial class DefaultVolumeProfileEditor 148 { 149 /// <summary> 150 /// Constructor 151 /// </summary> 152 /// <param name="baseEditor">Editor that displays the content of this class</param> 153 /// <param name="profile">VolumeProfile to display</param> 154 [Obsolete("Use DefaultVolumeProfileEditor(VolumeProfile, SerializedObject) instead. #from(23.3)")] 155 public DefaultVolumeProfileEditor(Editor baseEditor, VolumeProfile profile) 156 { 157 m_Profile = profile; 158 m_TargetSerializedObject = baseEditor.serializedObject; 159 } 160 } 161}