using System; namespace UnityEngine.Rendering.HighDefinition { /// /// Gradient Sky Volume Component. /// This component setups gradient sky for rendering. /// [VolumeComponentMenu("Sky/Gradient Sky")] [SkyUniqueID((int)SkyType.Gradient)] [HelpURL(Documentation.baseURL + Documentation.version + Documentation.subURL + "Override-Gradient-Sky" + Documentation.endURL)] public class GradientSky : SkySettings { /// Top color of the gradient sky. [Tooltip("Specifies the color of the upper hemisphere of the sky.")] public ColorParameter top = new ColorParameter(Color.blue, true, false, true); /// Middle color of the gradient sky. [Tooltip("Specifies the color at the horizon.")] public ColorParameter middle = new ColorParameter(new Color(0.3f, 0.7f, 1f), true, false, true); /// Bottom color of the gradient sky. [Tooltip("Specifies the color of the lower hemisphere of the sky. This is below the horizon.")] public ColorParameter bottom = new ColorParameter(Color.white, true, false, true); /// Size of the horizon (middle color. [Tooltip("Sets the size of the horizon (Middle color).")] public FloatParameter gradientDiffusion = new FloatParameter(1); /// /// Returns the hash code of the gradient sky parameters. /// /// The hash code of the gradient sky parameters. public override int GetHashCode() { int hash = base.GetHashCode(); unchecked { #if UNITY_2019_3 // In 2019.3, when we call GetHashCode on a VolumeParameter it generate garbage (due to the boxing of the generic parameter) hash = hash * 23 + bottom.value.GetHashCode(); hash = hash * 23 + top.value.GetHashCode(); hash = hash * 23 + middle.value.GetHashCode(); hash = hash * 23 + gradientDiffusion.value.GetHashCode(); hash = hash * 23 + bottom.overrideState.GetHashCode(); hash = hash * 23 + top.overrideState.GetHashCode(); hash = hash * 23 + middle.overrideState.GetHashCode(); hash = hash * 23 + gradientDiffusion.overrideState.GetHashCode(); #else hash = hash * 23 + bottom.GetHashCode(); hash = hash * 23 + top.GetHashCode(); hash = hash * 23 + middle.GetHashCode(); hash = hash * 23 + gradientDiffusion.GetHashCode(); #endif } return hash; } /// /// Returns GradientSkyRenderer type. /// /// GradientSkyRenderer type. public override Type GetSkyRendererType() { return typeof(GradientSkyRenderer); } } }