Advertisement
CyberN00b

Untitled

Mar 4th, 2023
649
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.30 KB | None | 0 0
  1. BoxSettings GetRandomBoxSettings()
  2.     {
  3.         int rand = Random.Range(0, sum_of_rate);
  4.         foreach (BoxSettings box in list)
  5.         {
  6.             if (rand >= box.rate)
  7.                 rand -= box.rate;
  8.              else
  9.                 return box;
  10.         }
  11.         return null;
  12.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement