void Start()
    {
        CardDatabase.LoadAllCards();
        GearDatabase.LoadAllGear();

        if (GameplayContext.CurrentInventory is null || GameplayContext.RequestReset)
        {
            playerInventory = new InventoryCollection();
            //two legs
            playerInventory.AddItem(GearDatabase.GetGearDataByID(0));
            playerInventory.AddItem(GearDatabase.GetGearDataByID(0));
            //two melee arm
            playerInventory.AddItem(GearDatabase.GetGearDataByID(1), 2);
            //two rifle arm
            playerInventory.AddItem(GearDatabase.GetGearDataByID(3), 2);
            GameplayContext.CurrentInventory = playerInventory;
            Debug.Log("made new inventory");
        }
Example #2
0
    /// <summary>
    ///
    /// </summary>
    /// <param name="gear">the gear to equip</param>
    /// <param name="inventory">the inventory to return unequipped items into</param>
    public void SetEquippedGear(GearData gear, InventoryCollection inventory)
    {
        if (equippedGear != null && inventory != null)
        {
            inventory.AddItem(equippedGear);
        }

        equippedGear = gear;
        if (gear != null)
        {
            icon.enabled = true;
            icon.sprite  = gear.art;
            UpdateDependants(true, inventory);
        }
        else
        {
            icon.enabled = false;
            UpdateDependants(false, inventory);
        }
    }