Exemple #1
0
        /// <summary>
        /// 改变Item
        /// </summary>
        /// <param name="pageItem"></param>
        /// <param name="data"></param>
        public virtual void ChangeChildItem(YxPageItem pageItem, YxData data)
        {
            pageItem.UpdateView(data);
            var index = ItemViews.FindIndex(item => item != null && item == pageItem);

            if (index > -1)
            {
                ItemDatas[index] = data;
                if (gameObject.activeInHierarchy)
                {
                    StartCoroutine(OnItemChangeAction.WaitExcuteCalls());
                }
            }
        }
Exemple #2
0
        /// <summary>
        /// 删除子对象
        /// </summary>
        /// <param name="pageItem"></param>
        public virtual void RemoveChildItem(YxPageItem pageItem)
        {
            var index = ItemViews.FindIndex(item => item != null && item == pageItem);

            if (index > -1)
            {
                if (gameObject.activeInHierarchy)
                {
                    ItemDatas.RemoveAt(index);
                    ItemViews.RemoveAt(index);
                    _curOffset++;
                    _totalCount--;
                    pageItem.Hide();
                    StartCoroutine(OnItemRemoveAction.WaitExcuteCalls());
                }
            }
        }