Home > @esengine/ecs-framework-monorepo > MathUtils > randomChoice
MathUtils.randomChoice() method
随机选择数组中的一个元素
Signature:
typescript
static randomChoice<T>(array: T[]): T;
Parameters
Parameter | Type | Description |
---|---|---|
array | T[] | 数组 |
Returns:
T
随机元素