示例#1
0
    // Token: 0x06002A17 RID: 10775 RVA: 0x00467430 File Offset: 0x00465630
    public void AddItem(float width, bool bMoveToLast = false)
    {
        ItemData_H itemData_H = new ItemData_H();

        itemData_H.m_Width     = width;
        itemData_H.m_LimitLeft = this.m_TotalWidth;
        this.m_DataList.Add(itemData_H);
        this.m_TotalWidth         += width + this.m_Range;
        this.ContentRect.sizeDelta = new Vector2(this.m_TotalWidth, 0f);
        int idx;

        if (this.m_DataList.Count >= this.m_FirstIdx)
        {
            idx = this.m_FirstIdx;
        }
        else
        {
            idx            = 0;
            this.m_LastIdx = 0;
        }
        this.UpdatePanelPostion(idx);
        if (bMoveToLast)
        {
            if (this.ContentRect.sizeDelta.y >= this.m_PanelWidth)
            {
                this.ContentRect.anchoredPosition = new Vector2(0f, 0f);
            }
            else
            {
                this.ContentRect.anchoredPosition = new Vector2(-(this.m_TotalWidth - this.m_PanelWidth), 0f);
            }
        }
        this.MyUpdate();
    }
示例#2
0
    // Token: 0x06002A19 RID: 10777 RVA: 0x00467668 File Offset: 0x00465868
    public void AddNewDataHeight(List <float> _DataHeight, float newWidth, bool IsSetBeginPos = true)
    {
        this.m_TotalWidth = newWidth;
        this.m_DataList.Clear();
        this.m_TotalWidth = this.m_Border;
        for (int i = 0; i < _DataHeight.Count; i++)
        {
            ItemData_H itemData_H = new ItemData_H();
            itemData_H.m_Width     = _DataHeight[i];
            itemData_H.m_LimitLeft = this.m_TotalWidth;
            this.m_DataList.Add(itemData_H);
            this.m_TotalWidth += _DataHeight[i] + this.m_Range;
        }
        this.ContentRect.sizeDelta = new Vector2(this.m_TotalWidth, 0f);
        if (IsSetBeginPos)
        {
            this.ContentRect.anchoredPosition = new Vector2(0f, 0f);
            this.beginIndex = 0;
            this.m_FirstIdx = 0;
            this.m_LastIdx  = 0;
        }
        this.UpdatePanelPostion(this.m_FirstIdx);
        this.MyUpdate();
        CScrollRect component = base.gameObject.GetComponent <CScrollRect>();

        if (component != null)
        {
            component.StopMovement();
        }
    }
示例#3
0
    // Token: 0x06002A24 RID: 10788 RVA: 0x004680D4 File Offset: 0x004662D4
    private float GetTotalWidth(List <float> _DataWidth, float border, float range)
    {
        float num = border;

        this.m_DataList = new List <ItemData_H>(_DataWidth.Count);
        for (int i = 0; i < _DataWidth.Count; i++)
        {
            ItemData_H itemData_H = new ItemData_H();
            itemData_H.m_Width     = _DataWidth[i];
            itemData_H.m_LimitLeft = num;
            this.m_DataList.Add(itemData_H);
            num += _DataWidth[i] + range;
        }
        return(num);
    }