using System; using System.Collections.Generic; using UnityEngine; using UnityEngine.Rendering; namespace UnityEditor.Rendering { /// /// Callback method that will be called when the Global Preferences for Additional Properties is changed /// [AttributeUsage(AttributeTargets.Method, AllowMultiple = false, Inherited = false)] [Obsolete("This attribute is not handled anymore. Use Advanced Properties. #from(6000.0)", false)] public sealed class SetAdditionalPropertiesVisibilityAttribute : Attribute { } /// /// This attributes tells a class which type of /// it's an editor for. /// When you make a custom editor for a component, you need put this attribute on the editor /// class. /// /// [AttributeUsage(AttributeTargets.Class, AllowMultiple = false)] [Obsolete("VolumeComponentEditor property has been deprecated. Please use CustomEditor. #from(2022.2)")] public sealed class VolumeComponentEditorAttribute : CustomEditor { /// /// A type derived from . /// public readonly Type componentType; /// /// Creates a new instance. /// /// A type derived from public VolumeComponentEditorAttribute(Type componentType) : base(componentType, true) { this.componentType = componentType; } } /// /// Interface that should be used with [ScriptableRenderPipelineExtension(type))] attribute to dispatch ContextualMenu calls on the different SRPs /// /// This must be a component that require AdditionalData in your SRP [Obsolete("The menu items are handled automatically for components with the AdditionalComponentData attribute. #from(2022.2)", false)] public interface IRemoveAdditionalDataContextualMenu where T : Component { /// /// Remove the given component /// /// The component to remove /// Dependencies. void RemoveComponent(T component, IEnumerable dependencies); } public static partial class RenderPipelineGlobalSettingsUI { /// A collection of GUIContent for use in the inspector [Obsolete("Use ShaderStrippingSettings instead. #from(23.2).")] public static class Styles { /// /// Global label width /// public const int labelWidth = 250; /// /// Shader Stripping /// public static readonly GUIContent shaderStrippingSettingsLabel = EditorGUIUtility.TrTextContent("Shader Stripping", "Shader Stripping settings"); /// /// Shader Variant Log Level /// 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."); /// /// Export Shader Variants /// public static readonly GUIContent exportShaderVariantsLabel = EditorGUIUtility.TrTextContent("Export Shader Variants", "Controls whether to output shader variant information to a file."); /// /// Stripping Of Rendering Debugger Shader Variants is enabled /// 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."); } /// /// Draws the shader stripping settinsg /// /// The serialized global settings /// The owner editor /// Pass another drawer if you want to specify additional shader stripping settings [Obsolete("Use ShaderStrippingSettings instead. #from(23.2).")] public static void DrawShaderStrippingSettings(ISerializedRenderPipelineGlobalSettings serialized, Editor owner, CoreEditorDrawer.IDrawer additionalShaderStrippingSettings = null) { CoreEditorUtils.DrawSectionHeader(Styles.shaderStrippingSettingsLabel); var oldWidth = EditorGUIUtility.labelWidth; EditorGUIUtility.labelWidth = Styles.labelWidth; EditorGUILayout.Space(); using (new EditorGUI.IndentLevelScope()) { EditorGUILayout.PropertyField(serialized.shaderVariantLogLevel, Styles.shaderVariantLogLevelLabel); EditorGUILayout.PropertyField(serialized.exportShaderVariants, Styles.exportShaderVariantsLabel); EditorGUILayout.PropertyField(serialized.stripDebugVariants, Styles.stripRuntimeDebugShadersLabel); additionalShaderStrippingSettings?.Draw(serialized, owner); } EditorGUILayout.Space(); EditorGUIUtility.labelWidth = oldWidth; } } /// /// Public interface for handling a serialized object of /// [Obsolete("Use ShaderStrippingSettings instead. #from(23.2).")] public interface ISerializedRenderPipelineGlobalSettings { /// /// The /// SerializedObject serializedObject { get; } /// /// The shader variant log level /// SerializedProperty shaderVariantLogLevel { get; } /// /// If the shader variants needs to be exported /// SerializedProperty exportShaderVariants { get; } /// /// If the Runtime Rendering Debugger Debug Variants should be stripped /// SerializedProperty stripDebugVariants { get => null; } } public sealed partial class DefaultVolumeProfileEditor { /// /// Constructor /// /// Editor that displays the content of this class /// VolumeProfile to display [Obsolete("Use DefaultVolumeProfileEditor(VolumeProfile, SerializedObject) instead. #from(23.3)")] public DefaultVolumeProfileEditor(Editor baseEditor, VolumeProfile profile) { m_Profile = profile; m_TargetSerializedObject = baseEditor.serializedObject; } } }