mirror of
https://github.com/Steffo99/hella-farm.git
synced 2024-11-25 09:34:24 +00:00
15 lines
235 B
GDScript3
15 lines
235 B
GDScript3
|
extends Sampler
|
||
|
class_name SamplerRandom
|
||
|
|
||
|
|
||
|
## Sample a random reference from the array.
|
||
|
|
||
|
|
||
|
@export var possibilities: Array = []
|
||
|
|
||
|
|
||
|
func sample() -> Object:
|
||
|
if len(possibilities) == 0:
|
||
|
return null
|
||
|
return Random.sample(possibilities)
|