1 public List<BaseItem> GetLoot() 2 { 3 int check = Random.Range(1, 101); 4 5 for (int i = 0; i < cumulativePercentages.Count - 1; i++) 6 { 7 //Check if the random number we generated is between this set of values 8 if (check > cumulativePercentages[i] && check <= cumulativePercentages[i + 1]) 9 { 10 return lootEntries[i].Items; 11 } 12 } 13 14 return new List<BaseItem>(); 15 }