Пример #1
0
        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);
        }
Пример #2
0
        protected override void ProvideData(Transform transform, int idx)
        {
            ContactElementView contactElement = _spawnedContactElements.FirstOrDefault(x => x.transform == transform);

            if (contactElement == null)
            {
                return;
            }

            _data.ProvideData(contactElement, idx);
        }
Пример #3
0
        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]);
 }
Пример #5
0
 public void ReturnObject(ContactElementView go)
 {
     _pool.Despawn(go);
 }