Пример #1
0
            /// <summary>
            /// Returns the hash code of the CloudMap parameters.
            /// </summary>
            /// <returns>The hash code of the CloudMap parameters.</returns>
            public override int GetHashCode()
            {
                int hash = GetBakingHashCode();

                unchecked
                {
                    hash = hash * 23 + tint.GetHashCode();
                    hash = hash * 23 + exposure.GetHashCode();

                    hash = hash * 23 + distortionMode.GetHashCode();
                    hash = hash * 23 + scrollDirection.GetHashCode();
                    hash = hash * 23 + scrollSpeed.GetHashCode();
                    hash = hash * 23 + flowmap.GetHashCode();

                    hash = hash * 23 + distortionMode.GetHashCode();

#if UNITY_EDITOR
                    // In the editor, we want to rebake the texture if the texture content is modified
                    if (flowmap.value != null)
                    {
                        hash = hash * 23 + flowmap.value.imageContentsHash.GetHashCode();
                    }
#endif
                }

                return(hash);
            }
Пример #2
0
            internal int GetBakingHashCode()
            {
                int hash = 0;

                unchecked
                {
                    hash = hash * 23 + cloudMap.GetHashCode();
                    hash = hash * 23 + opacityR.GetHashCode();
                    hash = hash * 23 + opacityG.GetHashCode();
                    hash = hash * 23 + opacityB.GetHashCode();
                    hash = hash * 23 + opacityA.GetHashCode();

                    hash = hash * 23 + rotation.GetHashCode();
                    hash = hash * 23 + castShadows.GetHashCode();

                    if (lighting.value)
                    {
                        hash = hash * 23 + lighting.GetHashCode();
                        hash = hash * 23 + steps.GetHashCode();
                        hash = hash * 23 + thickness.GetHashCode();
                    }

#if UNITY_EDITOR
                    // In the editor, we want to rebake the texture if the texture content is modified
                    if (cloudMap.value != null)
                    {
                        hash = hash * 23 + cloudMap.value.imageContentsHash.GetHashCode();
                    }
#endif
                }

                return(hash);
            }
Пример #3
0
        /// <summary>
        /// Returns the hash code of the HDRI sky parameters.
        /// </summary>
        /// <returns>The hash code of the HDRI sky parameters.</returns>
        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 = cloudMap.value != null ? hash * 23 + cloudMap.value.GetHashCode() : hash;
                hash = flowmap.value != null ? hash * 23 + flowmap.value.GetHashCode() : hash;
                hash = hash * 23 + enabled.value.GetHashCode();
                hash = hash * 23 + upperHemisphereOnly.value.GetHashCode();
                hash = hash * 23 + tint.value.GetHashCode();
                hash = hash * 23 + intensityMultiplier.value.GetHashCode();
                hash = hash * 23 + rotation.value.GetHashCode();
                hash = hash * 23 + enableDistortion.value.GetHashCode();
                hash = hash * 23 + procedural.value.GetHashCode();
                hash = hash * 23 + scrollDirection.value.GetHashCode();
                hash = hash * 23 + scrollSpeed.value.GetHashCode();

                hash = cloudMap.value != null ? hash * 23 + cloudMap.overrideState.GetHashCode() : hash;
                hash = flowmap.value != null ? hash * 23 + flowmap.overrideState.GetHashCode() : hash;
                hash = hash * 23 + enabled.overrideState.GetHashCode();
                hash = hash * 23 + upperHemisphereOnly.overrideState.GetHashCode();
                hash = hash * 23 + tint.overrideState.GetHashCode();
                hash = hash * 23 + intensityMultiplier.overrideState.GetHashCode();
                hash = hash * 23 + rotation.overrideState.GetHashCode();
                hash = hash * 23 + enableDistortion.overrideState.GetHashCode();
                hash = hash * 23 + procedural.overrideState.GetHashCode();
                hash = hash * 23 + scrollDirection.overrideState.GetHashCode();
                hash = hash * 23 + scrollSpeed.overrideState.GetHashCode();
#else
                hash = cloudMap.value != null ? hash * 23 + cloudMap.GetHashCode() : hash;
                hash = flowmap.value != null ? hash * 23 + flowmap.GetHashCode() : hash;
                hash = hash * 23 + enabled.GetHashCode();
                hash = hash * 23 + upperHemisphereOnly.GetHashCode();
                hash = hash * 23 + tint.GetHashCode();
                hash = hash * 23 + intensityMultiplier.GetHashCode();
                hash = hash * 23 + rotation.GetHashCode();
                hash = hash * 23 + enableDistortion.GetHashCode();
                hash = hash * 23 + procedural.GetHashCode();
                hash = hash * 23 + scrollDirection.GetHashCode();
                hash = hash * 23 + scrollSpeed.GetHashCode();
#endif
            }

            return(hash);
        }
