public void UpdateItemAt(int _index, object _data) { data[_index] = _data; for (int i = 0; i < showPool.Count; i++) { SuperListCell cell = showPool[i]; if (cell.index == _index) { cell.SetData(_data); break; } } }
private void SetCellData(SuperListCell _cell, int _index) { if (_index == -1) { _cell.SetData(null); } else if (!isAlphaIn) { _cell.SetData(data[_index]); } else { bool result = _cell.SetData(data[_index]); if (result) { _cell.canvasGroup.alpha = 0; int index = alphaInList.IndexOf(_cell); bool needStart = false; if (index != -1) { if (index == 0) { _cell.StopAlphaIn(); needStart = true; } alphaInList.RemoveAt(index); } alphaInList.Add(_cell); if (alphaInList.Count == 1 || needStart) { alphaInList[0].AlphaIn(OneAlphaInOver); } } else { _cell.canvasGroup.alpha = 1; int index = alphaInList.IndexOf(_cell); bool needStart = false; if (index != -1) { if (index == 0) { _cell.StopAlphaIn(); needStart = true; } alphaInList.RemoveAt(index); } if (needStart && alphaInList.Count > 0) { alphaInList[0].AlphaIn(OneAlphaInOver); } } } }