コード例 #1
0
ファイル: UI_RuneExp.cs プロジェクト: ww386362087/MoyuHero
    void UpdateRuneItem(int index, RectTransform cell)
    {
        if (index < _curRuneList.Count)
        {
            RuneItem item = cell.gameObject.GetComponent <RuneItem>();
            if (item == null)
            {
                item = cell.gameObject.AddComponent <RuneItem>();
            }

            item.tableID = _curRuneList[index].item.GetItemTableID();
            item.guid    = _curRuneList[index].item.GetItemGuid();
            item.index   = index;
            item.ShowInfo();

            if (_selectRuneList.Count == 12)
            {
                if (isAdd)
                {
                    if (_curRuneList[index].isSelect == false)
                    {
                        item.SetSelectBtnState(false);
                        item.updateSelectBtn(true);
                    }
                    else
                    {
                        item.SetSelectBtnState(true);
                        item.updateSelectBtn(false);
                    }
                }
                else
                {
                    if (_curRuneList[index].isSelect)
                    {
                        item.SetSelectBtnState(true);
                        item.updateSelectBtn(false);
                    }
                    else
                    {
                        item.SetSelectBtnState(false);
                        item.updateSelectBtn(false);
                    }
                }
            }
            else
            {
                item.SetSelectBtnState(_curRuneList[index].isSelect);
                item.updateSelectBtn(false);
            }
        }
    }