Random Exclude View on Asset Store (opens in new tab)

Package details

Latest version
1.0
Last updated
First released
Unity version
5.6.1 or later
Package size
58 KB
Files
5
Favorites
5
Views in the past week
0

Price tracking

Last checked
Tracked since
Lowest recorded
$4.99 on

Random Exclude

by Poranny (opens in new tab)

1 rating, too few to average

Price $4.99

Buy on Asset Store (opens in new tab)

Affiliate link · Purchases support this site

Price history

Last 6 months

USD
Price history for Random Exclude, 6 months Current $4.99; lowest $4.99; highest $4.99 in this period. $0 $2.5 $5 Jun Jul Aug Sep Oct Nov

Asset preview

1 / 4

Random Exclude screenshot 1

Random Exclude screenshot 1

About this asset

Have you ever tried to generate a random number by Random.Range but had no idea how to exclude some values you don't need? Well, here comes your solution!
The most straightforward reason you'd want to use our functions is when you simply need to generate a random number between "1" and "10", but don't want "7" to appear.
Or between "-10" and "10", but don't want "-1", "0" and "3" (and just as many as you want!) to come as a result.
Or between "0" and "1000", but don't want anything between "100" and "900".
Seems quite simple, but in fact it has a plenty of uses!
Included functions:
- RandomExclude.RandomInt (int, int, int): You generate a random number greater than or equal to the first int and smaller than or equal to the second one, while excluding the third one;
- RandomExclude.RandomInt (int, int, List (int)): You generate a random number greater than or equal to the first int and smaller than or equal to the second one, while excluding all the ints included in the list;
- RandomExclude.RandomInt (int, int, Vector2): You generate a random number greater than or equal to the first int and smaller than or equal to the second one, while excluding all values bigger than or equal to the Vector2.x and smaller than or equal to the Vector2.y;
- RandomExclude.RandomInt (int, int, List (Vector2)): You generate a random number greater than or equal to the first int and smaller than or equal to the second one, while excluding all the intervals specified by the Vectors in the same way as in the (int, int, Vector2) function.

From the publisher's Asset Store listing.