11000+款5星资源

8.5万+用户参与评分

10万+社区成员鼎力支持

每款资源都经过 Unity 审核

1/5
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.

Random Exclude

(暂无评分)
5 users have favourite this asset
(5)
$4.99
席位
1
更新的价格和增值税在结算时计算
退款政策
该资源受Unity资源商店退款政策约束。有关详细信息,请参见《最终用户许可协议》(EULA)中的第2.9.3节。
安全结账方式:
Supported payment methods: Visa, Mastercard, Maestro, Paypal, Amex
许可证类型
文件大小
57.5 KB
最新版本
1.0
最新发布日期
2019年1月16日
原始 Unity 版本
5.6.1
高品质资源
11000+款5星资源
深受用户信赖
8.5万+用户参与评分
强大的社区支持
10万+社区成员鼎力支持
Unity logo
语言
反馈
合作伙伴计划
合作伙伴
USD
EUR
Copyright © 2025 Unity Technologies
所有价格不包含税
USD
EUR
$4.99