public void SetCurrentDragedItem(GridItem item, bool longPressMode) { _gridItem = item; InventoryUI.SetEventPanelActive(true); if (item.GetContainedPanel() is InventoryUI) { _fromInventory = true; Inventory.RemoveItemFromInventory(_gridItem, false); } else { Equipment.RemoveItem(item.GetItemReference()); _fromInventory = false; } underItem = ObjectPoolManager.Instance.GetObject <UnderMouseItem>(UNDER_MOUSE_ICON_PREFAB_KEY); underItem.Setup(item.GetItemReference().Image); underItem.transform.SetParent(InventoryUI.CanvasRoot.transform); underItem.transform.localScale = Vector2.one; ObjectPoolManager.Instance.RecycleObject(_gridItem.GetComponent <PoolableObjectInstance>()); _longPressMode = longPressMode; if (_longPressMode) { InventoryUI.SetScrollRectActive(false); } }
private void OnPanelOpenCloseActionCallBack(GeneralPanel panel) { if (InventoryUI.State == GeneralPanel.PopUpState.Closed && EquipmentUI.State == GeneralPanel.PopUpState.Closed) { if (_gridItem != null) { if (_gridItem.GetContainedPanel() is EquipmentUI) { AddCurrentItemToInventory(true); } else { AddCurrentItemToInventory(false); } } } }