From df050cc555531697d5a2132d4fb995dbae228d15 Mon Sep 17 00:00:00 2001 From: Adrien de Tocqueville Date: Wed, 27 Oct 2021 19:05:34 +0200 Subject: [PATCH 1/2] Add diffusion profile debug display --- .../Debugging/DebugUIDrawer.Builtins.cs | 133 ++++- .../Editor/Debugging/DebugWindow.cs | 3 + .../Runtime/Debugging/DebugUI.Fields.cs | 22 + .../Prefabs/Resources/DebugUICanvas.prefab | 6 + .../Prefabs/Scripts/DebugUIHandlerObject.cs | 45 ++ .../Scripts/DebugUIHandlerObject.cs.meta | 11 + .../Scripts/DebugUIHandlerObjectList.cs | 110 ++++ .../Scripts/DebugUIHandlerObjectList.cs.meta | 11 + .../Prefabs/Scripts/DebugUIHandlerRow.cs | 34 +- .../Prefabs/Widgets/DebugUIObject.prefab | 217 +++++++ .../Prefabs/Widgets/DebugUIObject.prefab.meta | 8 + .../Prefabs/Widgets/DebugUIObjectList.prefab | 532 ++++++++++++++++++ .../Widgets/DebugUIObjectList.prefab.meta | 8 + .../DiffusionProfileOverrideEditor.cs | 1 + .../Runtime/Debug/DebugDisplay.cs | 34 +- 15 files changed, 1152 insertions(+), 23 deletions(-) create mode 100644 com.unity.render-pipelines.core/Runtime/Debugging/Prefabs/Scripts/DebugUIHandlerObject.cs create mode 100644 com.unity.render-pipelines.core/Runtime/Debugging/Prefabs/Scripts/DebugUIHandlerObject.cs.meta create mode 100644 com.unity.render-pipelines.core/Runtime/Debugging/Prefabs/Scripts/DebugUIHandlerObjectList.cs create mode 100644 com.unity.render-pipelines.core/Runtime/Debugging/Prefabs/Scripts/DebugUIHandlerObjectList.cs.meta create mode 100644 com.unity.render-pipelines.core/Runtime/Debugging/Prefabs/Widgets/DebugUIObject.prefab create mode 100644 com.unity.render-pipelines.core/Runtime/Debugging/Prefabs/Widgets/DebugUIObject.prefab.meta create mode 100644 com.unity.render-pipelines.core/Runtime/Debugging/Prefabs/Widgets/DebugUIObjectList.prefab create mode 100644 com.unity.render-pipelines.core/Runtime/Debugging/Prefabs/Widgets/DebugUIObjectList.prefab.meta diff --git a/com.unity.render-pipelines.core/Editor/Debugging/DebugUIDrawer.Builtins.cs b/com.unity.render-pipelines.core/Editor/Debugging/DebugUIDrawer.Builtins.cs index 9e9b2839b3c..4c9f584ce1d 100644 --- a/com.unity.render-pipelines.core/Editor/Debugging/DebugUIDrawer.Builtins.cs +++ b/com.unity.render-pipelines.core/Editor/Debugging/DebugUIDrawer.Builtins.cs @@ -654,6 +654,80 @@ public override bool OnGUI(DebugUI.Widget widget, DebugState state) } } + /// + /// Builtin Drawer for Object Debug Items. + /// + [DebugUIDrawer(typeof(DebugUI.ObjectField))] + public sealed class DebugUIDrawerObjectField : DebugUIDrawer + { + /// + /// OnGUI implementation for Object DebugUIDrawer. + /// + /// DebugUI Widget. + /// Debug State associated with the Debug Item. + /// The state of the widget. + public override bool OnGUI(DebugUI.Widget widget, DebugState state) + { + var w = Cast(widget); + + EditorGUI.BeginChangeCheck(); + + var rect = PrepareControlRect(); + var value = EditorGUI.ObjectField(rect, EditorGUIUtility.TrTextContent(w.displayName, w.tooltip), w.GetValue(), w.type, true); + + if (EditorGUI.EndChangeCheck()) + Apply(w, state, value); + + return true; + } + } + + /// + /// Builtin Drawer for Object Debug Items. + /// + [DebugUIDrawer(typeof(DebugUI.ObjectListField))] + public sealed class DebugUIDrawerObjectListField : DebugUIDrawer + { + /// + /// OnGUI implementation for ObjectList DebugUIDrawer. + /// + /// DebugUI Widget. + /// Debug State associated with the Debug Item. + /// The state of the widget. + public override bool OnGUI(DebugUI.Widget widget, DebugState state) + { + var w = Cast(widget); + var objects = w.GetValue(); + + float height = Math.Max(objects != null ? objects.Length : 0, 1) * DebugWindow.Styles.singleRowHeight; + var rect = PrepareControlRect(height); + + rect = EditorGUI.PrefixLabel(rect, EditorGUIUtility.TrTextContent(widget.displayName)); + + EditorGUI.BeginChangeCheck(); + DoObjectList(rect, w, objects); + if (EditorGUI.EndChangeCheck()) + Apply(w, state, objects); + + return true; + } + + internal static void DoObjectList(Rect rect, DebugUI.ObjectListField widget, UnityEngine.Object[] objects) + { + if (objects != null && objects.Length != 0) + { + rect.height = EditorGUIUtility.singleLineHeight; + for (int i = 0; i < objects.Length; i++) + { + objects[i] = EditorGUI.ObjectField(rect, GUIContent.none, objects[i], widget.type, true); + rect.y += DebugWindow.Styles.singleRowHeight; + } + } + else + EditorGUI.LabelField(rect, GUIContent.none, EditorGUIUtility.TrTextContent("Empty")); + } + } + /// /// Builtin Drawer for MessageBox Items. /// @@ -782,14 +856,26 @@ public sealed class DebugUIDrawerTable : DebugUIDrawer /// The state of the widget. public override bool OnGUI(DebugUI.Widget widget, DebugState state) { + const float k_ScrollBarHeight = 15; + var w = Cast(widget); var header = w.Header; + var visible = header.state.visibleColumns; + + float contentHeight = 0.0f; + foreach (DebugUI.Table.Row row in w.children) + { + if (row != null) + contentHeight += GetRowHeight(row, visible); + else + contentHeight += EditorGUIUtility.singleLineHeight; + } // Put some space before the array PrepareControlRect(EditorGUIUtility.singleLineHeight * 0.5f); // Draw an outline around the table - var rect = EditorGUI.IndentedRect(PrepareControlRect(header.height + (w.children.Count + 1) * EditorGUIUtility.singleLineHeight)); + var rect = EditorGUI.IndentedRect(PrepareControlRect(header.height + contentHeight + k_ScrollBarHeight)); rect = DrawOutline(rect); // Compute rects @@ -797,26 +883,30 @@ public override bool OnGUI(DebugUI.Widget widget, DebugState state) var contentRect = new Rect(rect.x, headerRect.yMax, rect.width, rect.height - headerRect.height); var viewRect = new Rect(contentRect.x, contentRect.y, header.state.widthOfAllVisibleColumns, contentRect.height); var rowRect = contentRect; - rowRect.height = EditorGUIUtility.singleLineHeight; - viewRect.height -= EditorGUIUtility.singleLineHeight; + viewRect.height -= k_ScrollBarHeight; // Show header header.OnGUI(headerRect, Mathf.Max(w.scroll.x, 0f)); // Show array content w.scroll = GUI.BeginScrollView(contentRect, w.scroll, viewRect); + using (new EditorGUI.DisabledScope(w.isReadOnly)) { var columns = header.state.columns; - var visible = header.state.visibleColumns; for (int r = 0; r < w.children.Count; r++) { var row = Cast(w.children[r]); rowRect.x = contentRect.x; rowRect.width = columns[0].width; + if (row is DebugUI.Table.Row tableRow) + rowRect.height = GetRowHeight(tableRow, visible); + else + rowRect.height = EditorGUIUtility.singleLineHeight; + rowRect.xMin += 2; rowRect.xMax -= 2; - EditorGUI.LabelField(rowRect, GUIContent.none, EditorGUIUtility.TrTextContent(row.displayName)); + EditorGUI.LabelField(rowRect, GUIContent.none, EditorGUIUtility.TrTextContent(row.displayName), DebugWindow.Styles.centeredLeft); rowRect.xMin -= 2; rowRect.xMax += 2; @@ -824,7 +914,7 @@ public override bool OnGUI(DebugUI.Widget widget, DebugState state) { rowRect.x += rowRect.width; rowRect.width = columns[visible[c]].width; - DisplayChild(rowRect, row.children[visible[c] - 1], w.isReadOnly); + DisplayChild(rowRect, row.children[visible[c] - 1]); } rowRect.y += rowRect.height; } @@ -834,6 +924,19 @@ public override bool OnGUI(DebugUI.Widget widget, DebugState state) return false; } + internal float GetRowHeight(DebugUI.Table.Row row, int[] visibleColumns) + { + float height = EditorGUIUtility.singleLineHeight; + for (int c = 1; c < visibleColumns.Length; c++) + { + var child = row.children[visibleColumns[c] - 1] as DebugUI.ObjectListField; + if (child == null || child.GetValue() == null) + continue; + height = Mathf.Max(height, child.GetValue().Length * DebugWindow.Styles.singleRowHeight); + } + return height; + } + internal Rect DrawOutline(Rect rect) { if (Event.current.type != EventType.Repaint) @@ -853,7 +956,7 @@ internal Rect DrawOutline(Rect rect) return new Rect(rect.x + size, rect.y + size, rect.width - 2 * size, rect.height - 2 * size); } - internal void DisplayChild(Rect rect, DebugUI.Widget child, bool disable) + internal void DisplayChild(Rect rect, DebugUI.Widget child) { rect.xMin += 2; rect.xMax -= 2; @@ -865,14 +968,22 @@ internal void DisplayChild(Rect rect, DebugUI.Widget child, bool disable) else if (child.GetType() == typeof(DebugUI.ColorField)) { var widget = Cast(child); - using (new EditorGUI.DisabledScope(disable)) - EditorGUI.ColorField(rect, GUIContent.none, widget.GetValue(), false, widget.showAlpha, widget.hdr); + EditorGUI.ColorField(rect, GUIContent.none, widget.GetValue(), false, widget.showAlpha, widget.hdr); } else if (child.GetType() == typeof(DebugUI.BoolField)) { var widget = Cast(child); - using (new EditorGUI.DisabledScope(disable)) - EditorGUI.Toggle(rect, GUIContent.none, widget.GetValue()); + EditorGUI.Toggle(rect, GUIContent.none, widget.GetValue()); + } + else if (child.GetType() == typeof(DebugUI.ObjectField)) + { + var widget = Cast(child); + EditorGUI.ObjectField(rect, GUIContent.none, widget.GetValue(), widget.type, true); + } + else if (child.GetType() == typeof(DebugUI.ObjectListField)) + { + var widget = Cast(child); + DebugUIDrawerObjectListField.DoObjectList(rect, widget, widget.GetValue()); } } } diff --git a/com.unity.render-pipelines.core/Editor/Debugging/DebugWindow.cs b/com.unity.render-pipelines.core/Editor/Debugging/DebugWindow.cs index 83b39d332c8..1d7c1525709 100644 --- a/com.unity.render-pipelines.core/Editor/Debugging/DebugWindow.cs +++ b/com.unity.render-pipelines.core/Editor/Debugging/DebugWindow.cs @@ -562,6 +562,9 @@ public class Styles public readonly GUIStyle sectionHeader = new GUIStyle(EditorStyles.largeLabel); public readonly Color skinBackgroundColor; + public static GUIStyle centeredLeft = new GUIStyle(EditorStyles.label) { alignment = TextAnchor.MiddleLeft }; + public static float singleRowHeight = EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing; + public static int foldoutColumnWidth = 70; public Styles() diff --git a/com.unity.render-pipelines.core/Runtime/Debugging/DebugUI.Fields.cs b/com.unity.render-pipelines.core/Runtime/Debugging/DebugUI.Fields.cs index cd7fcf7101d..a084f493b1b 100644 --- a/com.unity.render-pipelines.core/Runtime/Debugging/DebugUI.Fields.cs +++ b/com.unity.render-pipelines.core/Runtime/Debugging/DebugUI.Fields.cs @@ -527,6 +527,28 @@ public class Vector4Field : Field public int decimals = 3; } + /// + /// Object field. + /// + public class ObjectField : Field + { + /// + /// Object type. + /// + public Type type = typeof(Object); + } + + /// + /// Object list field. + /// + public class ObjectListField : Field + { + /// + /// Objects type. + /// + public Type type = typeof(Object); + } + /// /// Simple message box widget, providing a couple of different styles. /// diff --git a/com.unity.render-pipelines.core/Runtime/Debugging/Prefabs/Resources/DebugUICanvas.prefab b/com.unity.render-pipelines.core/Runtime/Debugging/Prefabs/Resources/DebugUICanvas.prefab index d58d527add4..b6c78232d9a 100644 --- a/com.unity.render-pipelines.core/Runtime/Debugging/Prefabs/Resources/DebugUICanvas.prefab +++ b/com.unity.render-pipelines.core/Runtime/Debugging/Prefabs/Resources/DebugUICanvas.prefab @@ -185,3 +185,9 @@ MonoBehaviour: - type: UnityEngine.Rendering.DebugUI+ValueTuple, Unity.RenderPipelines.Core.Runtime, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null prefab: {fileID: 224720214277421396, guid: a2148203dd960814ca5db0c293ceda35, type: 3} + - type: UnityEngine.Rendering.DebugUI+ObjectField, Unity.RenderPipelines.Core.Runtime, + Version=0.0.0.0, Culture=neutral, PublicKeyToken=null + prefab: {fileID: 224720214277421396, guid: a87cfaef648f17c41b568e842e068c51, type: 3} + - type: UnityEngine.Rendering.DebugUI+ObjectListField, Unity.RenderPipelines.Core.Runtime, + Version=0.0.0.0, Culture=neutral, PublicKeyToken=null + prefab: {fileID: 224224135738715566, guid: ad83bc56407925d44a77a5bd01cd6783, type: 3} diff --git a/com.unity.render-pipelines.core/Runtime/Debugging/Prefabs/Scripts/DebugUIHandlerObject.cs b/com.unity.render-pipelines.core/Runtime/Debugging/Prefabs/Scripts/DebugUIHandlerObject.cs new file mode 100644 index 00000000000..f58514e300a --- /dev/null +++ b/com.unity.render-pipelines.core/Runtime/Debugging/Prefabs/Scripts/DebugUIHandlerObject.cs @@ -0,0 +1,45 @@ +using UnityEngine.UI; + +namespace UnityEngine.Rendering.UI +{ + /// + /// DebugUIHandler for object widget. + /// + public class DebugUIHandlerObject : DebugUIHandlerWidget + { + /// Name of the value field. + public Text nameLabel; + /// Value of the value field. + public Text valueLabel; + + internal override void SetWidget(DebugUI.Widget widget) + { + base.SetWidget(widget); + var field = CastWidget(); + nameLabel.text = field.displayName; + valueLabel.text = field.GetValue().name; + } + + /// + /// OnSelection implementation. + /// + /// True if the selection wrapped around. + /// Previous widget. + /// True if the selection is allowed. + public override bool OnSelection(bool fromNext, DebugUIHandlerWidget previous) + { + nameLabel.color = colorSelected; + valueLabel.color = colorSelected; + return true; + } + + /// + /// OnDeselection implementation. + /// + public override void OnDeselection() + { + nameLabel.color = colorDefault; + valueLabel.color = colorDefault; + } + } +} diff --git a/com.unity.render-pipelines.core/Runtime/Debugging/Prefabs/Scripts/DebugUIHandlerObject.cs.meta b/com.unity.render-pipelines.core/Runtime/Debugging/Prefabs/Scripts/DebugUIHandlerObject.cs.meta new file mode 100644 index 00000000000..f183261a361 --- /dev/null +++ b/com.unity.render-pipelines.core/Runtime/Debugging/Prefabs/Scripts/DebugUIHandlerObject.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: b8b3da1ab40a53c49a3de1e3fe357ad2 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/com.unity.render-pipelines.core/Runtime/Debugging/Prefabs/Scripts/DebugUIHandlerObjectList.cs b/com.unity.render-pipelines.core/Runtime/Debugging/Prefabs/Scripts/DebugUIHandlerObjectList.cs new file mode 100644 index 00000000000..ca9f8c4e264 --- /dev/null +++ b/com.unity.render-pipelines.core/Runtime/Debugging/Prefabs/Scripts/DebugUIHandlerObjectList.cs @@ -0,0 +1,110 @@ +using UnityEngine.UI; + +namespace UnityEngine.Rendering.UI +{ + /// + /// DebugUIHandler for object list widget. + /// + public class DebugUIHandlerObjectList : DebugUIHandlerWidget + { + /// Text displayed for the "next" button. + public Text nextButtonText; + /// Text displayed for the "previous" button. + public Text previousButtonText; + /// Name of the enum field. + public Text nameLabel; + /// Value of the enum field. + public Text valueLabel; + + internal protected DebugUI.ObjectListField m_Field; + int index; + + internal override void SetWidget(DebugUI.Widget widget) + { + base.SetWidget(widget); + m_Field = CastWidget(); + nameLabel.text = m_Field.displayName; + index = 0; + UpdateValueLabel(); + } + + /// + /// OnSelection implementation. + /// + /// True if the selection wrapped around. + /// Previous widget. + /// State of the widget. + public override bool OnSelection(bool fromNext, DebugUIHandlerWidget previous) + { + if (nextButtonText != null) + nextButtonText.color = colorSelected; + if (previousButtonText != null) + previousButtonText.color = colorSelected; + nameLabel.color = colorSelected; + valueLabel.color = colorSelected; + return true; + } + + /// + /// OnDeselection implementation. + /// + public override void OnDeselection() + { + if (nextButtonText != null) + nextButtonText.color = colorDefault; + if (previousButtonText != null) + previousButtonText.color = colorDefault; + nameLabel.color = colorDefault; + valueLabel.color = colorDefault; + } + + /// + /// OnAction implementation. + /// + public override void OnAction() + { + OnIncrement(false); + } + + /// + /// OnIncrement implementation. + /// + /// True if incrementing fast. + public override void OnIncrement(bool fast) + { + index++; + UpdateValueLabel(); + } + + /// + /// OnDecrement implementation. + /// + /// Trye if decrementing fast. + public override void OnDecrement(bool fast) + { + index--; + UpdateValueLabel(); + } + + /// + /// Update the label of the widget. + /// + internal protected virtual void UpdateValueLabel() + { + string text = "Empty"; + var values = m_Field.GetValue(); + if (values != null) + { + index = System.Math.Clamp(index, 0, values.Length - 1); + text = values[index].name; + + // The UI implementation is tight with space, so let's just truncate the string here if too long. + const int maxLength = 26; + if (text.Length > maxLength) + text = text.Substring(0, maxLength - 3) + "..."; + } + + valueLabel.text = text; + } + } +} diff --git a/com.unity.render-pipelines.core/Runtime/Debugging/Prefabs/Scripts/DebugUIHandlerObjectList.cs.meta b/com.unity.render-pipelines.core/Runtime/Debugging/Prefabs/Scripts/DebugUIHandlerObjectList.cs.meta new file mode 100644 index 00000000000..1dd8a908482 --- /dev/null +++ b/com.unity.render-pipelines.core/Runtime/Debugging/Prefabs/Scripts/DebugUIHandlerObjectList.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 79e8dd95427d853478c168019e7ce191 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/com.unity.render-pipelines.core/Runtime/Debugging/Prefabs/Scripts/DebugUIHandlerRow.cs b/com.unity.render-pipelines.core/Runtime/Debugging/Prefabs/Scripts/DebugUIHandlerRow.cs index 473eaa55554..c2ac1987d30 100644 --- a/com.unity.render-pipelines.core/Runtime/Debugging/Prefabs/Scripts/DebugUIHandlerRow.cs +++ b/com.unity.render-pipelines.core/Runtime/Debugging/Prefabs/Scripts/DebugUIHandlerRow.cs @@ -17,6 +17,24 @@ protected override void OnEnable() m_Timer = 0f; } + GameObject GetChild(int index) + { + return gameObject.transform.GetChild(1).GetChild(index).gameObject; + } + + bool IsActive(DebugUI.Table table, int index, out GameObject child) + { + child = GetChild(index); + if (!table.GetColumnVisibility(index)) + return false; + + var valueChild = child.transform.Find("Value"); + if (valueChild != null && valueChild.TryGetComponent(out var text)) + return !string.IsNullOrEmpty(text.text); + + return true; + } + /// /// Update implementation. /// @@ -33,8 +51,7 @@ protected void Update() for (int i = 0; i < row.children.Count; i++) { - var child = gameObject.transform.GetChild(1).GetChild(i).gameObject; - var active = table.GetColumnVisibility(i); + bool active = IsActive(table, i, out var child); child.SetActive(active); if (active && refreshRow) { @@ -42,28 +59,27 @@ protected void Update() color.UpdateColor(); if (child.TryGetComponent(out var toggle)) toggle.UpdateValueLabel(); + if (child.TryGetComponent(out var list)) + list.UpdateValueLabel(); } } - // Update previous and next ui handlers to pass over hidden volumes - var item = gameObject.transform.GetChild(1).GetChild(0).gameObject; - var itemWidget = item.GetComponent(); + // Update previous and next ui handlers to skip hidden volumes + var itemWidget = GetChild(0).GetComponent(); DebugUIHandlerWidget previous = null; for (int i = 0; i < row.children.Count; i++) { itemWidget.previousUIHandler = previous; - if (table.GetColumnVisibility(i)) + if (IsActive(table, i, out var _)) previous = itemWidget; bool found = false; for (int j = i + 1; j < row.children.Count; j++) { - if (table.GetColumnVisibility(j)) + if (IsActive(table, j, out var child)) { - var child = gameObject.transform.GetChild(1).GetChild(j).gameObject; var childWidget = child.GetComponent(); itemWidget.nextUIHandler = childWidget; - item = child; itemWidget = childWidget; i = j - 1; found = true; diff --git a/com.unity.render-pipelines.core/Runtime/Debugging/Prefabs/Widgets/DebugUIObject.prefab b/com.unity.render-pipelines.core/Runtime/Debugging/Prefabs/Widgets/DebugUIObject.prefab new file mode 100644 index 00000000000..ac85300fa5d --- /dev/null +++ b/com.unity.render-pipelines.core/Runtime/Debugging/Prefabs/Widgets/DebugUIObject.prefab @@ -0,0 +1,217 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!1 &1100371661045084 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 224720214277421396} + - component: {fileID: 2288629013625182462} + m_Layer: 5 + m_Name: DebugUIObject + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &224720214277421396 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1100371661045084} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: + - {fileID: 224309343631572978} + - {fileID: 224518799942003328} + m_Father: {fileID: 0} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 0, y: 0} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: 26} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!114 &2288629013625182462 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1100371661045084} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: b8b3da1ab40a53c49a3de1e3fe357ad2, type: 3} + m_Name: + m_EditorClassIdentifier: + colorDefault: {r: 0.8, g: 0.8, b: 0.8, a: 1} + colorSelected: {r: 0.25, g: 0.65, b: 0.8, a: 1} + nameLabel: {fileID: 114601347101323698} + valueLabel: {fileID: 114504040572925244} +--- !u!1 &1207032646716234 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 224309343631572978} + - component: {fileID: 222840031335149136} + - component: {fileID: 114601347101323698} + m_Layer: 5 + m_Name: Text + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &224309343631572978 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1207032646716234} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 224720214277421396} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 0.5, y: 1} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: 0} + m_Pivot: {x: 0.5, y: 1} +--- !u!222 &222840031335149136 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1207032646716234} + m_CullTransparentMesh: 1 +--- !u!114 &114601347101323698 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1207032646716234} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 5f7201a12d95ffc409449d95f23cf332, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 0.8, g: 0.8, b: 0.8, a: 1} + m_RaycastTarget: 0 + m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} + m_Maskable: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_FontData: + m_Font: {fileID: 12800000, guid: 74a5091d8707f334b9a5c31ef71a64ba, type: 3} + m_FontSize: 16 + m_FontStyle: 0 + m_BestFit: 0 + m_MinSize: 10 + m_MaxSize: 40 + m_Alignment: 3 + m_AlignByGeometry: 0 + m_RichText: 0 + m_HorizontalOverflow: 0 + m_VerticalOverflow: 0 + m_LineSpacing: 1 + m_Text: New Text +--- !u!1 &1644687155343164 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 224518799942003328} + - component: {fileID: 222991141768779948} + - component: {fileID: 114504040572925244} + m_Layer: 5 + m_Name: Value + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &224518799942003328 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1644687155343164} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 224720214277421396} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0.5, y: 0} + m_AnchorMax: {x: 1, y: 1} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: 0} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!222 &222991141768779948 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1644687155343164} + m_CullTransparentMesh: 1 +--- !u!114 &114504040572925244 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1644687155343164} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 5f7201a12d95ffc409449d95f23cf332, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 0.8, g: 0.8, b: 0.8, a: 1} + m_RaycastTarget: 0 + m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} + m_Maskable: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_FontData: + m_Font: {fileID: 12800000, guid: 74a5091d8707f334b9a5c31ef71a64ba, type: 3} + m_FontSize: 16 + m_FontStyle: 0 + m_BestFit: 0 + m_MinSize: 1 + m_MaxSize: 40 + m_Alignment: 3 + m_AlignByGeometry: 0 + m_RichText: 0 + m_HorizontalOverflow: 0 + m_VerticalOverflow: 0 + m_LineSpacing: 1 + m_Text: '-' diff --git a/com.unity.render-pipelines.core/Runtime/Debugging/Prefabs/Widgets/DebugUIObject.prefab.meta b/com.unity.render-pipelines.core/Runtime/Debugging/Prefabs/Widgets/DebugUIObject.prefab.meta new file mode 100644 index 00000000000..a919deb3ae6 --- /dev/null +++ b/com.unity.render-pipelines.core/Runtime/Debugging/Prefabs/Widgets/DebugUIObject.prefab.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: a87cfaef648f17c41b568e842e068c51 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 100100000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/com.unity.render-pipelines.core/Runtime/Debugging/Prefabs/Widgets/DebugUIObjectList.prefab b/com.unity.render-pipelines.core/Runtime/Debugging/Prefabs/Widgets/DebugUIObjectList.prefab new file mode 100644 index 00000000000..412ae0b47f9 --- /dev/null +++ b/com.unity.render-pipelines.core/Runtime/Debugging/Prefabs/Widgets/DebugUIObjectList.prefab @@ -0,0 +1,532 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!1 &1311110376158742 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 224224135738715566} + - component: {fileID: 2675626277221785639} + m_Layer: 5 + m_Name: DebugUIObjectList + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &224224135738715566 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1311110376158742} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: + - {fileID: 224082802897306466} + - {fileID: 73524541048352296} + m_Father: {fileID: 0} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0.5} + m_AnchorMax: {x: 1, y: 0.5} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: 26} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!114 &2675626277221785639 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1311110376158742} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 79e8dd95427d853478c168019e7ce191, type: 3} + m_Name: + m_EditorClassIdentifier: + colorDefault: {r: 0.8, g: 0.8, b: 0.8, a: 1} + colorSelected: {r: 0.25, g: 0.65, b: 0.8, a: 1} + nextButtonText: {fileID: 1122682645790643364} + previousButtonText: {fileID: 5991968131668804396} + nameLabel: {fileID: 114749518858187484} + valueLabel: {fileID: 114525189159037378} +--- !u!1 &1318931732956078 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 224082802897306466} + - component: {fileID: 222666496576361700} + - component: {fileID: 114749518858187484} + m_Layer: 5 + m_Name: Text + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &224082802897306466 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1318931732956078} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 224224135738715566} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0.5} + m_AnchorMax: {x: 0, y: 0.5} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 270, y: 16} + m_Pivot: {x: 0, y: 0.5} +--- !u!222 &222666496576361700 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1318931732956078} + m_CullTransparentMesh: 0 +--- !u!114 &114749518858187484 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1318931732956078} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 5f7201a12d95ffc409449d95f23cf332, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 0.8, g: 0.8, b: 0.8, a: 1} + m_RaycastTarget: 0 + m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} + m_Maskable: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_FontData: + m_Font: {fileID: 12800000, guid: 74a5091d8707f334b9a5c31ef71a64ba, type: 3} + m_FontSize: 16 + m_FontStyle: 0 + m_BestFit: 0 + m_MinSize: 1 + m_MaxSize: 40 + m_Alignment: 3 + m_AlignByGeometry: 0 + m_RichText: 0 + m_HorizontalOverflow: 1 + m_VerticalOverflow: 1 + m_LineSpacing: 1 + m_Text: wibble +--- !u!1 &1489651458712568 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 224794258446302326} + - component: {fileID: 222110064721837410} + - component: {fileID: 114525189159037378} + m_Layer: 5 + m_Name: Value + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &224794258446302326 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1489651458712568} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 73524541048352296} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 1} + m_AnchorMax: {x: 1, y: 1} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: -80, y: 0} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!222 &222110064721837410 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1489651458712568} + m_CullTransparentMesh: 0 +--- !u!114 &114525189159037378 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1489651458712568} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 5f7201a12d95ffc409449d95f23cf332, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 0.8, g: 0.8, b: 0.8, a: 1} + m_RaycastTarget: 0 + m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} + m_Maskable: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_FontData: + m_Font: {fileID: 12800000, guid: 74a5091d8707f334b9a5c31ef71a64ba, type: 3} + m_FontSize: 16 + m_FontStyle: 0 + m_BestFit: 0 + m_MinSize: 1 + m_MaxSize: 40 + m_Alignment: 4 + m_AlignByGeometry: 0 + m_RichText: 0 + m_HorizontalOverflow: 1 + m_VerticalOverflow: 1 + m_LineSpacing: 1 + m_Text: Enum +--- !u!1 &5170338306183638078 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 73524541048352296} + m_Layer: 5 + m_Name: Panel + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &73524541048352296 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 5170338306183638078} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: + - {fileID: 1881800067243094030} + - {fileID: 224794258446302326} + - {fileID: 5949731805867224018} + m_Father: {fileID: 224224135738715566} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0.5, y: 0} + m_AnchorMax: {x: 1, y: 1} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: -26} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!1 &5539936913609446775 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 5949731805867224018} + - component: {fileID: 3410995964130187825} + - component: {fileID: 171064836484364327} + - component: {fileID: 1122682645790643364} + m_Layer: 5 + m_Name: Increment + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &5949731805867224018 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 5539936913609446775} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 73524541048352296} + m_RootOrder: 2 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 1, y: 1} + m_AnchorMax: {x: 1, y: 1} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 32, y: 32} + m_Pivot: {x: 1, y: 0.5} +--- !u!222 &3410995964130187825 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 5539936913609446775} + m_CullTransparentMesh: 0 +--- !u!114 &171064836484364327 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 5539936913609446775} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 4e29b1a8efbd4b44bb3f3716e73f07ff, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Navigation: + m_Mode: 0 + m_WrapAround: 0 + m_SelectOnUp: {fileID: 0} + m_SelectOnDown: {fileID: 0} + m_SelectOnLeft: {fileID: 0} + m_SelectOnRight: {fileID: 0} + m_Transition: 0 + m_Colors: + m_NormalColor: {r: 1, g: 1, b: 1, a: 1} + m_HighlightedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1} + m_PressedColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 1} + m_SelectedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1} + m_DisabledColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 0.5019608} + m_ColorMultiplier: 1 + m_FadeDuration: 0.1 + m_SpriteState: + m_HighlightedSprite: {fileID: 0} + m_PressedSprite: {fileID: 0} + m_SelectedSprite: {fileID: 0} + m_DisabledSprite: {fileID: 0} + m_AnimationTriggers: + m_NormalTrigger: Normal + m_HighlightedTrigger: Highlighted + m_PressedTrigger: Pressed + m_SelectedTrigger: Selected + m_DisabledTrigger: Disabled + m_Interactable: 1 + m_TargetGraphic: {fileID: 1122682645790643364} + m_OnClick: + m_PersistentCalls: + m_Calls: + - m_Target: {fileID: 0} + m_TargetAssemblyTypeName: + m_MethodName: OnIncrement + m_Mode: 6 + m_Arguments: + m_ObjectArgument: {fileID: 0} + m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine + m_IntArgument: 0 + m_FloatArgument: 0 + m_StringArgument: + m_BoolArgument: 0 + m_CallState: 1 +--- !u!114 &1122682645790643364 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 5539936913609446775} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 5f7201a12d95ffc409449d95f23cf332, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 0.8, g: 0.8, b: 0.8, a: 1} + m_RaycastTarget: 1 + m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} + m_Maskable: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_FontData: + m_Font: {fileID: 12800000, guid: 74a5091d8707f334b9a5c31ef71a64ba, type: 3} + m_FontSize: 16 + m_FontStyle: 0 + m_BestFit: 0 + m_MinSize: 1 + m_MaxSize: 40 + m_Alignment: 4 + m_AlignByGeometry: 0 + m_RichText: 0 + m_HorizontalOverflow: 1 + m_VerticalOverflow: 1 + m_LineSpacing: 1 + m_Text: '>' +--- !u!1 &6187864743549253699 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1881800067243094030} + - component: {fileID: 5373617172578495976} + - component: {fileID: 7012455541135481670} + - component: {fileID: 5991968131668804396} + m_Layer: 5 + m_Name: Decrement + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &1881800067243094030 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 6187864743549253699} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 73524541048352296} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 1} + m_AnchorMax: {x: 0, y: 1} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 32, y: 32} + m_Pivot: {x: 0, y: 0.5} +--- !u!222 &5373617172578495976 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 6187864743549253699} + m_CullTransparentMesh: 0 +--- !u!114 &7012455541135481670 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 6187864743549253699} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 4e29b1a8efbd4b44bb3f3716e73f07ff, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Navigation: + m_Mode: 0 + m_WrapAround: 0 + m_SelectOnUp: {fileID: 0} + m_SelectOnDown: {fileID: 0} + m_SelectOnLeft: {fileID: 0} + m_SelectOnRight: {fileID: 0} + m_Transition: 0 + m_Colors: + m_NormalColor: {r: 1, g: 1, b: 1, a: 1} + m_HighlightedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1} + m_PressedColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 1} + m_SelectedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1} + m_DisabledColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 0.5019608} + m_ColorMultiplier: 1 + m_FadeDuration: 0.1 + m_SpriteState: + m_HighlightedSprite: {fileID: 0} + m_PressedSprite: {fileID: 0} + m_SelectedSprite: {fileID: 0} + m_DisabledSprite: {fileID: 0} + m_AnimationTriggers: + m_NormalTrigger: Normal + m_HighlightedTrigger: Highlighted + m_PressedTrigger: Pressed + m_SelectedTrigger: Selected + m_DisabledTrigger: Disabled + m_Interactable: 1 + m_TargetGraphic: {fileID: 5991968131668804396} + m_OnClick: + m_PersistentCalls: + m_Calls: + - m_Target: {fileID: 0} + m_TargetAssemblyTypeName: + m_MethodName: OnDecrement + m_Mode: 6 + m_Arguments: + m_ObjectArgument: {fileID: 0} + m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine + m_IntArgument: 0 + m_FloatArgument: 0 + m_StringArgument: + m_BoolArgument: 0 + m_CallState: 1 +--- !u!114 &5991968131668804396 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 6187864743549253699} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 5f7201a12d95ffc409449d95f23cf332, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 0.8, g: 0.8, b: 0.8, a: 1} + m_RaycastTarget: 1 + m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} + m_Maskable: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_FontData: + m_Font: {fileID: 12800000, guid: 74a5091d8707f334b9a5c31ef71a64ba, type: 3} + m_FontSize: 16 + m_FontStyle: 0 + m_BestFit: 0 + m_MinSize: 1 + m_MaxSize: 40 + m_Alignment: 4 + m_AlignByGeometry: 0 + m_RichText: 0 + m_HorizontalOverflow: 1 + m_VerticalOverflow: 1 + m_LineSpacing: 1 + m_Text: < diff --git a/com.unity.render-pipelines.core/Runtime/Debugging/Prefabs/Widgets/DebugUIObjectList.prefab.meta b/com.unity.render-pipelines.core/Runtime/Debugging/Prefabs/Widgets/DebugUIObjectList.prefab.meta new file mode 100644 index 00000000000..1d79daeabe0 --- /dev/null +++ b/com.unity.render-pipelines.core/Runtime/Debugging/Prefabs/Widgets/DebugUIObjectList.prefab.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: ad83bc56407925d44a77a5bd01cd6783 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 100100000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/com.unity.render-pipelines.high-definition/Editor/Lighting/DiffusionProfileOverrideEditor.cs b/com.unity.render-pipelines.high-definition/Editor/Lighting/DiffusionProfileOverrideEditor.cs index 08634f34fc9..caea11d3551 100644 --- a/com.unity.render-pipelines.high-definition/Editor/Lighting/DiffusionProfileOverrideEditor.cs +++ b/com.unity.render-pipelines.high-definition/Editor/Lighting/DiffusionProfileOverrideEditor.cs @@ -45,6 +45,7 @@ public override void OnInspectorGUI() void DrawDiffusionProfileElement(SerializedProperty element, Rect rect, int index) { + rect.y += 2; EditorGUI.BeginDisabledGroup(!m_DiffusionProfiles.overrideState.boolValue); EditorGUI.ObjectField(rect, element, new GUIContent("Profile " + index)); EditorGUI.EndDisabledGroup(); diff --git a/com.unity.render-pipelines.high-definition/Runtime/Debug/DebugDisplay.cs b/com.unity.render-pipelines.high-definition/Runtime/Debug/DebugDisplay.cs index 90ce75817b3..0fd31844cf1 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/Debug/DebugDisplay.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/Debug/DebugDisplay.cs @@ -1772,6 +1772,17 @@ DebugUI.Widget makeWidget(string name, VolumeParameter param) }; } + if (param.GetType() == typeof(DiffusionProfileSettingsParameter)) + { + var p = (DiffusionProfileSettingsParameter)param; + return new DebugUI.ObjectListField() + { + displayName = name, + getter = () => p.value, + type = typeof(DiffusionProfileSettings) + }; + } + // For parameters that do not override `ToString` var property = param.GetType().GetProperty("value"); var toString = property.PropertyType.GetMethod("ToString", Type.EmptyTypes); @@ -1822,6 +1833,7 @@ DebugUI.Widget makeWidget(string name, VolumeParameter param) var row = new DebugUI.Table.Row() { displayName = "Volume Info", + opened = true, // Open by default for the in-game view children = { new DebugUI.Value() @@ -1855,14 +1867,20 @@ DebugUI.Widget makeWidget(string name, VolumeParameter param) } } }; - row.opened = true; + + // Second row, links to volume gameobjects + var row2 = new DebugUI.Table.Row() + { + displayName = "GameObject", + children = { new DebugUI.Value() { getter = () => "" } } + }; foreach (var volume in volumes) { var profile = volume.HasInstantiatedProfile() ? volume.profile : volume.sharedProfile; row.children.Add(new DebugUI.Value() { - displayName = volume.name + " (" + profile.name + ")", + displayName = profile.name, getter = () => { var scope = volume.isGlobal ? "Global" : "Local"; @@ -1870,11 +1888,21 @@ DebugUI.Widget makeWidget(string name, VolumeParameter param) return scope + " (" + (weight * 100f) + "%)"; } }); + + row2.children.Add(new DebugUI.ObjectField() + { + displayName = profile.name, + getter = () => volume, + type = typeof(DiffusionProfileSettings) + }); } row.children.Add(new DebugUI.Value() { displayName = "Default Value", getter = () => "" }); table.children.Add(row); + row2.children.Add(new DebugUI.Value() { getter = () => "" }); + table.children.Add(row2); + // Build rows - recursively handles nested parameters var rows = new List(); void AddParameterRows(Type type, string baseName = null) @@ -1904,7 +1932,7 @@ void AddRow(FieldInfo f, string prefix) var profile = volume.HasInstantiatedProfile() ? volume.profile : volume.sharedProfile; if (profile.TryGet(selectedType, out VolumeComponent component) && component.parameters[currentParam].overrideState) param = component.parameters[currentParam]; - row.children.Add(makeWidget(volume.name + " (" + profile.name + ")", param)); + row.children.Add(makeWidget(profile.name, param)); } row.children.Add(makeWidget("Default Value", inst.parameters[currentParam])); From 945b932b20718456b8ff91b131e3a0181946bb67 Mon Sep 17 00:00:00 2001 From: Adrien de Tocqueville Date: Wed, 3 Nov 2021 15:29:59 +0100 Subject: [PATCH 2/2] Addressed reviews --- .../Debugging/DebugUIDrawer.Builtins.cs | 52 ++++++++----------- .../Runtime/Debug/DebugDisplay.cs | 6 +-- 2 files changed, 26 insertions(+), 32 deletions(-) diff --git a/com.unity.render-pipelines.core/Editor/Debugging/DebugUIDrawer.Builtins.cs b/com.unity.render-pipelines.core/Editor/Debugging/DebugUIDrawer.Builtins.cs index 4c9f584ce1d..b2b3fc53985 100644 --- a/com.unity.render-pipelines.core/Editor/Debugging/DebugUIDrawer.Builtins.cs +++ b/com.unity.render-pipelines.core/Editor/Debugging/DebugUIDrawer.Builtins.cs @@ -655,7 +655,7 @@ public override bool OnGUI(DebugUI.Widget widget, DebugState state) } /// - /// Builtin Drawer for Object Debug Items. + /// Builtin Drawer for Items. /// [DebugUIDrawer(typeof(DebugUI.ObjectField))] public sealed class DebugUIDrawerObjectField : DebugUIDrawer @@ -663,7 +663,7 @@ public sealed class DebugUIDrawerObjectField : DebugUIDrawer /// /// OnGUI implementation for Object DebugUIDrawer. /// - /// DebugUI Widget. + /// DebugUI . /// Debug State associated with the Debug Item. /// The state of the widget. public override bool OnGUI(DebugUI.Widget widget, DebugState state) @@ -683,7 +683,7 @@ public override bool OnGUI(DebugUI.Widget widget, DebugState state) } /// - /// Builtin Drawer for Object Debug Items. + /// Builtin Drawer for Items. /// [DebugUIDrawer(typeof(DebugUI.ObjectListField))] public sealed class DebugUIDrawerObjectListField : DebugUIDrawer @@ -691,7 +691,7 @@ public sealed class DebugUIDrawerObjectListField : DebugUIDrawer /// /// OnGUI implementation for ObjectList DebugUIDrawer. /// - /// DebugUI Widget. + /// DebugUI . /// Debug State associated with the Debug Item. /// The state of the widget. public override bool OnGUI(DebugUI.Widget widget, DebugState state) @@ -714,17 +714,18 @@ public override bool OnGUI(DebugUI.Widget widget, DebugState state) internal static void DoObjectList(Rect rect, DebugUI.ObjectListField widget, UnityEngine.Object[] objects) { - if (objects != null && objects.Length != 0) + if (objects == null || objects.Length == 0) { - rect.height = EditorGUIUtility.singleLineHeight; - for (int i = 0; i < objects.Length; i++) - { - objects[i] = EditorGUI.ObjectField(rect, GUIContent.none, objects[i], widget.type, true); - rect.y += DebugWindow.Styles.singleRowHeight; - } - } - else EditorGUI.LabelField(rect, GUIContent.none, EditorGUIUtility.TrTextContent("Empty")); + return; + } + + rect.height = EditorGUIUtility.singleLineHeight; + for (int i = 0; i < objects.Length; i++) + { + objects[i] = EditorGUI.ObjectField(rect, GUIContent.none, objects[i], widget.type, true); + rect.y += DebugWindow.Styles.singleRowHeight; + } } } @@ -864,12 +865,7 @@ public override bool OnGUI(DebugUI.Widget widget, DebugState state) float contentHeight = 0.0f; foreach (DebugUI.Table.Row row in w.children) - { - if (row != null) - contentHeight += GetRowHeight(row, visible); - else - contentHeight += EditorGUIUtility.singleLineHeight; - } + contentHeight += row != null ? GetRowHeight(row, visible) : EditorGUIUtility.singleLineHeight; // Put some space before the array PrepareControlRect(EditorGUIUtility.singleLineHeight * 0.5f); @@ -890,7 +886,6 @@ public override bool OnGUI(DebugUI.Widget widget, DebugState state) // Show array content w.scroll = GUI.BeginScrollView(contentRect, w.scroll, viewRect); - using (new EditorGUI.DisabledScope(w.isReadOnly)) { var columns = header.state.columns; for (int r = 0; r < w.children.Count; r++) @@ -898,11 +893,7 @@ public override bool OnGUI(DebugUI.Widget widget, DebugState state) var row = Cast(w.children[r]); rowRect.x = contentRect.x; rowRect.width = columns[0].width; - - if (row is DebugUI.Table.Row tableRow) - rowRect.height = GetRowHeight(tableRow, visible); - else - rowRect.height = EditorGUIUtility.singleLineHeight; + rowRect.height = (row is DebugUI.Table.Row tableRow) ? GetRowHeight(tableRow, visible) : EditorGUIUtility.singleLineHeight; rowRect.xMin += 2; rowRect.xMax -= 2; @@ -910,11 +901,14 @@ public override bool OnGUI(DebugUI.Widget widget, DebugState state) rowRect.xMin -= 2; rowRect.xMax += 2; - for (int c = 1; c < visible.Length; c++) + using (new EditorGUI.DisabledScope(w.isReadOnly)) { - rowRect.x += rowRect.width; - rowRect.width = columns[visible[c]].width; - DisplayChild(rowRect, row.children[visible[c] - 1]); + for (int c = 1; c < visible.Length; c++) + { + rowRect.x += rowRect.width; + rowRect.width = columns[visible[c]].width; + DisplayChild(rowRect, row.children[visible[c] - 1]); + } } rowRect.y += rowRect.height; } diff --git a/com.unity.render-pipelines.high-definition/Runtime/Debug/DebugDisplay.cs b/com.unity.render-pipelines.high-definition/Runtime/Debug/DebugDisplay.cs index 0fd31844cf1..c4173a2b041 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/Debug/DebugDisplay.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/Debug/DebugDisplay.cs @@ -1872,7 +1872,7 @@ DebugUI.Widget makeWidget(string name, VolumeParameter param) var row2 = new DebugUI.Table.Row() { displayName = "GameObject", - children = { new DebugUI.Value() { getter = () => "" } } + children = { new DebugUI.Value() { getter = () => string.Empty } } }; foreach (var volume in volumes) @@ -1897,10 +1897,10 @@ DebugUI.Widget makeWidget(string name, VolumeParameter param) }); } - row.children.Add(new DebugUI.Value() { displayName = "Default Value", getter = () => "" }); + row.children.Add(new DebugUI.Value() { displayName = "Default Value", getter = () => string.Empty }); table.children.Add(row); - row2.children.Add(new DebugUI.Value() { getter = () => "" }); + row2.children.Add(new DebugUI.Value() { getter = () => string.Empty }); table.children.Add(row2); // Build rows - recursively handles nested parameters