private void Gather(GameObject self, ResourceTypes.Types type, int amount) { WorkerInventory inventory = self.gameObject.GetComponent <WorkerInventory>(); inventory.AddResource(type, amount); gatherProgress += amount; }
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; }