private void RollForTable(object myReturned, ref int myAmount) { float myRange = Random.Range(0, 100); ProbabilityEntry myEntryToUse = FindTableByFloat(myRange); myEntryToUse.getItem(myReturned, ref myAmount); }
public void AddToTable(object myNewMonster, float spawnProbability) {//TODO: Add check for random //Debug.Assert(spawnProbability > 0 && spawnProbability < 100, "Odd spawn probability detected!"); ProbabilityEntry myEntry = new ProbabilityEntry(); myEntry.myProbability = spawnProbability; myEntry.SetItem(myNewMonster); myProbabilities.Add(myEntry); }