private RectTransform InstantiateNextItem(int itemIdx) { if (m_PoolGroup == null) { m_PoolGroup = GameObjectPoolMgr.S.CreatePoolGroup(UIPoolStrategy.S); } string poolName = null; GameObject prefab = null; GetCellInfo(itemIdx, out poolName, out prefab); if (prefab == null) { return(null); } if (!m_PoolGroup.HasPool(poolName)) { m_PoolGroup.AddPool(poolName, prefab, 0, 1); } //RectTransform nextCell = ResourceManager.Instance.GetObjectFromPool("NetImage", true, 1).GetComponent<RectTransform>(); RectTransform nextCell = m_PoolGroup.Allocate(poolName).GetComponent <RectTransform>(); nextCell.transform.SetParent(content, true); nextCell.gameObject.SetActive(true); SendMessageToNewObject(nextCell, itemIdx); return(nextCell); }
protected override void OnDestroy() { base.OnDestroy(); if (m_PoolGroup != null) { m_PoolGroup.RemoveAllPool(false); m_PoolGroup = null; } }
public GameObjectPoolGroup CreatePoolGroup(IGameObjectPoolStrategy strategy = null) { GameObjectPoolGroup group = new GameObjectPoolGroup(transform, strategy); return(group); }
public override void OnSingletonInit() { m_Group = new GameObjectPoolGroup(transform); }