Ejemplo n.º 1
0
        protected void DrawSubAssetRowBg(int startSubAssetIndex, int endSubAssetIndex, bool continued)
        {
            Rect  rect1 = LayoutParams.CalculateItemRect(startSubAssetIndex);
            Rect  rect2 = LayoutParams.CalculateItemRect(endSubAssetIndex);
            float num1  = 30f;
            float num2  = 128f;
            float num3  = rect1.width / num2;
            float num4  = 9f * num3;
            float num5  = 4f;
            float num6  = startSubAssetIndex % this.LayoutParams.Columns != 0
                ? this.LayoutParams.HorizontalSpacing + num3 * 10f
                : 18f * num3;
            Rect position1 = new Rect(rect1.x - num6, rect1.y + num5, num1 * num3,
                                      (float)((double)rect1.width - (double)num5 * 2.0 + (double)num4 - 1.0));

            position1.y      = Mathf.Round(position1.y);
            position1.height = Mathf.Ceil(position1.height);
            GridView.s_Styles.subAssetBg.Draw(position1, GUIContent.none, false, false, false, false);
            float width     = num1 * num3;
            bool  flag      = endSubAssetIndex % this.LayoutParams.Columns == this.LayoutParams.Columns - 1;
            float num7      = continued || flag ? 16f * num3 : 8f * num3;
            Rect  position2 = new Rect(rect2.xMax - width + num7, rect2.y + num5, width, position1.height);

            position2.y      = Mathf.Round(position2.y);
            position2.height = Mathf.Ceil(position2.height);
            (!continued ? GridView.s_Styles.subAssetBgCloseEnded : GridView.s_Styles.subAssetBgOpenEnded).Draw(
                position2, GUIContent.none, false, false, false, false);
            position1        = new Rect(position1.xMax, position1.y, position2.xMin - position1.xMax, position1.height);
            position1.y      = Mathf.Round(position1.y);
            position1.height = Mathf.Ceil(position1.height);
            GridView.s_Styles.subAssetBgMiddle.Draw(position1, GUIContent.none, false, false, false, false);
        }
Ejemplo n.º 2
0
        protected override void DrawInternal(int beginItemIndex, int endItemIndex)
        {
            if (!ListMode && !m_Owner.ViewHandler.SearchMode)
            {
                DrawSubAssetBackground(beginItemIndex, endItemIndex);
            }

            int itemIndex = beginItemIndex;

            while (true)
            {
                if (itemIndex > endItemIndex || itemIndex >= ItemCount)
                {
                    break;
                }

                DrawItem(LayoutParams.CalculateItemRect(itemIndex), m_DataSource.GetItemIdByIndex(itemIndex),
                         itemIndex);
                ++itemIndex;
            }
        }