Example #1
0
    void Start()
    {
        if (ItemGoPrefab == null) //get the prefab
        {
            ItemGoPrefab = Resources.Load <GameObject>("Prefabs/ItemInventoryGO");
        }

        if (EqSlotsParent == null)//get the transform
        {
            EqSlotsParent = transform.Find("EquipmentSlots");
        }

        for (int i = 0; i < EqSlotsParent.childCount; i++)//add all the slots in EqSlotsParent
        {
            GearMainType gearType = EqSlotsParent.GetChild(i).GetComponent <EqSlotProps>().GearType;
            if (EquipmentSlots.ContainsKey(gearType) == false)
            {
                EquipmentSlots.Add(gearType, EqSlotsParent.GetChild(i));
            }
        }

        if (GameObject.Find("InventoryWindow") != null)
        {
            AccInv = GameObject.Find("InventoryWindow").GetComponent <InventoryManager>();
        }
    }
Example #2
0
    public void RemoveItemFromEquipmentInventory(GearMainType WhichType)
    {
        //codes for removing item from the equipment inventory and sending it back to the main inventory
        ItemProps AccIP = EquipmentInventory[WhichType].TheGameObject.GetComponent <ItemProps>();

        AccIP.DestroyItem();
        EquipmentInventory.Remove(WhichType);
    }
Example #3
0
    public Item(Item item)
    {
        this.title       = item.title;
        this.id          = item.id;
        this.description = item.description;
        this.icon        = item.icon;
        this.stats       = item.stats;

        this.rarity       = item.rarity;
        this.atributes    = item.atributes;
        this.gearMainType = item.gearMainType;
        this.itemType     = item.itemType;
    }
Example #4
0
 static public string  TakeGearMainType(GearMainType itemGearMainType)
 {
     return(lgearMainType[(int)itemGearMainType]);
 }