diff --git a/Editor/Debugging/Debugger.cs b/Editor/Debugging/Debugger.cs index bc23d4f..083d18f 100644 --- a/Editor/Debugging/Debugger.cs +++ b/Editor/Debugging/Debugger.cs @@ -214,6 +214,7 @@ private static IComponent RenderNode(CompositionContext.InspectedNode node, int Text(name, manipulators: new Clickable(OnSelected)) .WithStyle(new(flexGrow: 1, padding: new(left: offset))) .WithStyle(textStyle) + .WithConditionalStyle(node.Crashed, crashedTextStyle) .WithConditionalStyle(selected, selectedStyle), () => { var content = children.Select((child, i) => RenderNode(child, level + 1).Id(i+1)); @@ -222,7 +223,7 @@ private static IComponent RenderNode(CompositionContext.InspectedNode node, int nobToggleOnly: true, headerContainer: HeaderContainer, contentContainer: ContentContainer, - header: Text(name, manipulators: new Clickable(OnSelected)).WithStyle(textStyle), + header: Text(name, manipulators: new Clickable(OnSelected)).WithStyle(textStyle).WithConditionalStyle(node.Crashed, crashedTextStyle), content: Col(content).WithStyle(fillStyle) ).WithStyle(fillStyle); })); @@ -259,6 +260,7 @@ private static List GetInstances() => private static readonly Style centerItemsStyle = new(alignItems: Align.Center); private static readonly Style selectedStyle = new(backgroundColor: new Color(0.17f, 0.36f, 0.53f)); private static readonly Style textStyle = new(color: Color.white); + private static readonly Style crashedTextStyle = new(color: Color.red); private static readonly Style leftPad = new(padding: new(left: 8)); } } \ No newline at end of file diff --git a/Runtime/CompositionContext.cs b/Runtime/CompositionContext.cs index b584d48..fb250a5 100644 --- a/Runtime/CompositionContext.cs +++ b/Runtime/CompositionContext.cs @@ -254,6 +254,7 @@ [PublicAPI] public class InspectedNode public string Name => entry.Component.ToString(); public IComponent Component => entry.Component; public int Id => entry.Id; + public bool Crashed => entry.Crashed; public VisualElement RenderedElement => entry.PreviouslyRendered; public ReadOnlyDictionary Contexts => entry.LocalContexts; diff --git a/package.json b/package.json index 75b6088..1ee9139 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "com.niikelion.ui.lithium", - "version": "2.1.0", + "version": "2.1.1", "displayName": "Lithium UI", "description": "Reactive UI library designed for editor tools creation.", "unity": "6000.0",