No Description
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

Deprecated.cs 7.3KB

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