A game about forced loneliness, made by TACStudios
1using System.Linq;
2using UnityEngine;
3using UnityEngine.UIElements;
4
5namespace UnityEditor.ShaderGraph.Drawing
6{
7 class PropertyRow : VisualElement
8 {
9 VisualElement m_ContentContainer;
10 VisualElement m_LabelContainer;
11
12 public override VisualElement contentContainer
13 {
14 get { return m_ContentContainer; }
15 }
16
17 public VisualElement label
18 {
19 get { return (m_LabelContainer.childCount > 0) ? m_LabelContainer[0] : null; }
20 set
21 {
22 if (m_LabelContainer.childCount > 0)
23 {
24 m_LabelContainer.Clear();
25 }
26 m_LabelContainer.Add(value);
27 }
28 }
29
30 public PropertyRow(VisualElement label = null)
31 {
32 styleSheets.Add(Resources.Load<StyleSheet>("Styles/PropertyRow"));
33 VisualElement container = new VisualElement { name = "container" };
34 m_ContentContainer = new VisualElement { name = "content" };
35 m_LabelContainer = new VisualElement { name = "label" };
36 m_LabelContainer.Add(label);
37
38 container.Add(m_LabelContainer);
39 container.Add(m_ContentContainer);
40
41 hierarchy.Add(container);
42 }
43 }
44}