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); }
public void AddPool(string poolName, GameObject prefab, int maxCount, int initCount) { m_Group.AddPool(poolName, prefab, maxCount, initCount); }