-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathResolveEditorSettings.cs
More file actions
115 lines (89 loc) · 3.15 KB
/
ResolveEditorSettings.cs
File metadata and controls
115 lines (89 loc) · 3.15 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
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
#if UNITY_EDITOR
using UnityEditor;
#endif
using UnityEngine;
namespace Quartzified.Resolve.Editor
{
public class ResolveEditorSettings : ScriptableObject
{
#if UNITY_EDITOR
static ResolveEditorSettings _instance;
public static ResolveEditorSettings instance
{
get
{
if (_instance != null)
{
return _instance;
}
return _instance = GetAssets();
}
set
{
_instance = value;
}
}
#endif
[Header("Debug Message")]
public bool adjustMessageColor = false;
public bool adjustNumeralColor = true;
[Space]
public Color defaultMessageColor = Color.white;
public Color warningMessageColor = Color.yellow;
public Color errorMessageColor = Color.red;
[Space]
public Color numeralMessageColor = Color.green;
[Header("Debug Tag")]
public bool enableDebugTag = true;
public bool enableDebugColor = false;
[Space]
public Color debugColor = Color.white;
public Color warningColor = Color.yellow;
public Color errorColor = Color.red;
[Header("Time Stamping")]
public bool showTimestampAtStart = true;
public bool showTimestamp = true;
public bool showMilliseconds;
[Space]
public Color timeStampColor = Color.white;
[Header("Type Coloring")]
public bool enableTypeColoring = true;
[Space]
public int ColorSeed = 417;
public float ColorSaturation = 0.6f;
public float ColorValue = 0.95f;
#if UNITY_EDITOR
// While Runtime scripts do not require access to this class
// The Utility script does... So we remove Editor related code for runtime
// To not cause any issues and prevent future issues
public static ResolveEditorSettings GetAssets()
{
if (_instance != null)
return _instance;
string[] guids = AssetDatabase.FindAssets(string.Format("t:{0}", typeof(ResolveEditorSettings).Name));
for (int i = 0; i < guids.Length; i++)
{
instance = AssetDatabase.LoadAssetAtPath<ResolveEditorSettings>(AssetDatabase.GUIDToAssetPath(guids[i]));
if (_instance != null)
return _instance;
}
return _instance = CreateAssets();
}
internal static ResolveEditorSettings CreateAssets()
{
string path = EditorUtility.SaveFilePanelInProject("Save as...", "Resolve Editor Settings", "asset", "");
if (path.Length > 0)
{
ResolveEditorSettings settings = CreateInstance<ResolveEditorSettings>();
AssetDatabase.CreateAsset(settings, path);
AssetDatabase.SaveAssets();
AssetDatabase.Refresh();
EditorUtility.FocusProjectWindow();
Selection.activeObject = settings;
return settings;
}
return null;
}
#endif
}
}