Deprecated.cs 2.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. // This file should be used as a container for things on its
  2. // way to being deprecated and removed in future releases
  3. using System;
  4. using System.ComponentModel;
  5. using UnityEngine.Scripting.APIUpdating;
  6. namespace UnityEngine.Rendering.Universal
  7. {
  8. public abstract partial class ScriptableRenderPass
  9. {
  10. // This callback method will be removed. Please use OnCameraCleanup() instead.
  11. [EditorBrowsable(EditorBrowsableState.Never)]
  12. public virtual void FrameCleanup(CommandBuffer cmd) => OnCameraCleanup(cmd);
  13. }
  14. [Obsolete("This is obsolete, please use shadowCascadeCount instead.", false)]
  15. [MovedFrom("UnityEngine.Rendering.LWRP")] public enum ShadowCascadesOption
  16. {
  17. NoCascades,
  18. TwoCascades,
  19. FourCascades,
  20. }
  21. public partial class UniversalRenderPipelineAsset
  22. {
  23. #pragma warning disable 618 // Obsolete warning
  24. [Obsolete("This is obsolete, please use shadowCascadeCount instead.", false)]
  25. [SerializeField] ShadowCascadesOption m_ShadowCascades = ShadowCascadesOption.NoCascades;
  26. [Obsolete("This is obsolete, please use shadowCascadeCount instead.", false)]
  27. public ShadowCascadesOption shadowCascadeOption
  28. {
  29. get
  30. {
  31. return shadowCascadeCount switch
  32. {
  33. 1 => ShadowCascadesOption.NoCascades,
  34. 2 => ShadowCascadesOption.TwoCascades,
  35. 4 => ShadowCascadesOption.FourCascades,
  36. _ => throw new InvalidOperationException("Cascade count is not compatible with obsolete API, please use shadowCascadeCount instead.")
  37. };
  38. }
  39. set
  40. {
  41. switch (value)
  42. {
  43. case ShadowCascadesOption.NoCascades:
  44. shadowCascadeCount = 1;
  45. break;
  46. case ShadowCascadesOption.TwoCascades:
  47. shadowCascadeCount = 2;
  48. break;
  49. case ShadowCascadesOption.FourCascades:
  50. shadowCascadeCount = 4;
  51. break;
  52. default:
  53. throw new InvalidOperationException("Cascade count is not compatible with obsolete API, please use shadowCascadeCount instead.");
  54. }
  55. }
  56. }
  57. #pragma warning restore 618 // Obsolete warning
  58. }
  59. [MovedFrom("UnityEngine.Rendering.LWRP")]
  60. public abstract partial class ScriptableRenderer
  61. {
  62. // Deprecated in 10.x
  63. [Obsolete("cameraDepth has been renamed to cameraDepthTarget. (UnityUpgradable) -> cameraDepthTarget")]
  64. [EditorBrowsable(EditorBrowsableState.Never)]
  65. public RenderTargetIdentifier cameraDepth
  66. {
  67. get => m_CameraDepthTarget;
  68. }
  69. }
  70. }