public void Copy(ImageStyle imageStyle)
 {
     type      = imageStyle.type;
     sprite    = imageStyle.sprite;
     autoColor = imageStyle.autoColor;
     color     = imageStyle.color;
     width     = imageStyle.width;
     height    = imageStyle.height;
 }
        public ImageStyle Clone()
        {
            var imageStyle = new ImageStyle();

            imageStyle.type      = type;
            imageStyle.sprite    = sprite;
            imageStyle.autoColor = autoColor;
            imageStyle.color     = color;
            imageStyle.width     = width;
            imageStyle.height    = height;
            return(imageStyle);
        }
 public static void SetBackground(Image background, ImageStyle imageStyle)
 {
     if (background == null)
     {
         return;
     }
     if (imageStyle.show)
     {
         background.sprite = imageStyle.sprite;
         background.color  = imageStyle.color;
         background.type   = imageStyle.type;
     }
     else
     {
         background.sprite = null;
         background.color  = Color.clear;
     }
 }
Beispiel #4
0
        public static void SetLegendBackground(Legend legend, ImageStyle style)
        {
            var background = legend.context.background;

            if (background == null)
            {
                return;
            }
            ChartHelper.SetActive(background, style.show);
            if (!style.show)
            {
                return;
            }
            var rect = background.gameObject.GetComponent <RectTransform>();

            rect.localPosition = legend.context.center;
            rect.sizeDelta     = new Vector2(legend.context.width, legend.context.height);
            ChartHelper.SetBackground(background, style);
        }
 public void SetBackground(ImageStyle imageStyle)
 {
     ChartHelper.SetBackground(m_Background, imageStyle);
 }