예제 #1
0
    // Check if slot is a valid destination for item
    public bool IsValid(Item item, ItemSlot slot)
    {
        if (slot is InventorySlot)
        {
            return(true);
        }

        if (slot is EquipSlot)
        {
            if (item is Equipment)
            {
                EquipSlot es = (EquipSlot)slot;
                Equipment eq = (Equipment)item;

                Debug.Log("Slot wear slot: " + es);
                Debug.Log("Item wear slot: " + eq.GetWearSlot());

                return(es.GetWearSlot() == eq.GetWearSlot());
            }
        }

        return(false);
    }