private void Awake() { Debug.Assert(_settings != null, "Please assign Settings to SceneController"); _entriesPool = new EntriesPool(_settings.EntrySettings, parent, this, _settings.EntriesPerPage); _parser = new CsvParser(); _fileData = _parser.ParseFromResources(_settings.FileToLoad); _totalPages = _fileData.EntriesCount() % _settings.EntriesPerPage == 0 ? _fileData.EntriesCount() / _settings.EntriesPerPage : (_fileData.EntriesCount() / _settings.EntriesPerPage) + 1; }
private void GetPage() { _entriesPool.SetPoolActive(false); var pageStartIdx = _currPage * _settings.EntriesPerPage; var pageEndIdx = Math.Min(pageStartIdx + _settings.EntriesPerPage, _fileData.EntriesCount() - 1); _entriesPool.SetEntriesData(_fileData.GetHeaders(), pageStartIdx, _fileData.GetEntries() .Where((v, i) => i >= pageStartIdx && i < pageEndIdx) .ToList()); }