Пример #4
0
        /// <summary>
        /// Returns the hash code of the HDRI sky parameters.
        /// </summary>
        /// <returns>The hash code of the HDRI sky parameters.</returns>
        public override int GetHashCode()
        {
            int hash = base.GetHashCode();

            unchecked
            {
                hash = hash * 23 + cloudMap.GetHashCode();
                hash = hash * 23 + flowmap.GetHashCode();
                hash = hash * 23 + enabled.GetHashCode();
                hash = hash * 23 + upperHemisphereOnly.GetHashCode();
                hash = hash * 23 + tint.GetHashCode();
                hash = hash * 23 + intensityMultiplier.GetHashCode();
                hash = hash * 23 + rotation.GetHashCode();
                hash = hash * 23 + enableDistortion.GetHashCode();
                hash = hash * 23 + procedural.GetHashCode();
                hash = hash * 23 + scrollDirection.GetHashCode();
                hash = hash * 23 + scrollSpeed.GetHashCode();
            }

            return(hash);
        }
Пример #5
0
        /// <summary>
        /// Returns the hash code of the HDRI sky parameters.
        /// </summary>
        /// <returns>The hash code of the HDRI sky parameters.</returns>
        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 = hdriSky.value != null ? hash * 23 + hdriSky.value.GetHashCode() : hash;
                hash = flowmap.value != null ? hash * 23 + flowmap.value.GetHashCode() : hash;
                hash = hash * 23 + enableDistortion.value.GetHashCode();
                hash = hash * 23 + procedural.value.GetHashCode();
                hash = hash * 23 + upperHemisphereOnly.value.GetHashCode();
                hash = hash * 23 + scrollDirection.value.GetHashCode();
                hash = hash * 23 + scrollSpeed.value.GetHashCode();

                hash = hash * 23 + enableBackplate.value.GetHashCode();
                hash = hash * 23 + backplateType.value.GetHashCode();
                hash = hash * 23 + groundLevel.value.GetHashCode();
                hash = hash * 23 + scale.value.GetHashCode();
                hash = hash * 23 + projectionDistance.value.GetHashCode();
                hash = hash * 23 + plateRotation.value.GetHashCode();
                hash = hash * 23 + plateTexRotation.value.GetHashCode();
                hash = hash * 23 + plateTexOffset.value.GetHashCode();
                hash = hash * 23 + blendAmount.value.GetHashCode();
                hash = hash * 23 + shadowTint.value.GetHashCode();
                hash = hash * 23 + pointLightShadow.value.GetHashCode();
                hash = hash * 23 + dirLightShadow.value.GetHashCode();
                hash = hash * 23 + rectLightShadow.value.GetHashCode();

                hash = hdriSky.value != null ? hash * 23 + hdriSky.overrideState.GetHashCode() : hash;
                hash = flowmap.value != null ? hash * 23 + flowmap.overrideState.GetHashCode() : hash;
                hash = hash * 23 + enableDistortion.overrideState.GetHashCode();
                hash = hash * 23 + procedural.overrideState.GetHashCode();
                hash = hash * 23 + upperHemisphereOnly.overrideState.GetHashCode();
                hash = hash * 23 + scrollDirection.overrideState.GetHashCode();
                hash = hash * 23 + scrollSpeed.overrideState.GetHashCode();

                hash = hash * 23 + enableBackplate.overrideState.GetHashCode();
                hash = hash * 23 + backplateType.overrideState.GetHashCode();
                hash = hash * 23 + groundLevel.overrideState.GetHashCode();
                hash = hash * 23 + scale.overrideState.GetHashCode();
                hash = hash * 23 + projectionDistance.overrideState.GetHashCode();
                hash = hash * 23 + plateRotation.overrideState.GetHashCode();
                hash = hash * 23 + plateTexRotation.overrideState.GetHashCode();
                hash = hash * 23 + plateTexOffset.overrideState.GetHashCode();
                hash = hash * 23 + blendAmount.overrideState.GetHashCode();
                hash = hash * 23 + shadowTint.overrideState.GetHashCode();
                hash = hash * 23 + pointLightShadow.overrideState.GetHashCode();
                hash = hash * 23 + dirLightShadow.overrideState.GetHashCode();
                hash = hash * 23 + rectLightShadow.overrideState.GetHashCode();
#else
                hash = hdriSky.value != null ? hash * 23 + hdriSky.GetHashCode() : hash;
                hash = flowmap.value != null ? hash * 23 + flowmap.GetHashCode() : hash;
                hash = hash * 23 + enableDistortion.GetHashCode();
                hash = hash * 23 + procedural.GetHashCode();
                hash = hash * 23 + upperHemisphereOnly.GetHashCode();
                hash = hash * 23 + scrollDirection.GetHashCode();
                hash = hash * 23 + scrollSpeed.GetHashCode();

                hash = hash * 23 + enableBackplate.GetHashCode();
                hash = hash * 23 + backplateType.GetHashCode();
                hash = hash * 23 + groundLevel.GetHashCode();
                hash = hash * 23 + scale.GetHashCode();
                hash = hash * 23 + projectionDistance.GetHashCode();
                hash = hash * 23 + plateRotation.GetHashCode();
                hash = hash * 23 + plateTexRotation.GetHashCode();
                hash = hash * 23 + plateTexOffset.GetHashCode();
                hash = hash * 23 + blendAmount.GetHashCode();
                hash = hash * 23 + shadowTint.GetHashCode();
                hash = hash * 23 + pointLightShadow.GetHashCode();
                hash = hash * 23 + dirLightShadow.GetHashCode();
                hash = hash * 23 + rectLightShadow.GetHashCode();
#endif
            }

            return(hash);
        }