| | |
| | | {
|
| | | bool isShowMat = itemId != 0 || itemModel != null ? true : false;
|
| | | itemCell.gameObject.SetActive(isShowMat);
|
| | | itemCell.cellBtn.RemoveAllListeners();
|
| | | itemCell.reducebtn.RemoveAllListeners();
|
| | | if (isShowMat)
|
| | | {
|
| | | if (itemModel != null)
|
| | | {
|
| | | itemCell.Init(itemModel);
|
| | | itemCell.cellBtn.AddListener(ClickItemCell);
|
| | | itemCell.button.SetListener(ClickItemCell);
|
| | | }
|
| | | else
|
| | | {
|
| | |
|
| | | ItemCellModel cellModel = new ItemCellModel(itemId);
|
| | | itemCell.Init(cellModel);
|
| | | itemCell.cellBtn.AddListener(ClickItemCell);
|
| | | itemCell.button.SetListener(ClickItemCell);
|
| | | }
|
| | |
|
| | | switch(matType)
|
| | |
| | | case NeedMatType.unfixedItem:
|
| | | case NeedMatType.addItem:
|
| | | itemCell.reducebtn.gameObject.SetActive(true);
|
| | | itemCell.reducebtn.AddListener(ClickReduce);
|
| | | itemCell.reducebtn.SetListener(ClickReduce);
|
| | | break;
|
| | | }
|
| | | }
|