Пример #1
0
        /// <summary>
        /// Инициализация элемента карусели
        /// </summary>
        public void Setup(CarouselProps props, Action clickCallback)
        {
            if (mode == CarouselMode.All)
            {
                SetAll(props);
            }
            if (mode == CarouselMode.TextOnly)
            {
                SetText(props.Text);
            }
            if (mode == CarouselMode.ImageOnly)
            {
                SetImage(props.Sprite);
            }

            _value = props.Value;
            button.onClick.AddListener(clickCallback.Invoke);

            gameObject.SetActive(true);
        }
Пример #2
0
 private void SetAll(CarouselProps props)
 {
     SetText(props.Text);
     SetImage(props.Sprite);
 }