Exemple #1
0
    private void DrawColorDictionary(ColorDictionary dictionary)
    {
        int colorCount = Enum.GetNames(typeof(Theme.ColorMode)).Length;

        for (int i = 0; i < colorCount; i++)
        {
            Theme.ColorMode key = (Theme.ColorMode)i;
            if (!dictionary.Contains(key, out int index))
            {
                dictionary.Add(key, Color.white);
            }

            EditorGUILayout.BeginHorizontal();
            EditorGUILayout.LabelField($"{key} Color:", GUILayout.MaxWidth(150f));
            dictionary.SetValue(i, EditorGUILayout.ColorField(dictionary.GetValue(i), GUILayout.MaxWidth(150f)));
            EditorGUILayout.EndHorizontal();
        }
    }