summaryrefslogtreecommitdiff
path: root/Assets/ActionTool/Editor/ActionEditorStyles.cs
blob: c7c15aafa08d2a19d92a5f3f9059ebe02b07f934 (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
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEditor;

namespace ActionTool
{
    internal class ActionEditorStyles
    {
        public GUIStyle textBold;

        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()
        {
            InitStyle(out textBold, GUI.skin.label, s => {
                s.fontStyle = FontStyle.Bold;
            });
        }

        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);
        }

    }
}