| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657 |
- /*using UnityEngine;
- using UnityEngine.Events;
- using UnityEngine.EventSystems;
- using System;
- using System.Collections;
- using System.Collections.Generic;
- using ET;
- namespace UnityEngine.UI
- {
- public abstract class LoopScrollRectMulti : LoopScrollRectBase
- {
- [HideInInspector]
- [NonSerialized]
- public LoopScrollMultiDataSource dataSource = null;
-
- protected override void ProvideData(Transform transform, int index)
- {
- dataSource.ProvideData(transform, index);
- }
-
- // Multi Data Source cannot support TempPool
- protected override async ETTask<RectTransform> GetFromTempPool(int itemIdx)
- {
- RectTransform nextItem = (await prefabSource.GetObject(itemIdx)).transform as RectTransform;
- nextItem.transform.SetParent(m_Content, false);
- nextItem.gameObject.SetActive(true);
- ProvideData(nextItem, itemIdx);
- return nextItem;
- }
- protected override void ReturnToTempPool(bool fromStart, int count)
- {
- Debug.Assert(m_Content.childCount >= count);
- if (fromStart)
- {
- for (int i = count - 1; i >= 0; i--)
- {
- prefabSource.ReturnObject(m_Content.GetChild(i));
- }
- }
- else
- {
- int t = m_Content.childCount - count;
- for (int i = m_Content.childCount - 1; i >= t; i--)
- {
- prefabSource.ReturnObject(m_Content.GetChild(i));
- }
- }
- }
- protected override void ClearTempPool()
- {
- }
- }
- }*/
|