public void OnBeginDrag(PointerEventData eventData)
        {
            if (eventData.button != PointerEventData.InputButton.Left)
            {
                return;
            }

            foreach (var inventoryViews in InventoryViews)
            {
                inventoryViews.OnPrePick(targetCell);
            }

            var stareData = targetCell?.CellData;
            var isHold    = InventoryViews.Any(x => x.OnPick(targetCell));

            if (!isHold)
            {
                return;
            }

            effectCell.RectTransform.gameObject.SetActive(true);
            effectCell.Apply(stareData);

            foreach (var inventoryViews in InventoryViews)
            {
                inventoryViews.OnPicked(effectCell);
            }
        }
Exemple #2
0
 protected void ApplyCell(IInventoryCellView cellView, int cellIndex, IInventoryCellData cellData)
 {
     cellView.Apply(cellData);
     viewData.InsertInventoryItem(cellIndex, cellData);
 }