Example #1
0
 protected virtual void OnLocked()
 {
     backgroundImage.color  = stylesheet.GetValue <Color>(lockedColorPreset);
     foregroundImage.sprite = stylesheet.GetValue <Sprite>(lockSpritePreset);
     foregroundImage.color  = stylesheet.GetValue <Color>(lockColorPreset);
     text.text = "";
 }
Example #2
0
    private Color GetTextColor()
    {
        IStylesheet stylesheet = Main.StaticData.UI.Stylesheet;
        Color       result     = stylesheet.GetValue <Color>(textColorPreset);

        result.a *= alphaMultiplier;
        return(result);
    }
Example #3
0
    protected override void LoadDataInternal()
    {
        IStylesheet stylesheet = Main.StaticData.UI.Stylesheet;
        int         i          = 0;

        Text text = gameObject.GetComponent <Text>();

        if (text != null)
        {
            text.fontSize = (int)stylesheet.GetValue <float>(fontSizePreset);
            text.color    = GetTextColor();
        }

        TMPro.TextMeshProUGUI tmpText = gameObject.GetComponent <TMPro.TextMeshProUGUI>();
        if (tmpText != null)
        {
            tmpText.fontSize = stylesheet.GetValue <float>(fontSizePreset);
            tmpText.color    = GetTextColor();
        }
    }