mirror of
https://github.com/Siccity/xNode.git
synced 2025-12-20 17:26:02 +08:00
Fixed formatting
This commit is contained in:
parent
842101720e
commit
8d445fa3f4
@ -135,9 +135,9 @@ namespace XNodeEditor {
|
|||||||
|
|
||||||
//Display type colors. Save them if they are edited by the user
|
//Display type colors. Save them if they are edited by the user
|
||||||
foreach (var typeColor in typeColors) {
|
foreach (var typeColor in typeColors) {
|
||||||
Type type = typeColor.Key;
|
Type type = typeColor.Key;
|
||||||
string typeColorKey = NodeEditorUtilities.PrettyName(type);
|
string typeColorKey = NodeEditorUtilities.PrettyName(type);
|
||||||
Color col = typeColor.Value;
|
Color col = typeColor.Value;
|
||||||
EditorGUI.BeginChangeCheck();
|
EditorGUI.BeginChangeCheck();
|
||||||
EditorGUILayout.BeginHorizontal();
|
EditorGUILayout.BeginHorizontal();
|
||||||
col = EditorGUILayout.ColorField(typeColorKey, col);
|
col = EditorGUILayout.ColorField(typeColorKey, col);
|
||||||
@ -185,9 +185,9 @@ namespace XNodeEditor {
|
|||||||
public static Color GetTypeColor(System.Type type) {
|
public static Color GetTypeColor(System.Type type) {
|
||||||
VerifyLoaded();
|
VerifyLoaded();
|
||||||
if (type == null) return Color.gray;
|
if (type == null) return Color.gray;
|
||||||
Color col;
|
Color col;
|
||||||
if (!typeColors.TryGetValue(type, out col)) {
|
if (!typeColors.TryGetValue(type, out col)) {
|
||||||
string typeName = type.PrettyName();
|
string typeName = type.PrettyName();
|
||||||
if (settings[lastKey].typeColors.ContainsKey(typeName)) typeColors.Add(type, settings[lastKey].typeColors[typeName]);
|
if (settings[lastKey].typeColors.ContainsKey(typeName)) typeColors.Add(type, settings[lastKey].typeColors[typeName]);
|
||||||
else {
|
else {
|
||||||
#if UNITY_5_4_OR_NEWER
|
#if UNITY_5_4_OR_NEWER
|
||||||
@ -195,8 +195,8 @@ namespace XNodeEditor {
|
|||||||
#else
|
#else
|
||||||
UnityEngine.Random.seed = typeName.GetHashCode();
|
UnityEngine.Random.seed = typeName.GetHashCode();
|
||||||
#endif
|
#endif
|
||||||
col = new Color(UnityEngine.Random.value, UnityEngine.Random.value, UnityEngine.Random.value);
|
col = new Color(UnityEngine.Random.value, UnityEngine.Random.value, UnityEngine.Random.value);
|
||||||
typeColors.Add(type, col);
|
typeColors.Add(type, col);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return col;
|
return col;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user