Пример #1
0
        private void StyleText(Text text)
        {
            if (normalText.HasValue)
            {
                var clr = new UIStyleDirector.ColorSetting()
                {
                    apply = true, value = normalText.Value
                };
                var fnt = new UIStyleDirector.FontSetting()
                {
                    apply = true, value = text.font
                };
                var fsz = new UIStyleDirector.IntSetting()
                {
                    apply = false
                };
                var fss = new UIStyleDirector.FontStyleSetting()
                {
                    apply = false
                };
                var foc = new UIStyleDirector.ColorSetting()
                {
                    apply = true
                };
                var fow = new UIStyleDirector.FloatSetting()
                {
                    apply = true
                };

                TextStyler.ApplyTextStyle(text, clr, fnt, fsz, fss, foc, fow);
            }
        }
Пример #2
0
    private void SetDisabled(bool disabled = true)
    {
        float targetAlpha;

        if (disabled)
        {
            targetAlpha = 0.25f;
        }
        else
        {
            targetAlpha = 1;
        }
        foreach (var image in images)
        {
            Color color = image.color;
            color.a     = targetAlpha;
            image.color = color;
        }

        TextStyler textStyler = text.GetComponent <TextStyler>();

        if (textStyler != null)
        {
            textStyler.AlphaMultiplier = targetAlpha;
        }
    }