コード例 #1
0
        public void SetSourceAndCenterOn(IListSource source, int index)
        {
            _source       = source;
            _prefabSource = source as IPrefabSource;

            OnInvalidate();
            scrollRect.content.anchoredPosition = GetCenteredScrollPosition(index);
            UpdateVisibilityDisjoint();
        }
コード例 #2
0
        // Clears the list and destroy pooled elements
        public void Clear()
        {
            _source       = null;
            _prefabSource = null;
            foreach (var pair in _activeCells)
            {
                Object.Destroy(pair.Value.View);
            }
            _activeCells.Clear();
            _activeIndices = Vector2.zero;

            if (_poolParent != null)
            {
                Object.Destroy(_poolParent.gameObject);
                _poolParent = null;
            }
            _pool.Clear();
        }
コード例 #3
0
 // Sets the data source for the virtual list
 public void SetSource(IListSource source)
 {
     _source       = source;
     _prefabSource = source as IPrefabSource;
     Invalidate();
 }