Example #1
0
        public void AddButton(RedirectLinkData data)
        {
            var button = Instantiate(buttonPrefab, transform);

            button.Prepare(data);
            buttonsSpawned.Add(button);
        }
Example #2
0
        public void Prepare(RedirectLinkData data)
        {
            Type             = data.Type;
            url              = data.Url;
            iconImage.sprite = data.Icon;

            var backgroundColor = data.CustomBackgroundColor.Color;

            if (backgroundColor.HasValue)
            {
                var backgroundImage = GetComponent <Image>();
                backgroundImage.color = backgroundColor.Value;
            }
        }