Пример #1
0
    public void SwitchActiveItem()
    {
        Int32 num = this.dataTracker[this.activeNumber];

        if (this.dataTracker.ContainsKey(this.activeNumber + this.Column))
        {
            Int32           index     = this.dataTracker[this.activeNumber + this.Column];
            Transform       transform = this.itemsPool[index];
            RecycleListItem component = this.itemsPool[index].GetComponent <RecycleListItem>();
            if (component.VerifyVisibility())
            {
                ButtonGroupState.ActiveButton = transform.gameObject;
                return;
            }
        }
        if (this.dataTracker.ContainsKey(this.activeNumber - this.Column))
        {
            Int32           index2     = this.dataTracker[this.activeNumber - this.Column];
            Transform       transform2 = this.itemsPool[index2];
            RecycleListItem component2 = this.itemsPool[index2].GetComponent <RecycleListItem>();
            if (component2.VerifyVisibility())
            {
                ButtonGroupState.ActiveButton = transform2.gameObject;
                return;
            }
        }
    }
Пример #2
0
 private void onScrollFinished()
 {
     if (this.isEnable)
     {
         this.isScrollMove = false;
         ButtonGroupState.MuteActiveSound = true;
         this.CheckScrollPosition();
         foreach (Object obj in this.ScrollViewPanel.transform.GetChild(0))
         {
             Transform  transform  = (Transform)obj;
             GameObject gameObject = transform.gameObject;
             if (gameObject.activeSelf)
             {
                 ScrollItemKeyNavigation component = gameObject.GetComponent <ScrollItemKeyNavigation>();
                 component.enabled = true;
                 component.CheckVisibility();
                 RecycleListItem component2 = gameObject.GetComponent <RecycleListItem>();
                 if (component2)
                 {
                     component2.CheckVisibilty();
                 }
             }
         }
         ButtonGroupState.MuteActiveSound = false;
     }
 }
Пример #3
0
 public void CheckAllVisibilty()
 {
     foreach (Transform transform in this.itemsPool)
     {
         RecycleListItem component = transform.gameObject.GetComponent <RecycleListItem>();
         component.CheckVisibilty();
     }
 }
Пример #4
0
 public void CheckScrollPosition()
 {
     if (this.isEnable)
     {
         this.isScrollMove = false;
         if (this.listPopulator != (UnityEngine.Object)null)
         {
             if (this.listPopulator.ItemCount > this.listPopulator.VisibleItemCount)
             {
                 Boolean isUp   = true;
                 Boolean isDown = true;
                 if (this.listPopulator.DataTracker.ContainsKey(0))
                 {
                     Transform       transform = this.listPopulator.ItemsPool[this.listPopulator.DataTracker[0]];
                     RecycleListItem component = transform.gameObject.GetComponent <RecycleListItem>();
                     if (component.VerifyVisibility())
                     {
                         isUp = false;
                     }
                 }
                 Int32 key = this.listPopulator.ItemCount - 1;
                 if (this.listPopulator.DataTracker.ContainsKey(key))
                 {
                     Transform       transform2 = this.listPopulator.ItemsPool[this.listPopulator.DataTracker[key]];
                     RecycleListItem component2 = transform2.gameObject.GetComponent <RecycleListItem>();
                     if (component2.VerifyVisibility())
                     {
                         isDown = false;
                     }
                 }
                 this.DisplayScrollButton(isUp, isDown);
             }
             else
             {
                 this.DisplayScrollButton(false, false);
             }
         }
         else
         {
             Boolean isUp2;
             Boolean isDown2;
             if (this.Scrollbar.barSize < 1f)
             {
                 isUp2   = (this.Scrollbar.value > 0.02f);
                 isDown2 = (this.Scrollbar.value < 0.98f);
             }
             else
             {
                 isUp2   = false;
                 isDown2 = false;
             }
             this.DisplayScrollButton(isUp2, isDown2);
         }
     }
 }
Пример #5
0
 private void Start()
 {
     if (ID == -1)
     {
         ID = gameObject.transform.GetSiblingIndex();
     }
     listItem      = gameObject.GetComponent <RecycleListItem>();
     scrollView    = ScrollPanel.GetComponent <UIScrollView>();
     listPopulator = ScrollPanel.GetComponent <RecycleListPopulator>();
     itemHeight    = gameObject.GetComponent <UIWidget>().height;
 }
Пример #6
0
 private Boolean CheckNeedToJump(Int32 newActiveIndex)
 {
     if (this.dataTracker.ContainsKey(newActiveIndex))
     {
         Transform transform = this.itemsPool[this.dataTracker[newActiveIndex]];
         if (transform)
         {
             RecycleListItem component = transform.GetComponent <RecycleListItem>();
             if (component.VerifyVisibility())
             {
                 return(false);
             }
         }
     }
     return(true);
 }
Пример #7
0
    public void itemHasChanged(GameObject go)
    {
        RecycleListItem component = go.GetComponent <RecycleListItem>();

        if (component)
        {
            this.activeNumber = component.ItemDataIndex;
        }
        foreach (Transform transform in this.itemsPool)
        {
            UIKeyNavigation component2 = transform.gameObject.GetComponent <UIKeyNavigation>();
            RecycleListItem component3 = transform.gameObject.GetComponent <RecycleListItem>();
            if (component2)
            {
                component2.startsSelected = (this.activeNumber == component3.ItemDataIndex);
            }
        }
    }
