Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -592,6 +592,36 @@ public override bool OnGUI(DebugUI.Widget widget, DebugState state)
}
}

/// <summary>
/// Builtin Drawer for MessageBox Items.
/// </summary>
[DebugUIDrawer(typeof(DebugUI.MessageBox))]
public sealed class DebugUIDrawerMessageBox : DebugUIDrawer
{
/// <summary>
/// OnGUI implementation for TextLabel DebugUIDrawer.
/// </summary>
/// <param name="widget">DebugUI Widget.</param>
/// <param name="state">Debug State associated with the Debug Item.</param>
/// <returns>The state of the widget.</returns>
public override bool OnGUI(DebugUI.Widget widget, DebugState state)
{
var w = Cast<DebugUI.MessageBox>(widget);

var type = w.style switch
{
DebugUI.MessageBox.Style.Info => MessageType.Info,
DebugUI.MessageBox.Style.Warning => MessageType.Warning,
DebugUI.MessageBox.Style.Error => MessageType.Error,
_ => MessageType.None
};

EditorGUILayout.HelpBox(w.displayName, type);

return true;
}
}

/// <summary>
/// Builtin Drawer for Container Debug Items.
/// </summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -526,5 +526,26 @@ public class Vector4Field : Field<Vector4>
/// </summary>
public int decimals = 3;
}

/// <summary>
/// Simple message box widget, providing a couple of different styles.
/// </summary>
public class MessageBox : Widget
{
/// <summary>
/// Label style defines text color and background.
/// </summary>
public enum Style
{
Info,
Warning,
Error
}

/// <summary>
/// Style used to render displayName.
/// </summary>
public Style style = Style.Info;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ Canvas:
m_OverridePixelPerfect: 0
m_SortingBucketNormalizedSize: 0
m_AdditionalShaderChannelsFlag: 0
m_UpdateRectTransformForStandalone: 0
m_SortingLayerID: 0
m_SortingOrder: 0
m_TargetDisplay: 0
Expand Down Expand Up @@ -175,3 +176,6 @@ MonoBehaviour:
- type: UnityEngine.Rendering.DebugUI+Table+Row, Unity.RenderPipelines.Core.Runtime,
Version=0.0.0.0, Culture=neutral, PublicKeyToken=null
prefab: {fileID: 224053494956566916, guid: 2d019437ff89b8d44949727731cd9357, type: 3}
- type: UnityEngine.Rendering.DebugUI+MessageBox, Unity.RenderPipelines.Core.Runtime,
Version=0.0.0.0, Culture=neutral, PublicKeyToken=null
prefab: {fileID: 224053494956566916, guid: 10a25524b0986f9488b430e2829bbbe8, type: 3}
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
using UnityEngine.UI;

namespace UnityEngine.Rendering.UI
{
/// <summary>
/// DebugUIHandler for MessageBox widget.
/// </summary>
public class DebugUIHandlerMessageBox : DebugUIHandlerWidget
{
/// <summary>Name of the widget.</summary>
public Text nameLabel;

DebugUI.MessageBox m_Field;

static Color32 k_WarningBackgroundColor = new Color32(231, 180, 3, 30);
static Color32 k_WarningTextColor = new Color32(231, 180, 3, 255);
static Color32 k_ErrorBackgroundColor = new Color32(231, 75, 3, 30);
static Color32 k_ErrorTextColor = new Color32(231, 75, 3, 255);

internal override void SetWidget(DebugUI.Widget widget)
{
base.SetWidget(widget);
m_Field = CastWidget<DebugUI.MessageBox>();
nameLabel.text = m_Field.displayName;

var image = GetComponent<Image>();
switch (m_Field.style)
{
case DebugUI.MessageBox.Style.Warning:
image.color = k_WarningBackgroundColor;
break;

case DebugUI.MessageBox.Style.Error:
image.color = k_ErrorBackgroundColor;
break;
}
}

public override bool OnSelection(bool fromNext, DebugUIHandlerWidget previous)
{
return false;
}
}
}

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -0,0 +1,220 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!1 &1880654171993120
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 224053494956566916}
- component: {fileID: 114903677526224182}
- component: {fileID: 114617406789257194}
- component: {fileID: 2667470447078002195}
- component: {fileID: 6558164272786438813}
- component: {fileID: 3503157118102991044}
m_Layer: 0
m_Name: DebugUIMessageBox
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &224053494956566916
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1880654171993120}
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: 224133929923872250}
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: 295, y: 0}
m_SizeDelta: {x: 590, y: 0}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!114 &114903677526224182
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1880654171993120}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 59f8146938fff824cb5fd77236b75775, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Padding:
m_Left: 6
m_Right: 6
m_Top: 4
m_Bottom: 4
m_ChildAlignment: 0
m_Spacing: 0
m_ChildForceExpandWidth: 1
m_ChildForceExpandHeight: 1
m_ChildControlWidth: 1
m_ChildControlHeight: 1
m_ChildScaleWidth: 0
m_ChildScaleHeight: 0
m_ReverseArrangement: 0
--- !u!114 &114617406789257194
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1880654171993120}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 3245ec927659c4140ac4f8d17403cc18, type: 3}
m_Name:
m_EditorClassIdentifier:
m_HorizontalFit: 0
m_VerticalFit: 2
--- !u!114 &2667470447078002195
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1880654171993120}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: e25c98bed7eaeec4cb32c57a5280f85e, 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: 114398791307483412}
backgroundImage: {fileID: 3503157118102991044}
--- !u!222 &6558164272786438813
CanvasRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1880654171993120}
m_CullTransparentMesh: 1
--- !u!114 &3503157118102991044
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1880654171993120}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Material: {fileID: 0}
m_Color: {r: 1, g: 1, b: 1, a: 0.27058825}
m_RaycastTarget: 1
m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
m_Maskable: 1
m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
m_Sprite: {fileID: 0}
m_Type: 1
m_PreserveAspect: 0
m_FillCenter: 1
m_FillMethod: 4
m_FillAmount: 1
m_FillClockwise: 1
m_FillOrigin: 0
m_UseSpriteMesh: 0
m_PixelsPerUnitMultiplier: 1
--- !u!1 &1887383709356810
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 224133929923872250}
- component: {fileID: 222546040197109316}
- component: {fileID: 114398791307483412}
m_Layer: 5
m_Name: Text
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &224133929923872250
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1887383709356810}
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: 224053494956566916}
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: 0}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!222 &222546040197109316
CanvasRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1887383709356810}
m_CullTransparentMesh: 1
--- !u!114 &114398791307483412
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1887383709356810}
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: 15
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: 1
m_LineSpacing: 1
m_Text: 'Message text

'

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions com.unity.render-pipelines.high-definition/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
- Fixed diffusion profile being reset to default on SpeedTree8 materials with subsurface scattering enabled during import.
- Fixed the volume not being assigned on some scene templates.
- Fixed corruption in player with lightmap uv when Optimize Mesh Data is enabled [1357902]
- Fixed a warning to Rendering Debugger Runtime UI when debug shaders are stripped.

### Changed
- Visual Environment ambient mode is now Dynamic by default.
Expand Down
Loading