post processing
[WindSway-HDRP.git] / Library / PackageCache / com.unity.render-pipelines.high-definition@4.10.0-preview / Runtime / Core / Debugging / DebugUI.Panel.cs
blobed20be95d0ab9dcffc5cbf797a1c08908d5152ff
1 using System;
3 namespace UnityEngine.Experimental.Rendering
5 public partial class DebugUI
7 // Root panel class - we don't want to extend Container here because we need a clear
8 // separation between debug panels and actual widgets
9 public class Panel : IContainer
11 public Flags flags { get; set; }
12 public string displayName { get; set; }
13 public string queryPath { get { return displayName; } }
15 public bool isEditorOnly { get { return (flags & Flags.EditorOnly) != 0; } }
16 public bool isRuntimeOnly { get { return (flags & Flags.RuntimeOnly) != 0; } }
17 public bool editorForceUpdate { get { return (flags & Flags.EditorForceUpdate) != 0; } }
19 public ObservableList<Widget> children { get; private set; }
20 public event Action<Panel> onSetDirty = delegate {};
22 public Panel()
24 children = new ObservableList<Widget>();
25 children.ItemAdded += OnItemAdded;
26 children.ItemRemoved += OnItemRemoved;
29 protected virtual void OnItemAdded(ObservableList<Widget> sender, ListChangedEventArgs<Widget> e)
31 if (e.item != null)
33 e.item.panel = this;
34 e.item.parent = this;
37 SetDirty();
40 protected virtual void OnItemRemoved(ObservableList<Widget> sender, ListChangedEventArgs<Widget> e)
42 if (e.item != null)
44 e.item.panel = null;
45 e.item.parent = null;
48 SetDirty();
51 public void SetDirty()
53 foreach (var child in children)
54 child.GenerateQueryPath();
56 onSetDirty(this);
59 public override int GetHashCode()
61 int hash = 17;
62 hash = hash * 23 + displayName.GetHashCode();
64 foreach (var child in children)
65 hash = hash * 23 + child.GetHashCode();
67 return hash;