public ScavengeResult Scavenge() { ScavengeResult result = new ScavengeResult(this); foreach (var item in scavengableItems) { int random = Random.Range((int)item.minimumScavengable, (int)item.maximumScavengable + 1); if (random > 0) { StorageManager storageManager = GameObject.Find("StorageManager").GetComponent <StorageManager>(); storageManager.AddItems(item.scavengableItem, (uint)random); Item_And_Quantity scavenged = new Item_And_Quantity(item.scavengableItem, (uint)random); result.scavengedItems.Add(scavenged); } } return(result); }