public void UnequipItem(InventorySlot inventorySlot) => InventoryService.Unequip(_equippedItemSlots[inventorySlot]);
public void Cancel() { ViewerDisable(); slot = null; SelectWidget = Widget.NoSelect; }
public void SetActiveSlot(InventorySlot inventorySlot) { Inventory.SetActiveSlot(null); _activeSlot = inventorySlot; }
protected abstract void OnDisappear(PointerEventData eventData, InventorySlot slot); //비활성화 이벤트 protected abstract void DrawContent(InventorySlot slot); //뷰어 내용 그리기 메서드
protected override void OnDisappear(PointerEventData eventData, InventorySlot slot) { }
protected abstract void EventCall(); //이벤트 할당 메서드 protected abstract void OnDisplay(PointerEventData eventData, InventorySlot slot); //활성화 이벤트
protected abstract void OnDisplay(PointerEventData eventData, InventorySlot slot); //활성화 이벤트 protected abstract void OnDisappear(PointerEventData eventData, InventorySlot slot); //비활성화 이벤트
private void OnDragEnded(InventorySlot inventorySlot, Vector2 pointerPosition) { DraggingInventorySlot.GetComponent <InventorySlot>().SetMainSprite(null); DraggingInventorySlot.SetActive(false); DragEnded?.Invoke(inventorySlot, pointerPosition); }
private void Drag(InventorySlot inventorySlot, Vector2 pointerPosition) { _draggingItemRect.localPosition = new Vector3(pointerPosition.x, pointerPosition.y) - _canvasRect.localPosition - _panelRect.localPosition; }
private void DragStarted(InventorySlot inventorySlot, Vector2 pointerPosition) { DraggingInventorySlot.GetComponent <InventorySlot>().SetMainSprite(inventorySlot.MainSprite); DraggingInventorySlot.SetActive(true); }
public int GetIndexOfInventorySlot(InventorySlot inventorySlot) => _inventorySlots.IndexOf(inventorySlot) + GetFirstItemIndex();
public IItem GetItemOfInventorySlot(InventorySlot inventorySlot) => InventoryService.Get(GetIndexOfInventorySlot(inventorySlot));