Exemplo n.º 1
0
 private void LoadElement(ThemeElementData data, Theme.ColorMode colorMode)
 {
     if (data != null)
     {
         elementImage.sprite = data.GetElementSprite();
         elementImage.type   = data.GetSpriteType();
         elementImage.color  = data.GetColorByMode(colorMode);
     }
 }
Exemplo n.º 2
0
    public override void LoadElement(Theme theme, Theme.ColorMode colorMode)
    {
        ThemeElementData data = theme.generalUIThemeDictionary.GetElementData(toggled ? secondaryKey : primaryKey);

        if (data != null)
        {
            elementImage.sprite = data.GetElementSprite();
            elementImage.type   = data.GetSpriteType();
            elementImage.color  = data.GetColorByMode(colorMode);
        }
    }
    public override void LoadElement(Theme theme, Theme.ColorMode colorMode)
    {
        ThemeElementData data = theme.gameUIThemeDictionary.GetElementData(currentKey);

        if (data != null)
        {
            elementImage.sprite = data.GetElementSprite();
            elementImage.type   = data.GetSpriteType();
            elementImage.color  = data.GetColorByMode(colorMode);
        }
    }
Exemplo n.º 4
0
 public override void LoadElement(Theme theme, Theme.ColorMode colorMode)
 {
     if (theme != null)
     {
         ThemeElementData data = theme.generalUIThemeDictionary.GetElementData(highlighted ? highlightKey : normalKey);
         if (data != null)
         {
             targetImage.sprite = data.GetElementSprite();
             targetImage.color  = data.GetColorByMode(colorMode);
         }
     }
 }
Exemplo n.º 5
0
    public void SetValue(int index, ThemeElementData newData)
    {
        if (values.Count - 1 > index || index < 0)
        {
            return;
        }

        ThemeElementData currentData = values[index];

        currentData.SetColorDictionary(newData.GetDictionary());
        currentData.SetSprite(newData.GetElementSprite());
    }
Exemplo n.º 6
0
    private void DrawThemeData(string dataTitle, ThemeElementData data)
    {
        EditorGUILayout.LabelField($"{dataTitle} Data", EditorStyles.boldLabel);

        EditorGUILayout.BeginHorizontal();
        data.SetSprite((Sprite)EditorGUILayout.ObjectField(data.GetElementSprite(), typeof(Sprite), false, GUILayout.MaxWidth(200f)));
        data.SetSpriteType((Image.Type)EditorGUILayout.EnumPopup(data.GetSpriteType()));
        EditorGUILayout.EndHorizontal();

        ColorDictionary dictionary = data.GetDictionary();

        DrawColorDictionary(dictionary);
    }