Skip to content

Commit 227b911

Browse files
kirill-titov-uEvergreen
authored andcommitted
[RPW] Multiple fixes for the different Editors
https://jira.unity3d.com/browse/UUM-62739 https://jira.unity3d.com/browse/UUM-62751 https://jira.unity3d.com/browse/UUM-62981 UUM-62739 Fixes for the Volume Component. ⚠️ Only part 1 done. 2 and 3 should be ignored for the Testing ![image](https://media.github.cds.internal.unity3d.com/user/5932/files/4cb6d1e1-eb8b-4a50-8f7d-4e0579e8d049) UUM-62751 Fixed a tooltip for the Material UI. ![image](https://media.github.cds.internal.unity3d.com/user/5932/files/95cff8b2-2d21-4f0f-bbbb-c5d30dd4183e) UUM-62981 Removed not only 3 dots menu but also warning and error buttons which appear when there's an empty object field. Text box is still there and below the list.
1 parent 24ec974 commit 227b911

File tree

4 files changed

+17
-32
lines changed

4 files changed

+17
-32
lines changed

Packages/com.unity.render-pipelines.core/Editor/UXML/VolumeEditor.uxml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
<ui:UXML xmlns:ui="UnityEngine.UIElements" xmlns:uie="UnityEditor.UIElements" uib="Unity.UI.Builder" editor-extension-mode="True">
22
<Style src="project://database/Packages/com.unity.render-pipelines.core/Editor/StyleSheets/VolumeEditor.uss?fileID=7433441132597879392&amp;guid=cd410e8cdc0119a46a753f48e79c8d07&amp;type=3#VolumeEditor" />
3-
<ui:VisualElement name="collider-fixme-box__container"/>
43
<uie:PropertyField
54
binding-path="blendDistance"
65
name="volume-profile-blend-distance"
76
label="Blend Distance"
87
tooltip="Sets the outer distance to start blending from. A value of 0 means no blending and Unity applies the Volume overrides immediately upon entry." />
8+
<ui:VisualElement name="collider-fixme-box__container"/>
99
<uie:PropertyField
1010
binding-path="weight"
1111
label="Weight"

Packages/com.unity.render-pipelines.universal/Editor/ShaderGUI/BaseShaderGUI.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,7 @@ protected class Styles
226226
/// The text and tooltip for the render face GUI.
227227
/// </summary>
228228
public static readonly GUIContent cullingText = EditorGUIUtility.TrTextContent("Render Face",
229-
"Specifies which faces to cull from your geometry. Front culls front faces. Back culls backfaces. None means that both sides are rendered.");
229+
"Specifies which faces to cull from your geometry. Front culls front faces. Back culls back faces. Both means that both sides are rendered.");
230230

231231
/// <summary>
232232
/// The text and tooltip for the depth write GUI.

Packages/com.unity.render-pipelines.universal/Editor/UniversalRenderPipelineAssetEditor.cs

Lines changed: 14 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -75,42 +75,27 @@ void OnRemoveElement(ReorderableList reorderableList)
7575
void OnDrawElement(Rect rect, int index, bool isActive, bool isFocused)
7676
{
7777
rect.y += 2;
78-
Rect indexRect = new Rect(rect.x, rect.y, 14, EditorGUIUtility.singleLineHeight);
78+
var indexRect = new Rect(rect.x, rect.y, 14, EditorGUIUtility.singleLineHeight);
7979
EditorGUI.LabelField(indexRect, index.ToString());
80-
Rect objRect = new Rect(rect.x + indexRect.width, rect.y, rect.width - 134, EditorGUIUtility.singleLineHeight);
8180

82-
EditorGUI.BeginChangeCheck();
83-
EditorGUI.ObjectField(objRect, m_RendererDataProp.GetArrayElementAtIndex(index), GUIContent.none);
84-
if (EditorGUI.EndChangeCheck())
85-
EditorUtility.SetDirty(target);
86-
87-
Rect defaultButton = new Rect(rect.width - 75, rect.y, 86, EditorGUIUtility.singleLineHeight);
88-
var defaultRenderer = m_DefaultRendererProp.intValue;
89-
GUI.enabled = index != defaultRenderer;
90-
if (GUI.Button(defaultButton, !GUI.enabled ? Styles.rendererDefaultText : Styles.rendererSetDefaultText))
81+
using (var changeCheck = new EditorGUI.ChangeCheckScope())
9182
{
92-
m_DefaultRendererProp.intValue = index;
93-
EditorUtility.SetDirty(target);
83+
var objectFieldWidth = rect.width - 110;
84+
var objRect = new Rect(rect.x + indexRect.width, rect.y, objectFieldWidth, EditorGUIUtility.singleLineHeight);
85+
EditorGUI.ObjectField(objRect, m_RendererDataProp.GetArrayElementAtIndex(index), GUIContent.none);
86+
if (changeCheck.changed)
87+
EditorUtility.SetDirty(target);
9488
}
95-
GUI.enabled = true;
96-
97-
Rect selectRect = new Rect(rect.x + rect.width - 24, rect.y, 24, EditorGUIUtility.singleLineHeight);
9889

99-
UniversalRenderPipelineAsset asset = target as UniversalRenderPipelineAsset;
100-
101-
if (asset.ValidateRendererData(index))
102-
{
103-
if (GUI.Button(selectRect, Styles.rendererSettingsText))
104-
{
105-
Selection.SetActiveObjectWithContext(m_RendererDataProp.GetArrayElementAtIndex(index).objectReferenceValue,
106-
null);
107-
}
108-
}
109-
else // Missing ScriptableRendererData
90+
var isDefaultRenderer = index == m_DefaultRendererProp.intValue;
91+
using (new EditorGUI.DisabledScope(isDefaultRenderer))
11092
{
111-
if (GUI.Button(selectRect, index == defaultRenderer ? Styles.rendererDefaultMissingText : Styles.rendererMissingText))
93+
var defaultButtonX = rect.width - 51;
94+
var defaultButtonRect = new Rect(defaultButtonX, rect.y, 86, EditorGUIUtility.singleLineHeight);
95+
if (GUI.Button(defaultButtonRect, !GUI.enabled ? Styles.rendererDefaultText : Styles.rendererSetDefaultText))
11296
{
113-
EditorGUIUtility.ShowObjectPicker<ScriptableRendererData>(null, false, null, index);
97+
m_DefaultRendererProp.intValue = index;
98+
EditorUtility.SetDirty(target);
11499
}
115100
}
116101

Packages/com.unity.shadergraph/Editor/Generation/Targets/BuiltIn/Editor/ShaderGUI/BaseShaderGUI.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ protected class Styles
6969
public static readonly GUIContent blendingMode = EditorGUIUtility.TrTextContent("Blending Mode",
7070
"Controls how the color of the Transparent surface blends with the Material color in the background.");
7171
public static readonly GUIContent cullingText = EditorGUIUtility.TrTextContent("Render Face",
72-
"Specifies which faces to cull from your geometry. Front culls front faces. Back culls backfaces. None means that both sides are rendered.");
72+
"Specifies which faces to cull from your geometry. Front culls front faces. Back culls back faces. Both means that both sides are rendered.");
7373
public static readonly GUIContent zwriteText = EditorGUIUtility.TrTextContent("Depth Write",
7474
"Controls whether the shader writes depth. Auto will write only when the shader is opaque.");
7575
public static readonly GUIContent ztestText = EditorGUIUtility.TrTextContent("Depth Test",

0 commit comments

Comments
 (0)