Exemple #1
0
        /// <summary>
        /// Init.
        /// </summary>
        protected override void Init()
        {
            base.Init();

            if (isInitedTime)
            {
                return;
            }

            isInitedTime = true;

            if (HoursScrollBlock != null)
            {
                HoursScrollBlock.gameObject.SetActive(Hours);

                HoursScrollBlock.Value          = HoursValue;
                HoursScrollBlock.Decrease       = () => Date = LoopedHours(-1);
                HoursScrollBlock.Increase       = () => Date = LoopedHours(+1);
                HoursScrollBlock.IsInteractable = IsActive;

                HoursScrollBlock.Init();
            }

            if (MinutesScrollBlock != null)
            {
                MinutesScrollBlock.gameObject.SetActive(Minutes);

                MinutesScrollBlock.Value          = MinutesValue;
                MinutesScrollBlock.Decrease       = () => Date = LoopedMinutes(-1);
                MinutesScrollBlock.Increase       = () => Date = LoopedMinutes(+1);
                MinutesScrollBlock.IsInteractable = IsActive;

                MinutesScrollBlock.Init();
            }

            if (SecondsScrollBlock != null)
            {
                SecondsScrollBlock.gameObject.SetActive(Seconds);

                SecondsScrollBlock.Value          = SecondsValue;
                SecondsScrollBlock.Decrease       = () => Date = LoopedSeconds(-1);
                SecondsScrollBlock.Increase       = () => Date = LoopedSeconds(+1);
                SecondsScrollBlock.IsInteractable = IsActive;

                SecondsScrollBlock.Init();
            }

            if (AMPMScrollBlock != null)
            {
                AMPMScrollBlock.gameObject.SetActive(AMPM);

                AMPMScrollBlock.Value          = AMPMValue;
                AMPMScrollBlock.Decrease       = () => Date = LoopedHours(-1, 12);
                AMPMScrollBlock.Increase       = () => Date = LoopedHours(+1, 12);
                AMPMScrollBlock.IsInteractable = IsActive;

                AMPMScrollBlock.Init();
            }
        }
Exemple #2
0
        /// <summary>
        /// Init.
        /// </summary>
        protected override void Init()
        {
            if (isInitedDate)
            {
                return;
            }

            isInitedDate = true;

            if (YearsScrollBlock != null)
            {
                YearsScrollBlock.gameObject.SetActive(Years);

                YearsScrollBlock.Value          = YearsValue;
                YearsScrollBlock.Decrease       = () => Date = LoopedYears(-1);
                YearsScrollBlock.Increase       = () => Date = LoopedYears(+1);
                YearsScrollBlock.IsInteractable = IsActive;

                YearsScrollBlock.Init();
            }

            if (MonthsScrollBlock != null)
            {
                MonthsScrollBlock.gameObject.SetActive(Months);

                MonthsScrollBlock.Value          = MonthsValue;
                MonthsScrollBlock.Decrease       = () => Date = LoopedMonths(-1);
                MonthsScrollBlock.Increase       = () => Date = LoopedMonths(+1);
                MonthsScrollBlock.IsInteractable = IsActive;

                MonthsScrollBlock.Init();
            }

            if (DaysScrollBlock != null)
            {
                DaysScrollBlock.gameObject.SetActive(Days);

                DaysScrollBlock.Value          = DaysValue;
                DaysScrollBlock.Decrease       = () => Date = LoopedDays(-1);
                DaysScrollBlock.Increase       = () => Date = LoopedDays(+1);
                DaysScrollBlock.IsInteractable = IsActive;

                DaysScrollBlock.Init();
            }
        }