Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- BoxSettings GetRandomBoxSettings()
- {
- int rand = Random.Range(0, sum_of_rate);
- foreach (BoxSettings box in list)
- {
- if (rand >= box.rate)
- rand -= box.rate;
- else
- return box;
- }
- return null;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement