public void UseItemByKeyEvent(OnKeyDownEventData e)
    {
        switch (e.Key)
        {
        case KeyCode.F1:
            Items.GetItemAtIndex(0).Emitter.Emit(
                new OnItemUseEventData(gameObject)
                );
            break;

        case KeyCode.F2:
            Items.GetItemAtIndex(1).Emitter.Emit(
                new OnItemUseEventData(gameObject)
                );
            break;

        case KeyCode.F3:
            Items.GetItemAtIndex(2).Emitter.Emit(
                new OnItemUseEventData(gameObject)
                );
            break;

        case KeyCode.F4:
            Items.GetItemAtIndex(3).Emitter.Emit(
                new OnItemUseEventData(gameObject)
                );
            break;

        case KeyCode.F5:
            Items.GetItemAtIndex(4).Emitter.Emit(
                new OnItemUseEventData(gameObject)
                );
            break;
        }
    }
 public void ShowInventoryByKeyEvent(OnKeyDownEventData e)
 {
     switch (e.Key)
     {
     case KeyCode.I:
         InventoryUI.ToggleIsOpen();
         break;
     }
 }
    public void MoveSelectedIndexOnKey(OnKeyDownEventData e)
    {
        switch (e.Key)
        {
        case KeyCode.J:
            VerticalIndex++;
            break;

        case KeyCode.K:
            VerticalIndex--;
            break;
        }
        RefreshRenderedItems();
        RefreshComparedItems();
    }
    public void AttackByKeyEvent(OnKeyDownEventData e)
    {
        switch (e.Key)
        {
        case KeyCode.Mouse0:
            if (LockOnBehaviour.LockedOntoBody != null)
            {
                LaunchAttackToBody(LockOnBehaviour.LockedOntoBody);
            }
            else
            {
                LaunchAttackToMousePoint();
            }
            break;

        case KeyCode.Alpha1:
            CastSpell(0);
            break;

        case KeyCode.Alpha2:
            CastSpell(1);
            break;

        case KeyCode.Alpha3:
            CastSpell(2);
            break;

        case KeyCode.Alpha4:
            CastSpell(3);
            break;

        case KeyCode.Alpha5:
            CastSpell(4);
            break;
        }
    }
    public void UseItemOnKey(OnKeyDownEventData e)
    {
        if (isMoving)
        {
            return;
        }
        switch (e.Key)
        {
        case KeyCode.L:
            if (CurrentPanel == Panels.Category)
            {
                if (VerticalIndex < 0 || VerticalIndex > CategryUIControl.Lines.GetSize() - 1)
                {
                    return;
                }
                VerticalIndexStack.Push(VerticalIndex);
                CategryUIControl.Lines.Get(VerticalIndex).GetComponent <Animator>().enabled = false;
                VerticalIndex = 0;
                CurrentPanel  = Panels.Item;
                StartCoroutine(Move(new Vector3(-183.1666f, 0f, 0f), 0.5f));
            }
            else if (CurrentPanel == Panels.Item)
            {
                if (VerticalIndex < 0 || VerticalIndex > ItemUIControl.Lines.GetSize() - 1)
                {
                    return;
                }
                Item i = PlayerInventory.GetItemAtIndexAndCategory(VerticalIndex, CurrentCategory);
                i.Emitter.Emit(
                    new OnItemUseEventData(Owner)
                    );
                if (CurrentCategory == Item.ItemTag.Armour ||
                    CurrentCategory == Item.ItemTag.Weapon
                    )
                {
                    CurrentPanelStack.Push(CurrentPanel);
                    VerticalIndexStack.Push(VerticalIndex);
                    EquipmentPanel.gameObject.SetActive(true);
                    EquipmentPanel.Show();
                    EquipmentPanel.SetNewItem(i);
                    foreach (PlayerEquipmentPanelSlot slot in EquipmentPanel.GetAllSlots())
                    {
                        if (PlayerEquipment.IsItemInSlot(slot.EquipmentSlot))
                        {
                            Item uii = PlayerEquipment.GetItemInSlot(slot.EquipmentSlot);
                            uii.UIEmitter.Emit(new OnUIItemEquipEventData(
                                                   Owner,
                                                   slot
                                                   ));
                            EquipmentPanel.SetCurrentItem(uii);
                        }
                    }
                    CurrentPanel = Panels.Equipment;
                    RefreshComparedItems();
                }
            }
            else if (CurrentPanel == Panels.Equipment)
            {
                Item i = EquipmentPanel.GetNewItem();
                i.Emitter.Emit(new OnItemAttemptEquipEventData(
                                   Owner,
                                   i,
                                   EquipmentPanel.GetSelectedSlot().EquipmentSlot
                                   ));
                i.UIEmitter.Emit(new OnUIItemAttemptEquipEventData(
                                     Owner,
                                     i,
                                     EquipmentPanel,
                                     EquipmentPanel.GetSelectedSlot().EquipmentSlot
                                     ));
                RefreshComparedItems();
            }
            RefreshRenderedItems();
            break;

        case KeyCode.H:
            if (CurrentPanel == Panels.Item)
            {
                if (VerticalIndex >= 0 && VerticalIndex < ItemUIControl.Lines.GetSize())
                {
                    ItemUIControl.Lines.Get(VerticalIndex).Selector.GetComponent <Image>().enabled = false;
                }
                VerticalIndex = VerticalIndexStack.Pop();
                CategryUIControl.Lines.Get(VerticalIndex).GetComponent <Animator>().enabled = true;
                CurrentPanel = Panels.Category;
                StartCoroutine(Move(new Vector3(183.1666f, 0f, 0f), 0.5f));
            }
            else if (CurrentPanel == Panels.Equipment)
            {
                EquipmentPanel.Close();
                CurrentPanel  = CurrentPanelStack.Pop();
                VerticalIndex = VerticalIndexStack.Pop();
            }
            break;

        case KeyCode.X:
            if (CurrentPanel == Panels.Equipment &&
                PlayerEquipment.IsItemInSlot(EquipmentPanel.GetSelectedSlot().EquipmentSlot)
                )
            {
                Item uii = PlayerEquipment.GetItemInSlot(EquipmentPanel.GetSelectedSlot().EquipmentSlot);
                uii.Emitter.Emit(new OnItemUnequipEventData(
                                     Owner,
                                     uii,
                                     EquipmentPanel.GetSelectedSlot().EquipmentSlot
                                     ));
                uii.UIEmitter.Emit(new OnUIItemUnequipEventData(Owner, EquipmentPanel.GetSelectedSlot()));
                RefreshComparedItems();
            }
            break;
        }
    }