forked from MattRix/UnityDecompiled
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTestGUI.cs
More file actions
89 lines (79 loc) · 2.34 KB
/
Copy pathTestGUI.cs
File metadata and controls
89 lines (79 loc) · 2.34 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
using System;
using UnityEditor.IMGUI.Controls;
using UnityEditorInternal;
using UnityEngine;
namespace UnityEditor.TreeViewExamples
{
internal class TestGUI : TreeViewGUI
{
private Texture2D m_FolderIcon = EditorGUIUtility.FindTexture(EditorResourcesUtility.folderIconName);
private Texture2D m_Icon = EditorGUIUtility.FindTexture("boo Script Icon");
private GUIStyle m_LabelStyle;
private GUIStyle m_LabelStyleRightAlign;
private float[] columnWidths
{
get
{
return this.m_TreeView.state.columnWidths;
}
}
public TestGUI(TreeViewController treeView) : base(treeView)
{
}
protected override Texture GetIconForItem(TreeViewItem item)
{
return (!item.hasChildren) ? this.m_Icon : this.m_FolderIcon;
}
protected override void RenameEnded()
{
}
protected override void SyncFakeItem()
{
}
protected override void OnContentGUI(Rect rect, int row, TreeViewItem item, string label, bool selected, bool focused, bool useBoldFont, bool isPinging)
{
if (Event.current.rawType == EventType.Repaint)
{
if (this.m_LabelStyle == null)
{
this.m_LabelStyle = new GUIStyle(TreeViewGUI.s_Styles.lineStyle);
RectOffset arg_56_0 = this.m_LabelStyle.padding;
int num = 6;
this.m_LabelStyle.padding.right = num;
arg_56_0.left = num;
this.m_LabelStyleRightAlign = new GUIStyle(TreeViewGUI.s_Styles.lineStyle);
RectOffset arg_8F_0 = this.m_LabelStyleRightAlign.padding;
num = 6;
this.m_LabelStyleRightAlign.padding.left = num;
arg_8F_0.right = num;
this.m_LabelStyleRightAlign.alignment = TextAnchor.MiddleRight;
}
if (selected)
{
TreeViewGUI.s_Styles.selectionStyle.Draw(rect, false, false, true, focused);
}
if (isPinging || this.columnWidths == null || this.columnWidths.Length == 0)
{
base.OnContentGUI(rect, row, item, label, selected, focused, useBoldFont, isPinging);
}
else
{
Rect rect2 = rect;
for (int i = 0; i < this.columnWidths.Length; i++)
{
rect2.width = this.columnWidths[i];
if (i == 0)
{
base.OnContentGUI(rect2, row, item, label, selected, focused, useBoldFont, isPinging);
}
else
{
GUI.Label(rect2, "Zksdf SDFS DFASDF ", (i % 2 != 0) ? this.m_LabelStyleRightAlign : this.m_LabelStyle);
}
rect2.x += rect2.width;
}
}
}
}
}
}