Exemple #1
0
        private void SetCellData(SuperListCell _cell, int _index)
        {
            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);
                    }
                }
            }
        }