Example #1
0
    private void Gather(GameObject self, ResourceTypes.Types type, int amount)
    {
        WorkerInventory inventory = self.gameObject.GetComponent <WorkerInventory>();

        inventory.AddResource(type, amount);
        gatherProgress += amount;
    }
Example #2
0
    public void RemoveResource(ResourceTypes.Types resource, int amount)
    {
        int outValue;

        if (!resourceInventory.TryGetValue(resource, out outValue))
        {
            Debug.LogWarning("Resource not found!");
            return;
        }

        resourceInventory[resource] -= amount;
    }