Beispiel #1
0
    public ArmourItemData GetEquippedArmour(ArmourItemData.SlotType armourSlotType)
    {
        foreach (var inventoryItem in _inventoryItems)
        {
            if (inventoryItem.Item.ItemType == ItemType.eARMOUR)
            {
                ArmourItemData inventoryArmour = (ArmourItemData)inventoryItem.Item;
                if (inventoryArmour.ArmourSlotType == armourSlotType)
                {
                    return((ArmourItemData)inventoryItem.Item);
                }
            }
        }

        return(null);
    }
    public Sprite GetRandomArmourIcon(ArmourItemData.SlotType slotType)
    {
        switch (slotType)
        {
        case ArmourItemData.SlotType.eHEAD:
            return(_helmet[Random.Range(0, _helmet.Count)].Sprite);

        case ArmourItemData.SlotType.eCHEST:
            return(_chest[Random.Range(0, _chest.Count)].Sprite);

        case ArmourItemData.SlotType.eLEGS:
            return(_legs[Random.Range(0, _legs.Count)].Sprite);

        default:
            return(_helmet[0].Sprite);
        }
    }