blob: 664753efe2cfaaf498fb21f3e6d5c3bfbf599e09 (
plain)
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
|
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEditor;
namespace ActionTool
{
internal class ActionEditorStyles
{
public GUIStyle textBold;
public GUIStyle selectObj;
public GUIStyle textSmall;
Texture2D m_SelectIcon;
private static ActionEditorStyles s_instance;
public static ActionEditorStyles Get()
{
bool flag = s_instance == null;
if (flag)
{
s_instance = new ActionEditorStyles();
}
return s_instance;
}
private ActionEditorStyles()
{
m_SelectIcon = (Texture2D)Resources.Load<Texture2D>("select_white");
m_SelectIcon.filterMode = FilterMode.Point;
InitStyle(out textBold, GUI.skin.label, s => {
s.fontStyle = FontStyle.Bold;
});
InitStyle(out selectObj, GUI.skin.button, s => {
s.normal.background = m_SelectIcon;
s.active.background = m_SelectIcon;
s.focused.background = m_SelectIcon;
s.hover.background = m_SelectIcon;
s.normal.background = m_SelectIcon;
});
InitStyle(out textSmall, GUI.skin.label, s => {
s.fontSize = 8;
});
}
private delegate void Initter(GUIStyle style);
private static void InitStyle(out GUIStyle normal, GUIStyle other, Initter initter)
{
normal = new GUIStyle(other);
initter(normal);
}
private static void InitStyle(out GUIStyle normal, Initter initter)
{
normal = new GUIStyle();
initter(normal);
}
}
}
|