コード例 #1
0
 // Token: 0x060021FA RID: 8698 RVA: 0x00092B8B File Offset: 0x00090D8B
 public void SetDisplayData(CarouselNavigationController.DisplayData newDisplayData)
 {
     if (newDisplayData.Equals(this.displayData))
     {
         return;
     }
     this.displayData = newDisplayData;
     this.Rebuild();
 }
コード例 #2
0
        // Token: 0x060021FB RID: 8699 RVA: 0x00092BAC File Offset: 0x00090DAC
        private void Rebuild()
        {
            this.buttonAllocator.AllocateElements(this.displayData.pageCount);
            int i     = 0;
            int count = this.buttonAllocator.elements.Count;

            while (i < count)
            {
                MPButton   mpbutton = this.buttonAllocator.elements[i];
                ColorBlock colors   = mpbutton.colors;
                colors.colorMultiplier = 1f;
                mpbutton.colors        = colors;
                mpbutton.onClick.RemoveAllListeners();
                CarouselNavigationController.DisplayData buttonDisplayData = new CarouselNavigationController.DisplayData(this.displayData.pageCount, i);
                mpbutton.onClick.AddListener(delegate()
                {
                    this.SetDisplayData(buttonDisplayData);
                    Action <int> action = this.onPageChangeSubmitted;
                    if (action == null)
                    {
                        return;
                    }
                    action(this.displayData.pageIndex);
                });
                i++;
            }
            if (this.displayData.pageIndex >= 0 && this.displayData.pageIndex < this.displayData.pageCount)
            {
                MPButton   mpbutton2 = this.buttonAllocator.elements[this.displayData.pageIndex];
                ColorBlock colors2   = mpbutton2.colors;
                colors2.colorMultiplier = 2f;
                mpbutton2.colors        = colors2;
            }
            bool flag          = this.displayData.pageCount > 1;
            bool interactable  = flag && (this.allowLooping || this.displayData.pageIndex > 0);
            bool interactable2 = flag && (this.allowLooping || this.displayData.pageIndex < this.displayData.pageCount - 1);

            if (this.leftButton)
            {
                this.leftButton.gameObject.SetActive(flag);
                this.leftButton.interactable = interactable;
            }
            if (this.rightButton)
            {
                this.rightButton.gameObject.SetActive(flag);
                this.rightButton.interactable = interactable2;
            }
        }