Пример #8
0
 public void CheckVisibility()
 {
     if (ButtonGroupState.ActiveButton == base.gameObject)
     {
         if (this.listPopulator != (UnityEngine.Object)null)
         {
             RecycleListItem component = base.gameObject.GetComponent <RecycleListItem>();
             if (!component.VerifyVisibility())
             {
                 this.listPopulator.SwitchActiveItem();
             }
         }
         else if (!this.ScrollPanel.IsVisible(this.VisionCheckWidget))
         {
             this.ChangeSelectItem();
         }
     }
 }
Пример #9
0
    private void InitListItemWithIndex(Transform item, Int32 dataIndex, Int32 poolIndex)
    {
        RecycleListItem component = item.GetComponent <RecycleListItem>();

        component.ItemDataIndex = dataIndex;
        component.ListPopulator = this;
        component.Panel         = this.panel;
        ScrollItemKeyNavigation component2 = item.GetComponent <ScrollItemKeyNavigation>();

        if (component2)
        {
            component2.ScrollButton = this.ScrollButton;
            component2.ScrollPanel  = this.panel;
        }
        UIKeyNavigation component3;

        if (ButtonGroupState.ActiveGroup == ItemUI.ItemArrangeGroupButton)
        {
            component3 = item.GetChild(1).GetComponent <UIKeyNavigation>();
        }
        else
        {
            component3 = item.GetComponent <UIKeyNavigation>();
        }
        if (component3)
        {
            component3.startsSelected = (this.activeNumber == dataIndex);
        }
        ButtonGroupState component4 = item.GetComponent <ButtonGroupState>();

        if (component4)
        {
            ButtonGroupState.RemoveActiveStateOnGroup(item.gameObject, component4.GroupName);
        }
        item.name = "Item " + dataIndex;
        this.PopulateListItemWithData(item, this.dataList[dataIndex], dataIndex, true);
        this.dataTracker.Add(this.itemsPool[poolIndex].GetComponent <RecycleListItem>().ItemDataIndex, this.itemsPool[poolIndex].GetComponent <RecycleListItem>().ItemNumber);
    }
Пример #10
0
    public IEnumerator ItemIsInvisible(Int32 itemNumber)
    {
        if (this.isUpdatingList)
        {
            yield return(null);
        }
        Int32           itemDataIndex = 0;
        Transform       item          = this.itemsPool[itemNumber];
        RecycleListItem infItem       = (RecycleListItem)null;

        this.isUpdatingList = true;
        if (this.dataList.Count > this.poolSize)
        {
            if (item.tag.Equals("Item List"))
            {
                itemDataIndex = item.GetComponent <RecycleListItem>().ItemDataIndex;
            }
            Int32 indexToCheck = 0;
            if (this.dataTracker.ContainsKey(itemDataIndex + 1))
            {
                infItem = this.itemsPool[this.dataTracker[itemDataIndex + 1]].GetComponent <RecycleListItem>();
                if (infItem != (UnityEngine.Object)null && infItem.VerifyVisibility())
                {
                    indexToCheck = itemDataIndex - this.extraBuffer / 2;
                    if (this.dataTracker.ContainsKey(indexToCheck))
                    {
                        for (Int32 i = indexToCheck; i >= 0; i--)
                        {
                            if (!this.dataTracker.ContainsKey(i))
                            {
                                this.scrollCursor = itemDataIndex - this.Column;
                                this.CheckEndOfList(this.scrollCursor, false);
                                break;
                            }
                            infItem = this.itemsPool[this.dataTracker[i]].GetComponent <RecycleListItem>();
                            if (infItem != (UnityEngine.Object)null && !infItem.VerifyVisibility())
                            {
                                item = this.itemsPool[this.dataTracker[i]];
                                if (i + this.poolSize < this.dataList.Count && i > -1)
                                {
                                    this.PrepareListItemWithIndex(item, i + this.poolSize, i);
                                    this.CheckEndOfList(this.scrollCursor, false);
                                }
                            }
                        }
                    }
                }
            }
            if (this.dataTracker.ContainsKey(itemDataIndex - 1))
            {
                infItem = this.itemsPool[this.dataTracker[itemDataIndex - 1]].GetComponent <RecycleListItem>();
                if (infItem != (UnityEngine.Object)null && infItem.VerifyVisibility())
                {
                    indexToCheck = itemDataIndex + this.extraBuffer / 2;
                    if (this.dataTracker.ContainsKey(indexToCheck))
                    {
                        for (Int32 j = indexToCheck; j < this.dataList.Count; j++)
                        {
                            if (!this.dataTracker.ContainsKey(j))
                            {
                                this.scrollCursor = itemDataIndex + this.Column;
                                this.CheckEndOfList(this.scrollCursor, true);
                                break;
                            }
                            infItem = this.itemsPool[this.dataTracker[j]].GetComponent <RecycleListItem>();
                            if (infItem != (UnityEngine.Object)null && !infItem.VerifyVisibility())
                            {
                                item = this.itemsPool[this.dataTracker[j]];
                                if (j - this.poolSize > -1 && j < this.dataList.Count)
                                {
                                    this.PrepareListItemWithIndex(item, j - this.poolSize, j);
                                    this.CheckEndOfList(this.scrollCursor, true);
                                }
                            }
                        }
                    }
                }
            }
        }
        else
        {
            this.CheckEndOfList(this.scrollCursor + this.Column, false);
            this.CheckEndOfList(this.scrollCursor - this.Column, true);
        }
        this.isUpdatingList = false;
        yield break;
    }