Exemplo n.º 1
0
    public void EquipItem(CharacterEquipment to)
    {
        if (Inventory == null || to == null || Item == null || Item.Item == null)
        {
            return;
        }
        switch (Item.Item.ItemType)
        {
        case ItemType.eCONSUMABLE:
            break;

        case ItemType.eARMOUR:
            to.EquipArmour((ArmourItemData)Item.Item, Inventory);
            break;

        case ItemType.eWEAPON:
            to.EquipWeapon((WeaponItemData)Item.Item, Inventory);
            break;
        }

        FindObjectOfType <EventSystem>().SetSelectedGameObject(transform.parent.GetChild(0).gameObject);

        Destroy(_itemToolTipInstance);
    }