Kaffee
This commit is contained in:
@ -7,6 +7,9 @@ namespace Utility
|
||||
{
|
||||
public static T GetRandomElement<T>(this IReadOnlyList<T> list)
|
||||
{
|
||||
if (list.Count == 0)
|
||||
return default;
|
||||
|
||||
return list[Random.Range(0, list.Count)];
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user