Quantcast
Channel: Answers by "Superrodan"
Viewing all articles
Browse latest Browse all 62

Answer by Superrodan

$
0
0
I would create a list with them. I'm relatively new at lists and haven't used them much but I would try to do something like this: public int GetANumber() { List numbers = new List(); numbers.Add(1); numbers.Add(2); numbers.Add(3); numbers.Add(5); numbers.Add(8); numbers.Add(10); int length = numbers.Count; int random = Random.Range(0,length); return numbers[random]; } The section where I add the numbers you listed manually would need to be replaced with whatever you need to do to get the numbers you have into the list. So if you have two arrays you need to loop through them and add all the values to the list.

Viewing all articles
Browse latest Browse all 62

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>