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 {};
24 children
= new ObservableList
<Widget
>();
25 children
.ItemAdded
+= OnItemAdded
;
26 children
.ItemRemoved
+= OnItemRemoved
;
29 protected virtual void OnItemAdded(ObservableList
<Widget
> sender
, ListChangedEventArgs
<Widget
> e
)
40 protected virtual void OnItemRemoved(ObservableList
<Widget
> sender
, ListChangedEventArgs
<Widget
> e
)
51 public void SetDirty()
53 foreach (var child
in children
)
54 child
.GenerateQueryPath();
59 public override int GetHashCode()
62 hash
= hash
* 23 + displayName
.GetHashCode();
64 foreach (var child
in children
)
65 hash
= hash
* 23 + child
.GetHashCode();