mirror of
https://github.com/Siccity/xNode.git
synced 2026-03-26 22:49:02 +08:00
A dictionary cant be changed while being enumerated.
Now clones the keys and gets/sets values.
This commit is contained in:
parent
1a02f4886c
commit
366dc4c0fd
@ -158,11 +158,13 @@ namespace XNodeEditor {
|
||||
//Label
|
||||
EditorGUILayout.LabelField("Types", EditorStyles.boldLabel);
|
||||
|
||||
//Clone keys so we can enumerate the dictionary and make changes.
|
||||
var typeColorKeys = new List<Type>(typeColors.Keys);
|
||||
|
||||
//Display type colors. Save them if they are edited by the user
|
||||
foreach (var typeColor in typeColors) {
|
||||
Type type = typeColor.Key;
|
||||
foreach (var type in typeColorKeys) {
|
||||
string typeColorKey = NodeEditorUtilities.PrettyName(type);
|
||||
Color col = typeColor.Value;
|
||||
Color col = typeColors[type];
|
||||
EditorGUI.BeginChangeCheck();
|
||||
EditorGUILayout.BeginHorizontal();
|
||||
col = EditorGUILayout.ColorField(typeColorKey, col);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user