Exemplo n.º 1
0
            public static void DrawProjectionSettings(SerializedHDProbe serialized, Editor owner)
            {
                EditorGUILayout.PropertyField(serialized.proxyVolume, k_ProxyVolumeContent);

                if (serialized.target.proxyVolume == null)
                {
                    EditorGUI.BeginChangeCheck();
                    EditorGUILayout.PropertyField(serialized.probeSettings.proxyUseInfluenceVolumeAsProxyVolume);
                    if (EditorGUI.EndChangeCheck())
                    {
                        serialized.Apply();
                    }
                }

                if (serialized.proxyVolume.objectReferenceValue != null)
                {
                    var proxy = (ReflectionProxyVolumeComponent)serialized.proxyVolume.objectReferenceValue;
                    if (proxy.proxyVolume.shape != serialized.probeSettings.influence.shape.GetEnumValue <ProxyShape>() &&
                        proxy.proxyVolume.shape != ProxyShape.Infinite)
                    {
                        EditorGUILayout.HelpBox(
                            k_ProxyInfluenceShapeMismatchHelpBoxText,
                            MessageType.Error,
                            true
                            );
                    }
                }
                else
                {
                    EditorGUILayout.HelpBox(
                        serialized.probeSettings.proxyUseInfluenceVolumeAsProxyVolume.boolValue ? k_NoProxyHelpBoxText : k_NoProxyInfiniteHelpBoxText,
                        MessageType.Info,
                        true
                        );
                }

                // Don't display distanceBasedRoughness if the projection is infinite (as in this case we force distanceBasedRoughness to be 0 in code)
                if (owner is HDReflectionProbeEditor && !(serialized.proxyVolume.objectReferenceValue == null && serialized.probeSettings.proxyUseInfluenceVolumeAsProxyVolume.boolValue == false))
                {
                    EditorGUILayout.PropertyField(serialized.probeSettings.distanceBasedRoughness, EditorGUIUtility.TrTextContent("Distance Based Roughness", "When enabled, HDRP uses the assigned Proxy Volume to calculate distance based roughness for reflections. This produces more physically-accurate results if the Proxy Volume closely matches the environment."));
                }
            }
            public static void DrawProjectionSettings(SerializedHDProbe serialized, Editor owner)
            {
                EditorGUILayout.PropertyField(serialized.proxyVolume, k_ProxyVolumeContent);

                if (serialized.target.proxyVolume == null)
                {
                    EditorGUI.BeginChangeCheck();
                    EditorGUILayout.PropertyField(serialized.probeSettings.proxyUseInfluenceVolumeAsProxyVolume);
                    if (EditorGUI.EndChangeCheck())
                    {
                        serialized.Apply();
                    }
                }

                if (serialized.proxyVolume.objectReferenceValue != null)
                {
                    var proxy = (ReflectionProxyVolumeComponent)serialized.proxyVolume.objectReferenceValue;
                    if ((int)proxy.proxyVolume.shape != serialized.probeSettings.influence.shape.enumValueIndex &&
                        proxy.proxyVolume.shape != ProxyShape.Infinite)
                    {
                        EditorGUILayout.HelpBox(
                            k_ProxyInfluenceShapeMismatchHelpBoxText,
                            MessageType.Error,
                            true
                            );
                    }
                }
                else
                {
                    EditorGUILayout.HelpBox(
                        serialized.probeSettings.proxyUseInfluenceVolumeAsProxyVolume.boolValue ? k_NoProxyHelpBoxText : k_NoProxyInfiniteHelpBoxText,
                        MessageType.Info,
                        true
                        );
                }
            }