예제 #1
0
        private void RollForTable(object myReturned, ref int myAmount)
        {
            float            myRange      = Random.Range(0, 100);
            ProbabilityEntry myEntryToUse = FindTableByFloat(myRange);

            myEntryToUse.getItem(myReturned, ref myAmount);
        }
예제 #2
0
        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);
        }