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