protected override RectTransform InstantiateNextItem(int itemIdx) { ContactElementView contactElement = _contactElementPrefabSource.GetObject(content); _spawnedContactElements.Add(contactElement); _data.ProvideData(contactElement, itemIdx); contactElement.gameObject.SetActive(true); return(contactElement.transform as RectTransform); }
protected override void ProvideData(Transform transform, int idx) { ContactElementView contactElement = _spawnedContactElements.FirstOrDefault(x => x.transform == transform); if (contactElement == null) { return; } _data.ProvideData(contactElement, idx); }
protected override void ReturnObject(Transform transform) { ContactElementView contactElement = _spawnedContactElements.FirstOrDefault(x => x.transform == transform); if (contactElement == null) { return; } _spawnedContactElements.Remove(contactElement); _contactElementPrefabSource.ReturnObject(contactElement); }
public void ProvideData(ContactElementView contactElementView, int idx) { contactElementView.SetData(objectsToFill[idx]); }
public void ReturnObject(ContactElementView go) { _pool.Despawn(go); }