Example #1
0
        public void SetItemSize(int itemIndex, float size)
        {
            int           groupIndex   = itemIndex / mItemMaxCountPerGroup;
            int           indexInGroup = itemIndex % mItemMaxCountPerGroup;
            ItemSizeGroup tGroup       = mItemSizeGroupList[groupIndex];
            float         changedSize  = tGroup.SetItemSize(indexInGroup, size);

            if (changedSize != 0f)
            {
                if (groupIndex < mDirtyBeginIndex)
                {
                    mDirtyBeginIndex = groupIndex;
                }
            }
            mTotalSize += changedSize;
            if (groupIndex > mMaxNotEmptyGroupIndex && size > 0)
            {
                mMaxNotEmptyGroupIndex = groupIndex;
            }
        }