public void EnterEditingMode(bool isEditing) { if ((isEditing && _cellStatus == UITableViewCellStatus.Deletable) || (!isEditing && _cellStatus == UITableViewCellStatus.Normal)) { Debug.Log("The Editing mode is already "+isEditing); return; } if (isEditing) { _cellStatus = UITableViewCellStatus.Deletable; } else { _cellStatus = UITableViewCellStatus.Normal; } foreach (var cellHolder in _cellHolders) { if (cellHolder.Cell != null) { cellHolder.Cell.ChangeToStatus(_cellStatus); } } }
public void ChangeToStatus(UITableViewCellStatus status) { switch (status) { case UITableViewCellStatus.Normal: _isTouchable = true; if (_deleteButton != null) { _deleteButton.gameObject.SetActive(false); } break; case UITableViewCellStatus.Deletable: _isTouchable = false; if (_deleteButton != null) { _deleteButton.gameObject.SetActive(true); } break; } }