示例#1
0
 // Token: 0x06002A3C RID: 10812 RVA: 0x00469D78 File Offset: 0x00467F78
 public void SetScrollViewIndexValue(ScrollViewIndexValue _velue)
 {
     this.headIndex = _velue.headIndex;
     this.endIndex  = _velue.endIndex;
     this.NowIndex  = _velue.NowIndex;
     this.MaxIndex  = _velue.MaxIndex;
     this.MaxSize   = _velue.MaxSize;
 }
示例#2
0
 // Token: 0x06002A3E RID: 10814 RVA: 0x00469E10 File Offset: 0x00468010
 public void AddHender(IUpDateRowItem _handler, bool bIsBatch = true, int _initDataSize = 0, int _MaxSize = 0, float posY = 0f, float[] _itemPosArray = null, float height = 0f, int[] _idArray = null, ScrollViewIndexValue _value = new ScrollViewIndexValue())
 {
     if (this.handler == null)
     {
         this.handler = _handler;
         this.InitScrollView(_value, bIsBatch, posY, _itemPosArray, height, _idArray);
         this.initDataSize = _initDataSize;
         this.MaxSize      = _MaxSize;
     }
 }
示例#3
0
    // Token: 0x06002A3D RID: 10813 RVA: 0x00469DC8 File Offset: 0x00467FC8
    public void SetContentPos(float posY = 0f, float[] _itemPosArray = null, float height = 0f, int[] _idArray = null, ScrollViewIndexValue _value = new ScrollViewIndexValue())
    {
        int           childCount       = base.transform.GetChild(0).childCount;
        RectTransform component        = base.transform.GetChild(0).GetComponent <RectTransform>();
        Vector2       anchoredPosition = component.anchoredPosition;

        anchoredPosition.y         = posY;
        component.anchoredPosition = anchoredPosition;
    }
示例#4
0
    // Token: 0x06002A2D RID: 10797 RVA: 0x00468AA0 File Offset: 0x00466CA0
    public void InitScrollView(ScrollViewIndexValue _value, bool _bIsBatch, float posY = 0f, float[] _itemPosArray = null, float _contentHeight = 0f, int[] _idArray = null)
    {
        this.preContentPosY = posY;
        this.bIsBatch       = _bIsBatch;
        CScrollRect cscrollRect = base.gameObject.AddComponent <CScrollRect>();

        cscrollRect.m_Handler         = this;
        cscrollRect.horizontal        = !this.bVertical;
        cscrollRect.vertical          = this.bVertical;
        cscrollRect.inertia           = true;
        cscrollRect.decelerationRate  = 0.35f;
        cscrollRect.scrollSensitivity = 1f;
        this.mask                 = base.gameObject.AddComponent <Mask>();
        this.mask.enabled         = true;
        this.mask.showMaskGraphic = false;
        this.rt             = base.gameObject.GetComponent <RectTransform>();
        this.Content        = new GameObject();
        this.Content.name   = "Content";
        this.rt             = this.Content.AddComponent <RectTransform>();
        cscrollRect.content = this.rt;
        this.Content.transform.SetParent(base.gameObject.transform, false);
        this.posV2.x = 0f;
        this.posV2.y = this.preContentPosY;
        if (this.bVertical)
        {
            this.tempV2.y = (float)(this.countY + 2) * (this.btnSzieY + this.rangeSzieY) + this.rangeSzieY;
        }
        else
        {
            this.tempV2.x = (float)(this.countX + 1) * (this.btnSzieX + this.rangeSzieX) + this.rangeSzieX;
        }
        if (this.preContentPosY > 0f)
        {
            this.tempV2.y = _contentHeight;
        }
        this.SetPos(this.rt, this.tempV2, this.posV2);
        this.itemPosArray = _itemPosArray;
        this.idArray      = _idArray;
        this.scrollValue  = _value;
        if (this.bIsBatch)
        {
            if (this.bVertical)
            {
                this.gameObjectLink = new ItemObject[this.countX * (this.countY + 2)];
                this.resGameObjs    = new GameObject[this.countX];
                this.btnIndexs      = new int[this.countX];
                for (int i = 0; i < this.countY + 2; i++)
                {
                    this.posV2.x = this.borderX;
                    this.posV2.y = -this.borderY - (float)i * (this.btnSzieY + this.rangeSzieY);
                    for (int j = 0; j < this.countX; j++)
                    {
                        this.posV2.x = this.borderX + (float)j * (this.btnSzieX + this.rangeSzieX);
                        int        num        = j + this.countX * i;
                        ItemObject itemObject = this.AddContentObj(this.posV2, num, this.customItem);
                        this.gameObjectLink[this.tempGameObjectLinkIndex] = itemObject;
                        this.resGameObjs[j] = itemObject.gameObject;
                        this.btnIndexs[j]   = num;
                        this.tempGameObjectLinkIndex++;
                    }
                    if (this.handler != null)
                    {
                        this.handler.UpDateRowItem(this.resGameObjs, this.btnIndexs);
                    }
                }
                this.endIndex = this.tempGameObjectLinkIndex - 1;
                this.showSize = base.gameObject.GetComponent <RectTransform>().sizeDelta.y;
            }
            else
            {
                this.gameObjectLink = new ItemObject[(this.countX + 2) * this.countY];
                this.resGameObjs    = new GameObject[this.countY];
                this.btnIndexs      = new int[this.countY];
                if (this.Arrangement == ScrollView.e_Arrangement.LeftToRight)
                {
                    for (int k = 0; k < this.countX + 2; k++)
                    {
                        this.posV2.x = this.borderX + (float)k * (this.btnSzieX + this.rangeSzieX);
                        this.posV2.y = -this.borderY;
                        for (int l = 0; l < this.countY; l++)
                        {
                            this.posV2.y = -this.borderY - (float)l * (this.btnSzieY + this.rangeSzieY);
                            int        num         = l + this.countY * k;
                            ItemObject itemObject2 = this.AddContentObj(this.posV2, num, this.customItem);
                            this.gameObjectLink[this.tempGameObjectLinkIndex] = itemObject2;
                            this.resGameObjs[l] = itemObject2.gameObject;
                            this.btnIndexs[l]   = num;
                            this.tempGameObjectLinkIndex++;
                        }
                        if (this.handler != null)
                        {
                            this.handler.UpDateRowItem(this.resGameObjs, this.btnIndexs);
                        }
                    }
                    this.endIndex = this.tempGameObjectLinkIndex - 1;
                    this.showSize = base.gameObject.GetComponent <RectTransform>().sizeDelta.x;
                }
            }
            this.initState = ScrollView.e_InitState.e_end;
            this.customItem.SetActive(false);
            this.SetContentSize(1);
            this.UpdateScrollRect();
        }
    }